Optimizer Trace walkthrough
summary
Introduces how to enable and read the optimizer trace (set optimizer_trace=1 then SELECT from information_schema.optimizer_trace), explains trace is a single-session JSON blob saved in memory, and shows how to use JSON_EXTRACT/JSON_DETAILED or GREP to inspect elements like ref_optimizer_key_uses and considered_execution_paths to see why an index or join order is chosen or pruned; covers range optimizer, loose index scan decisions, join cost estimates, differences vs MySQL (nested traces and flags), and recent MariaDB fixes to printed conditions.
AI-written summary · about
chapters (11)
- 0:00Introduction to Optimizer Trace
- 0:52Goals of Optimizer Trace
- 4:52How to use Optimizer Trace
- 8:00Trace contents and JSON basics
- 12:25Ref optimizer key uses
- 15:09Range optimizer details
- 18:00Loose index scan optimization
- 19:32Join optimizer explained
- 26:58Other trace elements overview
- 28:06MySQL Optimizer Trace comparison
- 36:09Future plans and conclusion
