docs: add ADR-0028 — query plans (EXPLAIN QUERY PLAN)

The QA1/QA2 design: an `explain` prefix command over
`show data` / `update` / `delete` that runs
EXPLAIN QUERY PLAN (without executing the statement) and
renders the result as an annotated tree. Plan steps keep
the engine's own wording; an annotation taxonomy marks
full scans, index use, and the automatic-index "you
should add an index here" case. Introduces a general
styled-output-line mechanism — an OutputLine may carry
per-span styling — realising the per-span theming
ADR-0016 deferred; the plan renderer is its first
consumer. The explained SQL is shown above the tree as
standard, copy-pasteable SQL.

- docs/adr/0028-query-plans.md — the ADR.
- docs/adr/README.md — index entry.
- docs/requirements.md — QA2 [~] -> [ ]; QA1 note
  reconciled (designed in ADR-0028).
This commit is contained in:
claude@clouddev1
2026-05-18 21:27:52 +00:00
parent 032a050f7b
commit 9aa7e2ede0
3 changed files with 315 additions and 5 deletions
+9 -5
View File
@@ -350,11 +350,15 @@ group enabled. (Earlier reference points: 1006 after ADR-0024
- [ ] **QA1** `EXPLAIN QUERY PLAN` is run on demand for queries;
output is rendered as an annotated tree highlighting full
scans, index use, and join order.
*(Unblocked by ADR-0025: indexes now exist, so a plan for
`show data <T> where <col>=<val>` visibly changes with an
index. Still needs the QA2 rendering ADR.)*
- [~] **QA2** Plan rendering specifics (tree layout, annotation
taxonomy, colour scheme) — design and ADR pending.
*(Designed in ADR-0028: the `explain` prefix over
`show data` / `update` / `delete`, with a span-styled plan
tree. The pedagogical payoff — a plan that flips between a
full scan and an index search — needs a filtered query
(`show data … where`, designed in ADR-0026) plus indexes
(ADR-0025, done). Implementation pending.)*
- [ ] **QA2** Plan rendering specifics — tree layout, annotation
taxonomy, colour scheme. Designed in ADR-0028 (§3–§6);
implementation pending.
## Hints, help, errors