~/talk

MySQL Query Optimization Best Practices and Indexing

Talkat Highload fwdays'18 · on Saturday, 2018-09-15· [databases]
slides:none on file

Claims concrete fixes: treat queries over 500 ms as slow, capture and fingerprint them with PMM query analyzer or the slow query log, read EXPLAIN (JSON on 5.7+) and fix plans by updating stats with ANALYZE TABLE, collapse duplicate or redundant indexes and prefer a numeric primary key plus leftmost composite indexes. Use Percona Toolkit (pt-visual-explain, pt-duplicate-key-checker) and consider ProxySQL query rewrites when indexing and query rewrite fail.

AI-written summary · about

  1. 0:00Intro
  2. 1:57About Percona
  3. 4:22Indexing Basics
  4. 5:11Why do we need indexes?
  5. 6:35Traversal
  6. 7:20Leaf Nodes
  7. 8:46B-tree Structure
  8. 9:22Slow Index Lookups
  9. 12:33The Optimizer
  10. 13:51MySQL Optimizer
  11. 14:26Cost Model
  12. 15:25Finding and Identifying Slow Queries
  13. 18:38Slow Query Tools
  14. 20:12PMM/QAN
  15. 23:55Explain Plan (JSON)
  16. 25:16Explain Plan (pt-visual-explain)
  17. 26:11Cost Based Access Method
  18. 27:12Query Execution
  19. 27:35Indexing Best Practices
  20. 33:04Query Optimization Best Practices
  21. 36:27MySQL Index Types
  22. 37:31Advanced Indexing
  23. 38:22If indexes not enough
  24. 39:32Final Thoughts
  25. 40:27References and Credits
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.