From b18ca8ad839fdab30a847214fe8281ca33694a7c Mon Sep 17 00:00:00 2001 From: Takashi Suzuki Date: Fri, 24 Aug 2012 13:10:51 +0900 Subject: [PATCH] =?utf8?q?=E8=A4=87=E6=95=B0=E3=81=AE=E7=B5=90=E5=90=88?= =?utf8?q?=E6=96=B9=E5=BC=8F=E3=81=AB=E5=90=8C=E3=81=98=E3=83=86=E3=83=BC?= =?utf8?q?=E3=83=96=E3=83=AB=E5=90=8D=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99?= =?utf8?q?=E3=82=8B=E8=A9=A6=E9=A8=93(J-3-3-*)=E3=82=92=E8=BF=BD=E5=8A=A0?= =?utf8?q?=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 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ sql/ut-J.sql | 21 +++++++++++ 2 files changed, 125 insertions(+) diff --git a/expected/ut-J.out b/expected/ut-J.out index 6284c60..252a0fd 100644 --- a/expected/ut-J.out +++ b/expected/ut-J.out @@ -4217,6 +4217,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 diff --git a/sql/ut-J.sql b/sql/ut-J.sql index 85e6ad9..bb20133 100644 --- a/sql/ut-J.sql +++ b/sql/ut-J.sql @@ -693,6 +693,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 ---- -- 2.11.0