OSDN Git Service

J-3-1-1の試験を追加した。
authorMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Thu, 23 Aug 2012 01:30:36 +0000 (10:30 +0900)
committerMitsuru Hasegawa <hasegawa@metrosystems.co.jp>
Thu, 23 Aug 2012 01:30:36 +0000 (10:30 +0900)
expected/ut-J.out
sql/ut-J.sql

index e4308a8..cc15d86 100644 (file)
@@ -3734,3 +3734,36 @@ MergeJoin(*VALUES* t1 t2 t3)
    ->  Values Scan on "*VALUES*"
 (13 rows)
 
+----
+---- No. J-3-1 join method hint
+----
+-- No. J-3-1-1
+SET enable_nestloop TO on;
+SET enable_mergejoin TO off;
+SET enable_hashjoin TO off;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+LOG:  pg_hint_plan:
+used hint:
+NestLoop(t1 t2)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Nested Loop
+   ->  Seq Scan on t2
+   ->  Index Scan using t1_i1 on t1
+         Index Cond: (c1 = t2.c1)
+(4 rows)
+
index ed39302..0366689 100644 (file)
@@ -613,3 +613,16 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1,
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
 /*+ Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+
+----
+---- No. J-3-1 join method hint
+----
+
+-- No. J-3-1-1
+SET enable_nestloop TO on;
+SET enable_mergejoin TO off;
+SET enable_hashjoin TO off;
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+/*+NestLoop(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+