docs: refresh stale EXPLAIN samples and fix invalid examples in the optimization and index pages - #38603
Draft
ggevay wants to merge 1 commit into
Draft
docs: refresh stale EXPLAIN samples and fix invalid examples in the optimization and index pages#38603ggevay wants to merge 1 commit into
ggevay wants to merge 1 commit into
Conversation
…ptimization and index pages The optimization page's plan samples predate the change that made `EXPLAIN` default to the physical plan, and two `CREATE INDEX` examples do not run at all. Regenerated every sample against v26.39.0 and corrected the examples, the index usage type list, and several retired links. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
EXPLAINhas defaulted to the physical plan since #33448 (2025-06), but the optimization page still shows a bareEXPLAINproducing "Optimized Plan" MIR output. Separately, twoCREATE INDEXexamples fail if you run them, and the shared index-limitations note contradicts the same page. Everything below was checked against a v26.39.0 emulator or the code.Description
transform-data/optimization.md— three plan samples regenerated verbatim from v26.39.0:The point-lookup sample showed MIR (
ReadIndex on=… foo_x_y_idx=[lookup value=(42, 50)]). A bareEXPLAINprints the fast-path arrow form, so the sample is now the real output (→Index Lookup on … / Lookup values: (42, 50)), and the surrounding prose no longer tells readers to look forlookup_value.The two delta-join samples are reachable only via
EXPLAIN OPTIMIZED PLAN FOR, so the commands say that. The regenerated output adds what a release build actually prints: humanized column names (#0{id}),// { arity: N }annotations, and theTarget cluster:footer. The<---------- Delta jointeaching callout is kept.(Using
OPTIMIZED PLANrather than switching the samples to the physical plan is deliberate: a bareEXPLAINover aSELECTrendersOne-Shot Delta Join, a one-shot form that the index or materialized view the section is about would not use.)Index usage types — the list omitted three variants that
IndexUsageTyperenders (src/repr/src/explain.rs):plan root (no new arrangement),sink export,index export. Added, and the lead-in now says "most common" rather than "all possible".headless/index-ordering.md(rendered on this page and onconcepts/indexes) said indexes provide no optimization forLIMIT, contradicting thefast path limitusage type documented a few lines above it. Now carves out that exception.sql/create-index.md:data/examples/create_index.yml.active_customersexample usednow(), which cannot be materialized (cannot materialize call to current_timestamp, with a hint pointing atmz_now()); rewritten as the temporal filtermz_now() < last_active_on + INTERVAL '30' DAYS.GROUP BY geo_idwith two ungrouped columns, which fails to plan; the clause is dropped (the example only needs the columns).sql/create-materialized-view.md— a duplicateinclude-from-yamlused the wrong parameter (file=instead ofdata=) and a name that does not exist, so it silently rendered nothing; the correct include is already a few lines above. Removed.Retired links —
../../ops/optimization/,/overview/arrangements(×3), and the old Top K path now point at their current locations.Verification
Prose and samples only.
hugobuilds cleanly. All three plan samples were captured from a v26.39.0 emulator using this page's own schema, and both failingCREATE INDEXexamples were confirmed to error before the fix.