OSDN Git Service

複数の結合方式に同じテーブル名を指定する試験(J-3-3-*)を追加した。
authorTakashi Suzuki <suzuki.takashi@metrosystems.co.jp>
Fri, 24 Aug 2012 04:10:51 +0000 (13:10 +0900)
committerTakashi Suzuki <suzuki.takashi@metrosystems.co.jp>
Fri, 24 Aug 2012 04:10:51 +0000 (13:10 +0900)
expected/ut-J.out
sql/ut-J.sql

index 2affd3b..97116f8 100644 (file)
@@ -4209,6 +4209,110 @@ error hint:
 (19 rows)
 
 ----
+---- No. J-3-3 conflict join method hint
+----
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+             QUERY PLAN             
+------------------------------------
+ Merge Join
+   Merge Cond: (t1.c1 = t2.c1)
+   ->  Index Scan using t1_i1 on t1
+   ->  Sort
+         Sort Key: t2.c1
+         ->  Seq Scan on t2
+(6 rows)
+
+-- No. J-3-3-1
+/*+HashJoin(t1 t2)NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
+DETAIL:  Conflict join method hint.
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+HashJoin(t1 t2)
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
+-- No. J-3-3-2
+/*+MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+INFO:  hint syntax error at or near "MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)"
+DETAIL:  Conflict join method hint.
+INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
+DETAIL:  Conflict join method hint.
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+MergeJoin(t1 t2)
+HashJoin(t1 t2)
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
+-- No. J-3-3-3
+/*+HashJoin(t1 t2)NestLoop(t2 t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
+DETAIL:  Conflict join method hint.
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+HashJoin(t1 t2)
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
+-- No. J-3-3-4
+/*+MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+INFO:  hint syntax error at or near "MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)"
+DETAIL:  Conflict join method hint.
+INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
+DETAIL:  Conflict join method hint.
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+MergeJoin(t1 t2)
+HashJoin(t1 t2)
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
+----
 ---- No. J-3-4 hint state output
 ----
 -- No. J-3-4-1
index 73eca8a..c560db2 100644 (file)
@@ -690,6 +690,27 @@ EXPLAIN (COSTS false) SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
 EXPLAIN (COSTS false) SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
 
 ----
+---- No. J-3-3 conflict join method hint
+----
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-3-3-1
+/*+HashJoin(t1 t2)NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-3-3-2
+/*+MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-3-3-3
+/*+HashJoin(t1 t2)NestLoop(t2 t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+-- No. J-3-3-4
+/*+MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+
+----
 ---- No. J-3-4 hint state output
 ----