10 Tips for Optimizing MySQL Queries
In my quest to understand MySQL’s EXPLAIN statement and to learn more strategies for optimizing queries, I came across this excellent blog post from 20bits by Jesse Farmer:
http://20bits.com/articles/10-tips-for-optimizing-mysql-queries-that-dont-suck/
In summary:
- Benchmark, benchmark, benchmark!
- Profile, profile, profile!
- Tighten Up Your Schema
- Partition Your Tables
- Don’t Overuse Artificial Primary Keys
- Learn Your Indices
- SQL is Not C
- Understand your engines
- MySQL specific shortcuts
- Read Peter Zaitsev’s MySQL Performance Blog
Written on May 4, 2009