I am building an online store and trying to improve performance by minimizing MYSQL queries.
Is it good to cache mysql queries through a txt file and then extract this instead of the query? This is what I do. "
Is this more efficient than executing sql queries every time? Any security issues I'm missing?
If you are just starting the application, memcache is a much faster way than using text files.
http://memcached.org/
Text files will do the job, and the steps you outlined make sense, but memcache will be faster and will handle a lot of hard work for you.
If you do the test, the cost of creating a unique hash and performing disk I / O will be more than just fetching from a MySQL server.
, , . , MySQL .
, " - ".
.
Mysql. , , .
http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
, RESTful, , HTTP - . :
PHP Apache . , , , - .
, thephpdeveloper , , / , IO, . , mysql, , , . Memcache , , , .
, / .
: 2, benchmarking profiling. , , - diciplines , mysql, php.ini, httpd.conf,.htaccess, - .
, .
. ( , SQL, , select, join )
select
join
. , . ( IO, )
, , - . , , , readfile() .
readfile()
MySQL ?