Summary
QueryExpr currently has three separate places a filter predicate can live:
Scan.predicates: Vec<Predicate> — row-level filters pushed all the way down to a base scan
Filter.pred: Predicate — a standalone node for predicates a scan can't absorb (e.g. a post-aggregate column)
Aggregate.having: Option<Predicate> — an optional post-aggregation filter predicate
(docs/pre-asap-ir.md, Scan/Filter/Aggregate sections)
Raised in PR #180 review:
Open question
Worth discussing whether Scan.predicates and Aggregate.having should be removed in favor of a single Filter node wrapping the scan/aggregate, at least until there's a concrete need (e.g. predicate pushdown) that requires filters to live directly on those nodes.
Summary
QueryExprcurrently has three separate places a filter predicate can live:Scan.predicates: Vec<Predicate>— row-level filters pushed all the way down to a base scanFilter.pred: Predicate— a standalone node for predicates a scan can't absorb (e.g. a post-aggregate column)Aggregate.having: Option<Predicate>— an optional post-aggregation filter predicate(
docs/pre-asap-ir.md,Scan/Filter/Aggregatesections)Raised in PR #180 review:
Open question
Worth discussing whether
Scan.predicatesandAggregate.havingshould be removed in favor of a singleFilternode wrapping the scan/aggregate, at least until there's a concrete need (e.g. predicate pushdown) that requires filters to live directly on those nodes.