Expand description
The logical and physical plans.
Invariant: a physical plan is legal before it is fast. Every access path this planner produces returns exactly the rows a full scan of the same term would return, and every predicate a path consumes is either fully enforced by the path or left in the residual filter. A predicate that is neither is a wrong answer, so the two lists are built together and the compiler emits whatever is left over.
The phase-6 planner is deliberately minimal: FROM terms stay in written order, joins are nested loops, and the only paths are a full scan, a rowid lookup or range, and an index seek over an equality prefix with an optional range on the column after it. Cost is not modelled yet; a path is chosen because it is more selective by construction, not because a number said so.
Structs§
- Index
Seek Branch - One seek over an index, as a branch of an
AccessPath::IndexSeekUnion. - Levers
- Which planner optimizations are switched on.
- Physical
Plan - A physical plan for a read-only statement.
- Planned
Source - One FROM term with the path chosen for it.
- Range
Bound - One end of a scan range.
- Virtual
Choice - What a module answered when it was shown the offer.
- Virtual
Constraint - One predicate offered to a module, with what it was made of.
Enums§
- Access
Path - How one FROM term’s rows are produced.
- Aggregation
Mode - How the rows are grouped and aggregated.
- Bound
Kind - A comparison an access path can enforce.
Constants§
- ROWID_
ENTRY_ SLOT - The entry slot that stands for the row’s own key rather than a field.
Functions§
- conjunction
- Splits a predicate into the conjunction the offer is built from.
- expression_
holds_ subquery - Returns whether an expression holds a subquery, anywhere beneath it.
- is_
outer - Returns whether a join keeps rows that match nothing on the other side.
- plan_
select_ with - Plans a bound SELECT with some optimizations switched off.
- split_
conjunction - Splits
a AND b AND cinto its terms. - unanswerable_
index_ hint - Returns the name of an
INDEXED BYindex that cannot answer its term. - write_
path_ with - Returns how an UPDATE or a DELETE should find the rows it touches, with some optimizations switched off. @param table - the table being written @param source_id - the source the filter’s columns are bound to @param filter - the WHERE clause, when there is one @param levers - which optimizations are on