~/talk

MySQL Indexes and Histograms to Speed Up Your Queries

Talkat Data Con LA 2021 · 2021-09-17..09-19· [databases]
slides:none on file

Shows how to use MySQL indexes, clustered primary keys, and histograms to give the optimizer real numbers instead of bad guesses — e.g., adding a multi-column index drops the explain cost from 1.5 to 0.7 (≈46% faster) and to 0.66 with a covering index, explain analyze (added in 8.0.18) returns actual row counts and timings, histograms (up to 1024 buckets) are created with ANALYZE TABLE ... UPDATE HISTOGRAM and fix skewed cardinality, and invisible indexes let DBAs safely test removing rarely used indexes.

AI-written summary · about

  1. 0:00Introduction and agenda
  2. 1:47Why query speed matters
  3. 3:55Data design and normalization
  4. 6:21Understanding the optimizer
  5. 10:16What are indexes
  6. 13:45Multi-column and functional indexes
  7. 16:32Primary keys and invisible indexes
  8. 19:18Covering indexes in action
  9. 21:42Unused indexes and removal
  10. 23:49Histograms explained
  11. 28:05Creating and updating histograms
  12. 30:55Other performance tweaks
  13. 32:20Resources and next steps
~/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.