aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/subselect.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/subselect.sql')
-rw-r--r--src/test/regress/sql/subselect.sql13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test/regress/sql/subselect.sql b/src/test/regress/sql/subselect.sql
index 7c42ebc36fc..75a9b718b2f 100644
--- a/src/test/regress/sql/subselect.sql
+++ b/src/test/regress/sql/subselect.sql
@@ -983,7 +983,7 @@ explain (verbose, costs off)
with x as (select * from subselect_tbl)
select * from x for update;
--- Pull-up the direct-correlated ANY_SUBLINK
+-- Pull up direct-correlated ANY_SUBLINKs
explain (costs off)
select * from tenk1 A where hundred in (select hundred from tenk2 B where B.odd = A.odd);
@@ -994,18 +994,18 @@ where A.hundred in (select C.hundred FROM tenk2 C
WHERE c.odd = b.odd));
-- we should only try to pull up the sublink into RHS of a left join
--- but a.hundred is not avaiable.
+-- but a.hundred is not available.
explain (costs off)
SELECT * FROM tenk1 A LEFT JOIN tenk2 B
ON A.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd);
-- we should only try to pull up the sublink into RHS of a left join
--- but a.odd is not avaiable for this.
+-- but a.odd is not available for this.
explain (costs off)
SELECT * FROM tenk1 A LEFT JOIN tenk2 B
ON B.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = a.odd);
--- should be able to pull up since all the references is available
+-- should be able to pull up since all the references are available.
explain (costs off)
SELECT * FROM tenk1 A LEFT JOIN tenk2 B
ON B.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd);
@@ -1013,9 +1013,10 @@ ON B.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd);
-- we can pull up the sublink into the inner JoinExpr.
explain (costs off)
SELECT * FROM tenk1 A INNER JOIN tenk2 B
-ON A.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd);
+ON A.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd)
+WHERE a.thousand < 750;
-- we can pull up the aggregate sublink into RHS of a left join.
explain (costs off)
SELECT * FROM tenk1 A LEFT JOIN tenk2 B
-ON B.hundred in (SELECT min(c.hundred) FROM tenk2 C WHERE c.odd = b.odd); \ No newline at end of file
+ON B.hundred in (SELECT min(c.hundred) FROM tenk2 C WHERE c.odd = b.odd);