Things that Kill MySQL Performance

Posted by Chief on Nov 4, 2009 in Lessons | Subscribe
  1. Failing to plan for scaling out, scaling up
  2. Not using EXPLAIN (learn from your mistakes)
  3. Using the wrong data types (hint: use smallest fixed-size)
  4. Using persistent connections in PHP (leads to zombie processes)
  5. Using a heavy DB abstraction layer (hint: use PDO or custom)
  6. Using the wrong storage engine (MEMORY, ARCHIVE, InnoDB, etc.)
  7. Using indexes improperly (hint: select in the order of the index; hint: keep primary key small)
  8. Issuing SQL queries that can’t be cached easily; having too large of a query cache
  9. Using stored procedures when prepared statements are better
  10. Using functions on indexed columns in the WHERE clause
  11. Not indexing important columns; having redundant indexes
  12. Using sub-queries when joins would be better
  13. Issuing avoidable deep scans
  14. Doing SELECT COUNT(*) without WHERE on InnoDB table.
  15. Failing to profile/benchmark your SQL
  16. Not using AUTO_INCREMENT if applicable
  17. Not using ON DUPLICATE KEY UPDATE (1 query vs 2)

Reference:

Tags: , , , ,

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Copyright © 2010 cat brain.log | less All rights reserved.
Shades v1.2 theme from BuyNowShop.com.