From: Takashi Suzuki Date: Fri, 24 Aug 2012 04:10:51 +0000 (+0900) Subject: 複数の結合方式に同じテーブル名を指定する試験(J-3-3-*)を追加した。 X-Git-Tag: REL91_1_1_1~250^2~7^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=74f9cd0a73c51accea3ae071c3a962c7efb40476;p=pghintplan%2Fpg_hint_plan.git 複数の結合方式に同じテーブル名を指定する試験(J-3-3-*)を追加した。 --- diff --git a/expected/ut-J.out b/expected/ut-J.out index 2affd3b..97116f8 100644 --- a/expected/ut-J.out +++ b/expected/ut-J.out @@ -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 diff --git a/sql/ut-J.sql b/sql/ut-J.sql index 73eca8a..c560db2 100644 --- a/sql/ut-J.sql +++ b/sql/ut-J.sql @@ -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 ----