Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/25201
Change subject: PROTOTYPE: Apply join filter selectivity to join cardinality ...................................................................... PROTOTYPE: Apply join filter selectivity to join cardinality The join cardinality estimate ignores the comparisons that filter the join output: the other predicates of a join and the non-equi join conjuncts of inner and cross joins (IMPALA-8262). In TPC-DS SF100 q72 the join with 'inv_quantity_on_hand < cs_quantity' is estimated at 9.69B rows, actual 682.80K. Today this mostly inflates memory estimates, but the NDV-cap prototype for IMPALA-15520 relies on this change: without it q72's memory estimate is 197 GB/host. JoinNode.computeStats() now multiplies the join estimate by the combined selectivity of these binary comparisons, computed as for scan conjuncts. It skips comparisons on tuples that are nullable at the join, equalities between the join inputs, and non-binary predicates such as disjunctions, whose single-table parts are already pushed down to the scans. A two-sided '<>' gets 1 - 1/max(NDV). An inner join without equi-join conjuncts is reduced at most to the cross product times the selectivity. Runtime filter selectivity keeps using the estimate without these comparisons, since a filter only applies the equi-join keys. No flag is added; the behaviour is always on. Testing: - TPC-DS SF100, 5 executors, MT_DOP=0, with the NDV-cap prototype: total -23.6%, q72 memory estimate 197 -> 11.6 GB/host. Compared with the NDV cap alone, run times change little. - PlannerTest expectations are not updated. No new tests. Change-Id: I55491ebcc67b66baf00b0d1a67220c301632e888 Assisted-by: Claude Opus 5.5 (Claude Code) --- M fe/src/main/java/org/apache/impala/planner/JoinNode.java M fe/src/main/java/org/apache/impala/planner/RuntimeFilterGenerator.java 2 files changed, 125 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/01/25201/1 -- To view, visit http://gerrit.cloudera.org:8080/25201 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I55491ebcc67b66baf00b0d1a67220c301632e888 Gerrit-Change-Number: 25201 Gerrit-PatchSet: 1 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
