diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/join.out | 28 | ||||
| -rw-r--r-- | src/test/regress/sql/join.sql | 13 | 
2 files changed, 41 insertions, 0 deletions
| diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out index b901d7299fa..93583710725 100644 --- a/src/test/regress/expected/join.out +++ b/src/test/regress/expected/join.out @@ -4651,6 +4651,34 @@ select a.q2, b.q1  reset enable_hashjoin;  reset enable_nestloop;  -- +-- test join strength reduction with a SubPlan providing the proof +-- +explain (costs off) +select a.unique1, b.unique2 +  from onek a left join onek b on a.unique1 = b.unique2 +  where b.unique2 = any (select q1 from int8_tbl c where c.q1 < b.unique1); +                        QUERY PLAN                         +---------------------------------------------------------- + Hash Join +   Hash Cond: (b.unique2 = a.unique1) +   ->  Seq Scan on onek b +         Filter: (SubPlan 1) +         SubPlan 1 +           ->  Seq Scan on int8_tbl c +                 Filter: (q1 < b.unique1) +   ->  Hash +         ->  Index Only Scan using onek_unique1 on onek a +(9 rows) + +select a.unique1, b.unique2 +  from onek a left join onek b on a.unique1 = b.unique2 +  where b.unique2 = any (select q1 from int8_tbl c where c.q1 < b.unique1); + unique1 | unique2  +---------+--------- +     123 |     123 +(1 row) + +--  -- test join removal  --  begin; diff --git a/src/test/regress/sql/join.sql b/src/test/regress/sql/join.sql index ccbbe5454c5..a81c7dce7d5 100644 --- a/src/test/regress/sql/join.sql +++ b/src/test/regress/sql/join.sql @@ -1604,6 +1604,19 @@ reset enable_hashjoin;  reset enable_nestloop;  -- +-- test join strength reduction with a SubPlan providing the proof +-- + +explain (costs off) +select a.unique1, b.unique2 +  from onek a left join onek b on a.unique1 = b.unique2 +  where b.unique2 = any (select q1 from int8_tbl c where c.q1 < b.unique1); + +select a.unique1, b.unique2 +  from onek a left join onek b on a.unique1 = b.unique2 +  where b.unique2 = any (select q1 from int8_tbl c where c.q1 < b.unique1); + +--  -- test join removal  -- | 
