• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

firtst release


Commit MetaInfo

修订版f8b0032df46fe4a4940c611d0c6567cbe7685fcc (tree)
时间2013-06-21 13:21:59
作者Takashi Suzuki <suzuki.takashi@metr...>
CommiterTakashi Suzuki

Log Message

既存機能の向上や新規機能の追加を考慮してリグレッションテストを更新した。

追加で以下の機能を試験するようにした。
・記述位置の自由度が向上したクエリコメント方式によるヒント取得機能
・ヒント用テーブル方式によるヒント取得機能
・ヒント用テーブル検索の制御機能
・plpgsqlで記述したクエリから、クエリコメント方式でヒントを取得する

機能

更改概述

差异

--- a/expected/pg_hint_plan-9.1.out
+++ b/expected/pg_hint_plan-9.1.out
@@ -115,6 +115,24 @@ error hint:
115115 -> Seq Scan on t2
116116 (5 rows)
117117
118+EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/
119+ SELECT * FROM t1, t2 WHERE t1.id = t2.id;
120+LOG: pg_hint_plan:
121+used hint:
122+Set(enable_indexscan off)
123+not used hint:
124+duplication hint:
125+error hint:
126+
127+ QUERY PLAN
128+------------------------------
129+ Hash Join
130+ Hash Cond: (t1.id = t2.id)
131+ -> Seq Scan on t1
132+ -> Hash
133+ -> Seq Scan on t2
134+(5 rows)
135+
118136 /*+ Set(enable_indexscan off) Set(enable_hashjoin off) */
119137 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
120138 LOG: pg_hint_plan:
@@ -7859,3 +7877,58 @@ error hint:
78597877 Filter: (val = 1)
78607878 (20 rows)
78617879
7880+-- search from hint table
7881+INSERT INTO hint_plan.hints VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7882+SET pg_hint_plan.lookup_hint_in_table = on;
7883+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7884+LOG: pg_hint_plan:
7885+used hint:
7886+SeqScan(t1)
7887+not used hint:
7888+duplication hint:
7889+error hint:
7890+
7891+ QUERY PLAN
7892+--------------------
7893+ Seq Scan on t1
7894+ Filter: (id = 1)
7895+(2 rows)
7896+
7897+SET pg_hint_plan.lookup_hint_in_table = off;
7898+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7899+
7900+ QUERY PLAN
7901+--------------------------------
7902+ Index Scan using t1_pkey on t1
7903+ Index Cond: (id = 1)
7904+(2 rows)
7905+
7906+TRUNCATE hint_plan.hints;
7907+VACUUM ANALYZE;
7908+-- plpgsql test
7909+EXPLAIN SELECT id FROM t1 WHERE t1.id = 1;
7910+ QUERY PLAN
7911+------------------------------------------------------------------
7912+ Index Scan using t1_pkey on t1 (cost=0.00..8.27 rows=1 width=4)
7913+ Index Cond: (id = 1)
7914+(2 rows)
7915+
7916+SET client_min_messages = LOG;
7917+DO LANGUAGE plpgsql $$
7918+DECLARE
7919+ id integer;
7920+BEGIN
7921+ SELECT /*+SeqScan(t1)*/ t1.id INTO id FROM t1 WHERE t1.id = 1;
7922+ RETURN;
7923+END;
7924+$$;
7925+LOG: pg_hint_plan:
7926+used hint:
7927+SeqScan(t1)
7928+not used hint:
7929+duplication hint:
7930+error hint:
7931+
7932+CONTEXT: SQL statement "SELECT /*+SeqScan(t1)*/ t1.id FROM t1 WHERE t1.id = 1"
7933+PL/pgSQL function "inline_code_block" line 5 at SQL statement
7934+RESET client_min_messages;
--- a/expected/pg_hint_plan-9.2.out
+++ b/expected/pg_hint_plan-9.2.out
@@ -115,6 +115,24 @@ error hint:
115115 -> Seq Scan on t2
116116 (5 rows)
117117
118+EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/
119+ SELECT * FROM t1, t2 WHERE t1.id = t2.id;
120+LOG: pg_hint_plan:
121+used hint:
122+Set(enable_indexscan off)
123+not used hint:
124+duplication hint:
125+error hint:
126+
127+ QUERY PLAN
128+------------------------------
129+ Hash Join
130+ Hash Cond: (t1.id = t2.id)
131+ -> Seq Scan on t1
132+ -> Hash
133+ -> Seq Scan on t2
134+(5 rows)
135+
118136 /*+ Set(enable_indexscan off) Set(enable_hashjoin off) */
119137 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
120138 LOG: pg_hint_plan:
@@ -7947,3 +7965,57 @@ error hint:
79477965 Filter: (val = 1)
79487966 (20 rows)
79497967
7968+-- search from hint table
7969+INSERT INTO hint_plan.hints VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7970+SET pg_hint_plan.lookup_hint_in_table = on;
7971+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7972+LOG: pg_hint_plan:
7973+used hint:
7974+SeqScan(t1)
7975+not used hint:
7976+duplication hint:
7977+error hint:
7978+
7979+ QUERY PLAN
7980+--------------------
7981+ Seq Scan on t1
7982+ Filter: (id = 1)
7983+(2 rows)
7984+
7985+SET pg_hint_plan.lookup_hint_in_table = off;
7986+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7987+ QUERY PLAN
7988+--------------------------------
7989+ Index Scan using t1_pkey on t1
7990+ Index Cond: (id = 1)
7991+(2 rows)
7992+
7993+TRUNCATE hint_plan.hints;
7994+VACUUM ANALYZE;
7995+-- plpgsql test
7996+EXPLAIN SELECT id FROM t1 WHERE t1.id = 1;
7997+ QUERY PLAN
7998+-----------------------------------------------------------------------
7999+ Index Only Scan using t1_pkey on t1 (cost=0.00..4.28 rows=1 width=4)
8000+ Index Cond: (id = 1)
8001+(2 rows)
8002+
8003+SET client_min_messages = LOG;
8004+DO LANGUAGE plpgsql $$
8005+DECLARE
8006+ id integer;
8007+BEGIN
8008+ SELECT /*+SeqScan(t1)*/ t1.id INTO id FROM t1 WHERE t1.id = 1;
8009+ RETURN;
8010+END;
8011+$$;
8012+LOG: pg_hint_plan:
8013+used hint:
8014+SeqScan(t1)
8015+not used hint:
8016+duplication hint:
8017+error hint:
8018+
8019+CONTEXT: SQL statement "SELECT /*+SeqScan(t1)*/ t1.id FROM t1 WHERE t1.id = 1"
8020+PL/pgSQL function inline_code_block line 5 at SQL statement
8021+RESET client_min_messages;
--- a/sql/pg_hint_plan.sql
+++ b/sql/pg_hint_plan.sql
@@ -25,6 +25,8 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
2525 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
2626 /*+Set(enable_indexscan off)*/
2727 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
28+EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/
29+ SELECT * FROM t1, t2 WHERE t1.id = t2.id;
2830 /*+ Set(enable_indexscan off) Set(enable_hashjoin off) */
2931 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
3032
@@ -819,3 +821,25 @@ EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
819821 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
820822 /*+ BitmapScan(p1 p1_.*val2.*)*/
821823 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
824+
825+-- search from hint table
826+INSERT INTO hint_plan.hints VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
827+SET pg_hint_plan.lookup_hint_in_table = on;
828+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
829+SET pg_hint_plan.lookup_hint_in_table = off;
830+EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
831+TRUNCATE hint_plan.hints;
832+VACUUM ANALYZE;
833+
834+-- plpgsql test
835+EXPLAIN SELECT id FROM t1 WHERE t1.id = 1;
836+SET client_min_messages = LOG;
837+DO LANGUAGE plpgsql $$
838+DECLARE
839+ id integer;
840+BEGIN
841+ SELECT /*+SeqScan(t1)*/ t1.id INTO id FROM t1 WHERE t1.id = 1;
842+ RETURN;
843+END;
844+$$;
845+RESET client_min_messages;