Skip to main content

Crate rudb_opt

Crate rudb_opt 

Source
Expand description

The rewrite passes, cardinality estimation, join ordering, predicate transfer and layout adaptation.

Rank 11 in the layer rule. See xtask/layers.toml and spec/18-package-layout.md.

Six passes so far. spec/09-optimizer.md section 9.1 describes a sequence and PASSES is the start of it. Column pruning came first, because it is the pass whose absence is measured in gigabytes: a scan that reads 105 columns to answer a question about three is the whole of the difference on ClickBench, and the Parquet reader has been able to read a subset since M1 with nothing able to tell it which subset.

Modules§

columns
Column pruning, which is the scan half of projection pushdown.
distinct
Turning COUNT(DISTINCT x) into a grouping, so that it runs on the machinery grouping already has.
empty
Replacing a subtree that cannot produce a row with a relation that produces none.
estimate
How many rows a node produces, guessed.
explain
What EXPLAIN prints.
filter
Filter pushdown.
fold
Constant folding and the simplifications that fall out of it.
late
Late materialisation: reading the wide columns after the limit rather than before it.
limit
Moving a limit below the projection above it.
nulls
What a predicate says about a row that a join padded with nulls.
pass
What a rewrite is, and what it is given besides the plan.
tables
Which tables an expression reads, and which ones an operator produces.
topn
Turning a limit over a sort into a top N.

Constants§

RANK
The crate this rank belongs to, so that the layer check has something to read.

Statics§

PASSES
The passes, in the order they run.
UPSTREAM
Every name SET disabled_optimizers accepts, which is every name DuckDB accepts.

Functions§

optimize
Rewrites a bound plan into the plan that runs, with every pass on.
optimize_with
Rewrites a bound plan into the plan that runs, skipping the passes the context turned off.