summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/join.out
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-02-07 11:56:43 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-02-07 11:56:43 -0500
commit2cbbffff05b853733ae19ca7047cfeb9a346a497 (patch)
tree45cab0c8d474b288b4d6c6d91cb100f52752726d /src/test/regress/expected/join.out
parentaa6954104644334c53838f181053b9f7aa13f58c (diff)
downloadpostgresql-2cbbffff05b853733ae19ca7047cfeb9a346a497.tar.gz
Remove leftover code in deconstruct_distribute_oj_quals().
The initial "put back OJ relids" adjustment of ojscope was incorrect and unnecessary; it seems to be a leftover from when I (tgl) was trying to get this function to work at all. Richard Guo Discussion: https://postgr.es/m/CAMbWs4-L2C47ZGZPabBAi5oDZsKmsbvhYcGCy5o=gCjsaG_ZQA@mail.gmail.com
Diffstat (limited to 'src/test/regress/expected/join.out')
-rw-r--r--src/test/regress/expected/join.out26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index 07f5aad5ea..eea8978fad 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -4982,6 +4982,32 @@ select id from a where id in (
-> Seq Scan on b
(5 rows)
+-- check optimization with oddly-nested outer joins
+explain (costs off)
+select a1.id from
+ (a a1 left join a a2 on true)
+ left join
+ (a a3 left join a a4 on a3.id = a4.id)
+ on a2.id = a3.id;
+ QUERY PLAN
+------------------------------
+ Nested Loop Left Join
+ -> Seq Scan on a a1
+ -> Materialize
+ -> Seq Scan on a a2
+(4 rows)
+
+explain (costs off)
+select a1.id from
+ (a a1 left join a a2 on a1.id = a2.id)
+ left join
+ (a a3 left join a a4 on a3.id = a4.id)
+ on a2.id = a3.id;
+ QUERY PLAN
+------------------
+ Seq Scan on a a1
+(1 row)
+
-- check that join removal works for a left join when joining a subquery
-- that is guaranteed to be unique by its GROUP BY clause
explain (costs off)