~/talk

Improving MariaDB’s optimizer with better selectivity estimates

Talkat MariaDB Server Fest 2021 · 2021-10-05..10-06· [databases]
links:none on file
slides:none on file

MariaDB 10.7 adds JSON_HB histograms that store actual values (not just fractions), use most-common-value buckets and default to histogram_size=254, reducing wild misestimates on skewed varchar data (examples shrink errors from orders of magnitude to near-reality for China/Chile). The optimizer also supports records_in_range (index-based multicolumn estimates) and Bernoulli sampling via analyze_sample_percentage. Collection remains costly and automatic re-collection and genuine lightweight sampling are still missing.

AI-written summary · about

  1. 0:00Start
  2. 0:23Optimizer uses data statistics
  3. 0:39Cardinalities and selectivities
  4. 2:42Selectivity is important
  5. 5:42Computing selectivity
  6. 6:15Local condition selectivity
  7. 8:03Basic Histogram
  8. 8:40Equi-width histogram
  9. 11:07Histogram usage
  10. 13:29Histograms in MariaDB 10.4: internals
  11. 15:34Precision issue (MDEV-26125)
  12. 17:29Histograms in MariaDB 10.7
  13. 18:09JSON HB fixes MDEV-26125
  14. 19:45MySQL's equi-height histogram
  15. 21:25CockroachDB's equi-height histogram
  16. 23:37PostgreSQL's equi-height histogram
  17. 24:13On the number of buckets
  18. 25:27Histogram benchmark?
  19. 26:28Histograms take-aways
  20. 27:37Combining multiple conditions
  21. 28:35Solution #1: use a certain assumption
  22. 30:15Multi-column stats
  23. 30:58MariaDB, MySQL: records-in-range
  24. 31:41records in range in action
  25. 32:21PostgreSQL, for comparison
  26. 33:04Multivariate stats
  27. 33:43Multiple conditions selectivity takeaways
  28. 34:25Combining multi-column statistics
  29. 35:27The right way-research papers
  30. 36:31What is used in production?
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.