OSDN Git Service

ヒント用テーブルにヒント検索高速化用のインデックスを作成した。
[pghintplan/pg_hint_plan.git] / pg_hint_plan--1.0.sql
index c13fa64..305baa9 100644 (file)
@@ -1,28 +1,16 @@
-/* contrib/pg_last_xact_activity/pg_last_xact_activity--1.0.sql */
+/* pg_hint_plan/pg_hint_plan--1.0.sql */
 
--- Register functions.
-CREATE FUNCTION pg_add_hint(text)
-RETURNS int
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
-
-CREATE FUNCTION pg_clear_hint()
-RETURNS int
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
-
-CREATE FUNCTION pg_dump_hint()
-RETURNS text
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
-
-CREATE FUNCTION pg_enable_hint(bool)
-RETURNS int
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
-
-CREATE FUNCTION pg_enable_log(bool)
-RETURNS int
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
+-- complain if script is sourced in psql, rather than via CREATE EXTENSION
+\echo Use "CREATE EXTENSION pg_hint_plan" to load this file. \quit
 
+CREATE TABLE hint_plan.hints (
+       id                                      serial  NOT NULL,
+       norm_query_string       text    NOT NULL,
+       application_name        text    NOT NULL,
+       hints                           text    NOT NULL,
+       PRIMARY KEY (id)
+);
+CREATE UNIQUE INDEX hints_norm_and_app ON hint_plan.hints (
+       norm_query_string,
+       application_name
+);