Home > System Administrator's Guide > How does query caching in MySQL helps improve performance of dynamic web site?

How does query caching in MySQL helps improve performance of dynamic web site?

September 20th, 2009

First query cache is new and added in MySQL v4.x.x version only so if you are using old version of MySQL server it will not work.

When MySQL server recives a request it will parse it and retrives data from database/table and sent back to client browser. If same query request (in case of dynamic content) comes repeatedly and server will just sent them result from cache (thus saving disk I/O and other associated cost with each query).
Please note that when data stored in table is modified, any related cached entries in the query cache are flushed.

How to check the global variable from mysql prompt

mysql> show variables like 'query_cache_size';

mysql> show variables like 'query%';

How do I find out my MySQL query cache is working or not…Very simple, MySQL provides the stats of same just type following command at mysql> prompt:

mysql> show status like 'Qcache%';

mysql> show status like 'qc%';

How to clear the query cache

mysql> reset query cache;
 

Comments are closed.