Supertext Home
Chief of the System Blog

Benchmark MySQL Queries

July 26th, 2008 by

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

Related Posts

  1. Changing the MySQL my.ini File in Windows Vista
  2. WordPress upgrade to 2.6 deletes all Categories
  3. Can’t save new post with WordPress 3.0
  4. MySQL–Update and Insert if not exists

Leave a Reply

  • Topics
  • Archive
  • Subscribe
  • Facebook
  • Twitter