-- No.A-1-2-3
DROP EXTENSION pg_hint_plan;
-- No.A-1-1-4
-CREATE EXTENSION pg_hint_plan SCHEMA other_name;
+CREATE SCHEMA other_schema;
+CREATE EXTENSION pg_hint_plan SCHEMA other_schema;
ERROR: extension "pg_hint_plan" must be installed in schema "hint_plan"
CREATE EXTENSION pg_hint_plan;
+DROP SCHEMA other_schema;
----
---- No. A-5-1 comment pattern
----
SET pg_hint_plan.enable_hint_table TO on;
-- No. A-6-1-1
\d hint_plan.hints
- Table "hint_plan.hints"
- Column | Type | Modifiers
--------------------+---------+--------------------------------------------------------------
- id | integer | not null default nextval('hint_plan.hints_id_seq'::regclass)
- norm_query_string | text | not null
- application_name | text | not null
- hints | text | not null
+ Table "hint_plan.hints"
+ Column | Type | Collation | Nullable | Default
+-------------------+---------+-----------+----------+---------------------------------------------
+ id | integer | | not null | nextval('hint_plan.hints_id_seq'::regclass)
+ norm_query_string | text | | not null |
+ application_name | text | | not null |
+ hints | text | | not null |
Indexes:
"hints_pkey" PRIMARY KEY, btree (id)
"hints_norm_and_app" UNIQUE, btree (norm_query_string, application_name)
---- No. A-8-4 original GUC parameter pg_hint_plan.parse_messages
----
SET client_min_messages TO debug5;
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
-- No. A-8-4-1
SET pg_hint_plan.parse_messages TO debug5;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
+DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
+DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
pg_hint_plan.parse_messages
-----------------------------
debug5
(1 row)
/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
DEBUG: pg_hint_plan: hint syntax error at or near ""
DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
?column?
----------
1
(1 row)
SET client_min_messages TO debug4;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
+DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
?column?
----------
1
-- No. A-8-4-2
SET pg_hint_plan.parse_messages TO debug4;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
pg_hint_plan.parse_messages
-----------------------------
debug4
(1 row)
/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
DEBUG: pg_hint_plan: hint syntax error at or near ""
DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
?column?
----------
1
(1 row)
SET client_min_messages TO debug3;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
?column?
----------
1
-- No. A-8-4-3
SET pg_hint_plan.parse_messages TO debug3;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
SHOW pg_hint_plan.parse_messages;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
pg_hint_plan.parse_messages
-----------------------------
debug3
(1 row)
/*+Set*/SELECT 1;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
DEBUG: pg_hint_plan: hint syntax error at or near ""
DETAIL: Opening parenthesis is necessary.
-DEBUG: CommitTransactionCommand
-DEBUG: CommitTransaction
-DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
?column?
----------
1
(1 row)
SET client_min_messages TO debug2;
-DEBUG: StartTransactionCommand
-DEBUG: StartTransaction
-DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
-DEBUG: ProcessUtility
/*+Set*/SELECT 1;
?column?
----------
/*+Set*/SELECT 1;
ERROR: pg_hint_plan: hint syntax error at or near ""
DETAIL: Opening parenthesis is necessary.
-SET client_min_messages TO fatal;
+SET client_min_messages TO error;
/*+Set*/SELECT 1;
+ERROR: pg_hint_plan: hint syntax error at or near ""
+DETAIL: Opening parenthesis is necessary.
-- No. A-8-4-11
RESET client_min_messages;
SET pg_hint_plan.parse_messages TO DEFAULT;
ORDER BY 1;
query | calls
--------------------------------------+-------
- SELECT * FROM s1.t1 WHERE t1.c1 = ?; | 3
- SELECT pg_stat_statements_reset(); | 1
+ SELECT * FROM s1.t1 WHERE t1.c1 = $1 | 3
+ SELECT pg_stat_statements_reset() | 1
(2 rows)
----
-- No. A-12-1-1
-- No. A-12-2-1
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
SET pg_hint_plan.parse_messages TO error;
/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
ERROR: pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
DETAIL: Relation name "t1" is duplicated.
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-- No. A-12-1-2
-- No. A-12-2-2
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
SET pg_hint_plan.parse_messages TO error;
/*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
ERROR: pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
DETAIL: Relation name "t1" is duplicated.
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
EXPLAIN (COSTS false) EXECUTE p1;
QUERY PLAN
-- No. A-12-1-3
-- No. A-12-2-3
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
SET pg_hint_plan.parse_messages TO error;
EXPLAIN (COSTS false) EXECUTE p2;
(6 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
-- No. A-12-1-4
-- No. A-12-2-4
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
SET pg_hint_plan.parse_messages TO error;
EXPLAIN (COSTS false) EXECUTE p2;
(6 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | on
- enable_material | on
- enable_mergejoin | on
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | on
+ enable_material | on
+ enable_mergejoin | on
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
DEALLOCATE p1;
SET pg_hint_plan.parse_messages TO LOG;
(5 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
(4 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
QUERY PLAN
(5 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
BEGIN;
/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
COMMIT;
BEGIN;
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
QUERY PLAN
(5 rows)
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | log
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | log
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
/*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
SET enable_mergejoin TO off;
LOAD 'pg_hint_plan';
SELECT name, setting FROM settings;
- name | setting
----------------------------+-----------
- geqo | on
- geqo_effort | 5
- geqo_generations | 0
- geqo_pool_size | 0
- geqo_seed | 0
- geqo_selection_bias | 2
- geqo_threshold | 12
- constraint_exclusion | partition
- cursor_tuple_fraction | 0.1
- default_statistics_target | 100
- from_collapse_limit | 8
- join_collapse_limit | 8
- cpu_index_tuple_cost | 0.005
- cpu_operator_cost | 0.0025
- cpu_tuple_cost | 0.01
- effective_cache_size | 16384
- random_page_cost | 4
- seq_page_cost | 1
- enable_bitmapscan | on
- enable_hashagg | on
- enable_hashjoin | on
- enable_indexonlyscan | on
- enable_indexscan | off
- enable_material | on
- enable_mergejoin | off
- enable_nestloop | on
- enable_seqscan | on
- enable_sort | on
- enable_tidscan | on
- client_min_messages | notice
-(30 rows)
+ name | setting
+--------------------------------+-----------
+ client_min_messages | notice
+ geqo | on
+ geqo_effort | 5
+ geqo_generations | 0
+ geqo_pool_size | 0
+ geqo_seed | 0
+ geqo_selection_bias | 2
+ geqo_threshold | 12
+ constraint_exclusion | partition
+ cursor_tuple_fraction | 0.1
+ default_statistics_target | 100
+ force_parallel_mode | off
+ from_collapse_limit | 8
+ jit | on
+ join_collapse_limit | 8
+ plan_cache_mode | auto
+ cpu_index_tuple_cost | 0.005
+ cpu_operator_cost | 0.0025
+ cpu_tuple_cost | 0.01
+ effective_cache_size | 16384
+ jit_above_cost | 100000
+ jit_inline_above_cost | 500000
+ jit_optimize_above_cost | 500000
+ min_parallel_index_scan_size | 64
+ min_parallel_table_scan_size | 1024
+ parallel_setup_cost | 1000
+ parallel_tuple_cost | 0.1
+ random_page_cost | 4
+ seq_page_cost | 1
+ enable_bitmapscan | on
+ enable_gathermerge | on
+ enable_hashagg | on
+ enable_hashjoin | on
+ enable_incremental_sort | on
+ enable_indexonlyscan | on
+ enable_indexscan | off
+ enable_material | on
+ enable_mergejoin | off
+ enable_nestloop | on
+ enable_parallel_append | on
+ enable_parallel_hash | on
+ enable_partition_pruning | on
+ enable_partitionwise_aggregate | off
+ enable_partitionwise_join | off
+ enable_seqscan | on
+ enable_sort | on
+ enable_tidscan | on
+(47 rows)
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
QUERY PLAN
EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
NOTICE: nested_planner(2)
NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
QUERY PLAN
---------------------------------------
Index Only Scan using t1_i1 on t1 t_1
EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
NOTICE: nested_planner(2)
NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
not used hint:
RETURN new_cnt;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
+-- The function called at the bottom desn't use a hint, the immediate
+-- caller level should restore its own hint. So, the first LOG from
+-- pg_hint_plan should use the IndexScan(t_1) hint
EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
NOTICE: nested_planner(5)
NOTICE: nested_planner(4)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(3)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(2)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
-no hint
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
+used hint:
+IndexScan(t_1)
+not used hint:
+duplication hint:
+error hint:
+
LOG: pg_hint_plan:
-no hint
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
+used hint:
+IndexScan(t_1)
+not used hint:
+duplication hint:
+error hint:
+
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
QUERY PLAN
---------------------------------------
Index Only Scan using t1_i1 on t1 t_1
(1 row)
-/*+SeqScan(t_2)*/
+-- The top level uses SeqScan(t_1), but the function should use only
+-- the hint in the function.
+/*+SeqScan(t_1) SeqScan(t_2)*/
EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
NOTICE: nested_planner(5)
NOTICE: nested_planner(4)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(3)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(2)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
NOTICE: nested_planner(1)
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
-SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
IndexScan(t_1)
duplication hint:
error hint:
-CONTEXT: SQL statement "SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) FROM s1.t1 t_1
- JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
- ORDER BY t_1.c1 LIMIT 1"
-PL/pgSQL function nested_planner(integer) line 12 at SQL statement
LOG: pg_hint_plan:
used hint:
+SeqScan(t_1)
not used hint:
SeqScan(t_2)
duplication hint:
error hint:
- QUERY PLAN
----------------------------------------
- Index Only Scan using t1_i1 on t1 t_1
-(1 row)
+ QUERY PLAN
+--------------------------
+ Sort
+ Sort Key: c1
+ -> Seq Scan on t1 t_1
+(3 rows)
----
---- No. A-13-4 output of debugging log on hint status
ORDER BY t_1.c1 LIMIT 1;
$$ LANGUAGE SQL IMMUTABLE;
--No.13-4-1
+-- recall_planner() is reduced to constant while planning using the
+-- hint defined in the function. Then the outer query is planned based
+-- on the following hint. pg_hint_plan shows the log for the function
+-- but the resulting explain output doesn't contain the corresponding
+-- plan.
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
HashJoin(t_1 t_2)
(7 rows)
--No.13-4-2
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(st_1 st_2)
duplication hint:
error hint:
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
HashJoin(st_1 st_2)
(7 rows)
--No.13-4-3
+--See description for No.13-4-1
/*+HashJoin(t_1 t_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 st_1
ORDER BY st_1.c1;
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
not used hint:
(6 rows)
--No.13-4-4
+--See description for No.13-4-1
/*+HashJoin(st_1 st_2)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(st_1 st_2)
duplication hint:
error hint:
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
not used hint:
(6 rows)
--No.13-4-5
+-- See description for No.13-4-1. No joins in ths plan, so
+-- pg_hint_plan doesn't complain on the wrongly written error hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
ORDER BY t_1.c1;
-INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-HashJoin(t_1 t_1)
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
not used hint:
SELECT recall_planner_one_t() FROM s1.t1 t_1
JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
ORDER BY t_1.c1;
+LOG: pg_hint_plan:
+used hint:
+IndexScan(t_1)
+not used hint:
+duplication hint:
+error hint:
+
QUERY PLAN
---------------------------------------------
Merge Join
ORDER BY t_1.c1;
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
-HashJoin(t_1 t_1)
duplication hint:
error hint:
-CONTEXT: SQL function "recall_planner_one_t" during startup
INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
DETAIL: Relation name "t_1" is duplicated.
LOG: pg_hint_plan:
DROP FUNCTION recall_planner_one_t(int);
ERROR: function recall_planner_one_t(integer) does not exist
--No.13-4-7
+-- See description for No.13-4-1. Complains on the wrongly written hint.
/*+HashJoin(t_1 t_1)*/
EXPLAIN (COSTS false)
SELECT recall_planner() FROM s1.t1 t_1
JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
ORDER BY t_1.c1;
-INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
-DETAIL: Relation name "t_1" is duplicated.
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
+IndexScan(t_1)
not used hint:
duplication hint:
error hint:
-HashJoin(t_1 t_1)
-CONTEXT: SQL function "recall_planner" during startup
INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
DETAIL: Relation name "t_1" is duplicated.
LOG: pg_hint_plan:
ORDER BY t_1.c1;
INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
DETAIL: Conflict join method hint.
-INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
-DETAIL: Conflict join method hint.
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
-HashJoin(t_1 t_2)
+IndexScan(t_1)
not used hint:
duplication hint:
-MergeJoin(t_1 t_2)
error hint:
-CONTEXT: SQL function "recall_planner" during startup
LOG: pg_hint_plan:
used hint:
HashJoin(t_1 t_2)
-> Seq Scan on t2 t_2
(7 rows)
+--No.14-1-1 plancache invalidation
+CREATE TABLE s1.tpc AS SELECT a FROM generate_series(0, 999) a;
+CREATE INDEX ON s1.tpc(a);
+PREPARE p1 AS SELECT * FROM s1.tpc WHERE a < 999;
+/*+ IndexScan(tpc) */PREPARE p2 AS SELECT * FROM s1.tpc WHERE a < 999;
+/*+ SeqScan(tpc) */PREPARE p3(int) AS SELECT * FROM s1.tpc WHERE a = $1;
+EXPLAIN EXECUTE p1;
+ QUERY PLAN
+------------------------------------------------------
+ Seq Scan on tpc (cost=0.00..17.50 rows=333 width=4)
+ Filter: (a < 999)
+(2 rows)
+
+EXPLAIN EXECUTE p2;
+LOG: pg_hint_plan:
+used hint:
+IndexScan(tpc)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------
+ Index Scan using tpc_a_idx on tpc (cost=0.28..34.10 rows=333 width=4)
+ Index Cond: (a < 999)
+(2 rows)
+
+EXPLAIN EXECUTE p3(500);
+LOG: pg_hint_plan:
+used hint:
+SeqScan(tpc)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+----------------------------------------------------
+ Seq Scan on tpc (cost=0.00..17.50 rows=5 width=4)
+ Filter: (a = 500)
+(2 rows)
+
+-- The DROP invalidates the plan caches
+DROP TABLE s1.tpc;
+CREATE TABLE s1.tpc AS SELECT a FROM generate_series(0, 999) a;
+CREATE INDEX ON s1.tpc(a);
+EXPLAIN EXECUTE p1;
+ QUERY PLAN
+------------------------------------------------------
+ Seq Scan on tpc (cost=0.00..17.50 rows=333 width=4)
+ Filter: (a < 999)
+(2 rows)
+
+EXPLAIN EXECUTE p2;
+LOG: pg_hint_plan:
+used hint:
+IndexScan(tpc)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+------------------------------------------------------------------------
+ Index Scan using tpc_a_idx on tpc (cost=0.28..34.10 rows=333 width=4)
+ Index Cond: (a < 999)
+(2 rows)
+
+EXPLAIN EXECUTE p3(500);
+LOG: pg_hint_plan:
+used hint:
+SeqScan(tpc)
+not used hint:
+duplication hint:
+error hint:
+
+ QUERY PLAN
+----------------------------------------------------
+ Seq Scan on tpc (cost=0.00..17.50 rows=5 width=4)
+ Filter: (a = 500)
+(2 rows)
+
+DEALLOCATE p1;
+DEALLOCATE p2;
+DEALLOCATE p3;
+DROP TABLE s1.tpc;