summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2010-05-23 16:34:38 +0000
committerTom Lane2010-05-23 16:34:38 +0000
commit7df4cf7fd3aff6a3ebc4a223bb98c768e9bbe821 (patch)
treeffc548c52ae1dba40a54bb13e68e31b72482167b /src/test
parentc8518845de62e64eec3d863d4e149da72cacdd9f (diff)
Fix oversight in join removal patch: we have to delete the removed relation
from SpecialJoinInfo relid sets as well. Per example from Vaclav Novotny.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/join.out14
-rw-r--r--src/test/regress/sql/join.sql6
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index 5fd7d79b45d..6dfc710be01 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -2525,6 +2525,20 @@ explain (costs off)
Seq Scan on a
(1 row)
+-- check optimization of outer join within another special join
+explain (costs off)
+select id from a where id in (
+ select b.id from b left join c on b.id = c.id
+);
+ QUERY PLAN
+----------------------------
+ Hash Semi Join
+ Hash Cond: (a.id = b.id)
+ -> Seq Scan on a
+ -> Hash
+ -> Seq Scan on b
+(5 rows)
+
rollback;
create temp table parent (k int primary key, pd int);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "parent_pkey" for table "parent"
diff --git a/src/test/regress/sql/join.sql b/src/test/regress/sql/join.sql
index d627973a091..8657636757a 100644
--- a/src/test/regress/sql/join.sql
+++ b/src/test/regress/sql/join.sql
@@ -588,6 +588,12 @@ explain (costs off)
SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
ON (a.b_id = b.id);
+-- check optimization of outer join within another special join
+explain (costs off)
+select id from a where id in (
+ select b.id from b left join c on b.id = c.id
+);
+
rollback;
create temp table parent (k int primary key, pd int);