J’s Blog

MySQL Query Cache

Posted by: Jawaid on: 26 June 2009

MySQL query cache is good to cache select queries and their results and improve some performance of your database applications. So I thought I should write a quick tutorial to quickly set up the query cache without going into the details. So here what you have to do to enable query cache on MySQL.

If you want to enable query cache without restarting the MySQL server then just run the following command on MySQL prompt/client:

set global query_cache_size=67108864;


This will set MySQL query cache size to around 64MB and also enable the query cache. You can set it to any value you desire. You can then check the status later by running following commands on MySQL prompt/client:

SHOW VARIABLES LIKE ‘%query_cache%’;

SHOW STATUS LIKE ‘%qcache%’;


These commands will show some useful information about the query cache like if query cache is enabled, how much memory is being used, how many queries are currently in cache, cache hit rate etc.

This is really a quick way to enable query cache. For details see MySQL documentation http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html

1 Response to "MySQL Query Cache"

Hello Jawaid

I really admire your efforts and help in the response of your hard work and research. Your blog helps alot for not only amateur people also to professionals.

Thanks
sami khan

Leave a Reply

J’s Blog Feeds

J’s Archives

Blog Stats

  • 571 hits

J’s Calendar

June 2009
M T W T F S S
« May   Jul »
1234567
891011121314
15161718192021
22232425262728
2930  

  • Jawaid: Yes sure, and also why did it failed on make test, but successfully ran make install.
  • Andy Piper: Thanks for posting this. So it looks like the Perl extension (which is a 3rd party module, by the way) needs to specify the dependencies in its docume
  • m sami khan: Hello Jawaid I really admire your efforts and help in the response of your hard work and research. Your blog helps alot for not only amateur people

J’s Categories

J’s Pages

Top Clicks

  • None

J’s Blog Feeds Email Subscription

Enter your email address:

Delivered by FeedBurner

J’s Blog Feeds Email Subscription

J’s Feed Count

Twitter Updates

J's del.icio.us