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:


In summary:

  1. Benchmark, benchmark, benchmark!
  2. Profile, profile, profile!
  3. Tighten Up Your Schema
  4. Partition Your Tables
  5. Don’t Overuse Artificial Primary Keys
  6. Learn Your Indices
  7. SQL is Not C
  8. Understand your engines
  9. MySQL specific shortcuts
  10. Read Peter Zaitsev’s MySQL Performance Blog

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>