From fc141c77f9884190d257732df2c87ef3e5803d99 Mon Sep 17 00:00:00 2001 From: Mitsuru Hasegawa Date: Thu, 23 Aug 2012 10:30:36 +0900 Subject: [PATCH] =?utf8?q?J-3-1-1=E3=81=AE=E8=A9=A6=E9=A8=93=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- expected/ut-J.out | 33 +++++++++++++++++++++++++++++++++ sql/ut-J.sql | 13 +++++++++++++ 2 files changed, 46 insertions(+) diff --git a/expected/ut-J.out b/expected/ut-J.out index e4308a8..cc15d86 100644 --- a/expected/ut-J.out +++ b/expected/ut-J.out @@ -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) + diff --git a/sql/ut-J.sql b/sql/ut-J.sql index ed39302..0366689 100644 --- a/sql/ut-J.sql +++ b/sql/ut-J.sql @@ -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; + -- 2.11.0