Not a member? Why not join us or log in? (Free to Post your Articles and Blogs on Technology.)

query_cache_size – Tuning / Optimizing my.cnf file for MySQL

Home > MySQL>
Dated : October 20, 2010
Follow us on Twitter
Connect with us on Facebook
Subscribe via RSS Feed
Add Techgurulive to Google

query_cache_size:

  • MySQL 4 provides one feature that can prove very handy – a query cache. In a situation where the database has to repeatedly run the same queries on the same data set, returning the same results each time, MySQL can cache the result set, avoiding the overhead of running through the data over and over and is extremely helpful on busy servers.

To define Query Cache in My.cnf, Just add the follwoing line

query_cache_size=32M

To Verify Query cache, pass the following command in Mysql

 show status like 'qcache%';
mysql>  show status like 'qcache%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| Qcache_free_blocks      | 957     |
| Qcache_free_memory      | 3331504 |
| Qcache_hits             | 1046314 |
| Qcache_inserts          | 939847  |
| Qcache_lowmem_prunes    | 177821  |
| Qcache_not_cached       | 44523   |
| Qcache_queries_in_cache | 5804    |
| Qcache_total_blocks     | 14211   |
+-------------------------+---------+
8 rows in set (0.00 sec)

Tags:, ,

Written by simgish


Not Getting : Search to find what you are looking for


Liked this article? To continue getting our latest free Howtos and Tutorials,
you can also grab the RSS feed or Subscribe to Techgurulive by Email

Leave a Reply



This Howtos posted under : Home > MySQL->

query_cache_size – Tuning / Optimizing my.cnf file for MySQL