• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revisionb4dff0d5308c0e022554ef5768eb19e16464328a (tree)
Time2013-08-08 09:54:41
AuthorTakashi Suzuki <suzuki.takashi@metr...>
CommiterTakashi Suzuki

Log Message

ヒント用テーブルのid列に連番が付与されることを確認するテストを追加した。

Change Summary

Incremental Difference

--- a/expected/pg_hint_plan-9.1.out
+++ b/expected/pg_hint_plan-9.1.out
@@ -7879,6 +7879,16 @@ error hint:
78797879
78807880 -- search from hint table
78817881 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7882+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
7883+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
7884+SELECT * FROM hint_plan.hints ORDER BY id;
7885+ id | norm_query_string | application_name | hints
7886+----+----------------------------------------------------------+------------------+----------------
7887+ 1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?; | | SeqScan(t1)
7888+ 2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; | | IndexScan(t1)
7889+ 3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?; | | BitmapScan(t1)
7890+(3 rows)
7891+
78827892 SET pg_hint_plan.enable_hint_table = on;
78837893 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
78847894 LOG: pg_hint_plan:
--- a/expected/pg_hint_plan-9.2.out
+++ b/expected/pg_hint_plan-9.2.out
@@ -7967,6 +7967,16 @@ error hint:
79677967
79687968 -- search from hint table
79697969 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7970+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
7971+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
7972+SELECT * FROM hint_plan.hints ORDER BY id;
7973+ id | norm_query_string | application_name | hints
7974+----+----------------------------------------------------------+------------------+----------------
7975+ 1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?; | | SeqScan(t1)
7976+ 2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; | | IndexScan(t1)
7977+ 3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?; | | BitmapScan(t1)
7978+(3 rows)
7979+
79707980 SET pg_hint_plan.enable_hint_table = on;
79717981 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
79727982 LOG: pg_hint_plan:
--- a/sql/pg_hint_plan.sql
+++ b/sql/pg_hint_plan.sql
@@ -823,9 +823,9 @@ EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
823823 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
824824
825825 -- search from hint table
826-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', 'psql', 'SeqScan(t1)');
827-INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
826+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
828827 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
828+INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
829829 SELECT * FROM hint_plan.hints ORDER BY id;
830830 SET pg_hint_plan.enable_hint_table = on;
831831 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
Show on old repository browser