Expand description
Rule-based and cost-aware operator-tree optimizer.
Walks an OperatorTree and applies algebraic, graph, and physical rewrites:
simplify_algebra– address-independent idempotence / absorption / empty elimination on membership-only Intersect / Union operands. Score-bearing operands remain distinct because posting-list merges add their scores.push_filters_down– sink Filter into Intersect children when the field applies.push_graph_pattern_filters– fold vertex / edge property filters into PatternMatch constraints.push_filter_into_traverse– absorb vertex predicates into Traverse so BFS prunes during expansion.push_filter_below_graph_join– move filters past graph joins when the field belongs to the left side.fuse_join_pattern– merge intersected PatternMatch operators that share a vertex variable.reorder_intersect– sort Intersect children by estimated operator cost (cheapest first).reorder_fusion_signals– sort fusion signals by cost; graph operators receive a 0.5x discount when graph stats are available.apply_index_scan– substitute leaf Filter with IndexScan when a covering index is registered and cheaper.
Vector-threshold operands remain distinct: intersection adds each raw cosine score, and approximate query-vector equality cannot preserve threshold support. Rewrites must also retain invalid-threshold errors.
Structs§
- Index
Scan Candidate - Query-local physical index candidate supplied by an engine catalog.
- Optimizer
Config - Fluent configuration for the optimizer pipeline. Lets callers disable individual stages for testing without poking at private fields.
- Query
Optimizer - Operator-tree query optimizer.