Appearance
enable_implied_pushdown (boolean)
- Default value (as of this release):
off
This configuration parameter enables transitive pushdown of qualifiers. When the planner can determine that two columns must be the same value, it will attempt to apply any qualifiers specified for one column to the other column. It then pushes any new qualifiers as far down in the query plan as possible.
In the example below, we can see that A.x
and B.y
must have the same value. This allows the qualifier y > 3
to be applied to the output of the join. Furthermore, because this is an INNER JOIN
, the qualifier can be pushed down to the scan, resulting in even better performance. This effectively adds the clause B.y > 3
to the query during execution.
sql
CREATE TABLE A (x int);
CREATE TABLE B (y int);
SET enable_implied_pushdown TO true;
EXPLAIN SELECT * FROM A INNER JOIN B ON A.x = B.y WHERE A.x > 3;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
id rows_planned workers node
13 1 all SELECT
1 1 all INNER HASH JOIN ON (b.y = a.x)
4 1 all |-SCAN a
| (a.x > $0) AND a.x = bloom(7) AND scan_constraints: min_max(a.x) AND (a.x > $0)
7 1 all |-BUILD
10 1 all SCAN b
(b.y > $2) AND scan_constraints: (b.y > $2) <-- filter applied to A.x is pushed down to B.y as well