Benchmark MySQL Queries

There are already tons of Pages dedicated to the tuning and benchmarking of MySQL. But one thing that took me a long time to figure out is who to easy figure out what makes a query fast and what not. The problem is that all queries are cached, so every time you run it, you get different results. The solution is

Select SQL_NO_CACHE * FROM mytable

The official documentation from MySQL is here. If you need some other good things, I can only recommend the MySQL Performance Blog.

You can also disable cache on a DB level with the Admin Interface under Health > System Variables > Memory > Cache or via query_cache_type in the config file. This way you can run your app normally and track down slow queries in the Slow Query Log.

http://www.petefreitag.com/item/390.cfm




Ähnliche Beiträge


Leave a Reply

Your email address will not be published. Required fields are marked *



*