feat(explain): save and diff query plans - #2380
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Rebuilt the feature on top of this branch ( What changed and why1. The comparison is a mode, not a modal sheet. A macOS sheet is always modal and dims its parent, and the whole point of comparing a plan is to change the query or add an index and run it again. The HIG routes exactly this away from modality ("For complex or prolonged user flows, consider alternatives to sheets"), and this repo already states the rule in Compare is now a fourth mode beside Diagram / Tree / Raw, with the baseline chooser in the pane's own bar. That is the shape of Xcode's own comparison editor: a mode, a revision picker, and the diff in place. 2. Baselines match on the statement's fingerprint, not its exact text.
3. A saved plan is not a child of a history row.
Pruning also moved out of the insert. Sharing one transaction with the history row meant a failure on the large write took the small one down with it: SQLite auto-rolls back on 4. The diff uses the standard library, and reports a verdict. The 300-line hand-rolled LCS with a bit-packed skip table is replaced by It now leads with what happened, before the metric table: "3.4x slower than the baseline", "The plan shape changed", "No measurable change". A timing difference under 15% counts as noise, so two runs of an unchanged plan no longer read as a regression. Defects fixed along the way
Collateral, outside this feature
Verification
|
Summary
EXPLAINoutput with query history and expose compatible earlier runs from the plan viewer.Matching and storage
Flow
Evidence
git diff --check: passed.Test plan