~/talk

Writing High Performance SQL Statements

name:Tim Sharp
links:none on file
slides:none on file

Walkthrough of practical steps for faster MySQL queries: use EXPLAIN type/possible_keys/key/rows to see that adding an index turns a table scan of ~200 rows into a range scan (~313 rows) or a constant lookup (1 row), prefer compact types and NOT NULL, favor a covered index (all needed columns) and correct leftmost ordering for multicolumn keys, avoid wrapping indexed columns in functions because functions disable indices, know query cache limits and use Percona tools (pt-query-digest, pt-index, pt-visual-explain) to find hot queries and unused indexes.

AI-written summary · about

  1. 0:00High-performance SQL intro
  2. 1:06EXPLAIN tool for queries
  3. 3:16EXPLAIN indexed vs non-indexed
  4. 5:44Schema optimization mistakes
  5. 7:56Normalized vs denormalized trade-offs
  6. 9:02Optimal database indices
  7. 11:57Multi-column index ordering
  8. 13:44Hash indices limitations
  9. 14:28Reduce data retrieval
  10. 15:35LEFT JOIN and WHERE pitfalls
  11. 16:20Functions disable index usage
  12. 17:30Aggregate functions impact
  13. 17:55Query cache alternatives
  14. 18:37Right database engine
  15. 19:20Performance tips
  16. 19:42Query analysis tools
  17. 20:28Q&A
~/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.