2 SET pg_hint_plan.enable_hint TO on;
3 SET pg_hint_plan.debug_print TO on;
4 SET client_min_messages TO LOG;
5 SET search_path TO public;
8 ---- No.A-2-1 uninstall
11 CREATE EXTENSION pg_hint_plan;
13 DROP EXTENSION pg_hint_plan;
15 CREATE SCHEMA other_schema;
16 CREATE EXTENSION pg_hint_plan SCHEMA other_schema;
17 ERROR: extension "pg_hint_plan" must be installed in schema "hint_plan"
18 CREATE EXTENSION pg_hint_plan;
19 DROP SCHEMA other_schema;
21 ---- No. A-5-1 comment pattern
25 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
41 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
43 ------------------------------
44 Index Scan using t1_i1 on t1
50 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
52 ------------------------------
53 Index Scan using t1_i1 on t1
59 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
61 ------------------------------
62 Index Scan using t1_i1 on t1
67 /* /*+SeqScan(t1)*/ */
68 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
70 ------------------------------
71 Index Scan using t1_i1 on t1
76 ---- No. A-5-2 hint position
79 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
81 -----------------------------------
82 Index Only Scan using t1_i1 on t1
87 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
102 EXPLAIN (COSTS false) SELECT c1, c2 AS c_2 /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
117 EXPLAIN (COSTS false) SELECT c1 AS "c1"/*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
119 -----------------------------------
120 Index Only Scan using t1_i1 on t1
125 EXPLAIN (COSTS false) SELECT * /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
127 ------------------------------
128 Index Scan using t1_i1 on t1
133 ---- No. A-6-1 hint's table definition
135 SET pg_hint_plan.enable_hint_table TO on;
138 Table "hint_plan.hints"
139 Column | Type | Modifiers
140 -------------------+---------+--------------------------------------------------------------
141 id | integer | not null default nextval('hint_plan.hints_id_seq'::regclass)
142 norm_query_string | text | not null
143 application_name | text | not null
144 hints | text | not null
146 "hints_pkey" PRIMARY KEY, btree (id)
147 "hints_norm_and_app" UNIQUE, btree (norm_query_string, application_name)
150 ---- No. A-6-2 search condition
152 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
154 ------------------------------
155 Index Scan using t1_i1 on t1
160 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
162 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
165 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
180 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
182 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
185 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
199 TRUNCATE hint_plan.hints;
201 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
203 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
204 'dummy_application_name',
207 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
209 ------------------------------
210 Index Scan using t1_i1 on t1
214 TRUNCATE hint_plan.hints;
216 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
218 'EXPLAIN (COSTS false) SELECT * FROM s1.t1;',
222 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
224 ------------------------------
225 Index Scan using t1_i1 on t1
229 TRUNCATE hint_plan.hints;
231 ---- No. A-6-3 number of constant
234 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
236 'EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;',
240 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;
253 TRUNCATE hint_plan.hints;
255 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
257 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
261 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
275 TRUNCATE hint_plan.hints;
277 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
279 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ? OR t1.c1 = ?;',
283 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 OR t1.c1 = 0;
292 ----------------------------------
294 Filter: ((c1 = 1) OR (c1 = 0))
297 TRUNCATE hint_plan.hints;
298 SET pg_hint_plan.enable_hint_table TO off;
300 ---- No. A-7-2 hint delimiter
302 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
304 ------------------------------
305 Index Scan using t1_i1 on t1
316 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
317 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
320 Set(enable_bitmapscan off)
321 Set(enable_indexscan off)
333 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
334 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
337 Set(enable_bitmapscan off)
338 Set(enable_indexscan off)
350 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
351 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
354 Set(enable_bitmapscan off)
355 Set(enable_indexscan off)
367 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
368 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
371 Set(enable_bitmapscan off)
372 Set(enable_indexscan off)
384 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
385 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
388 Set(enable_bitmapscan off)
389 Set(enable_indexscan off)
401 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
402 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
405 Set(enable_bitmapscan off)
406 Set(enable_indexscan off)
418 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
419 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
422 Set(enable_bitmapscan off)
423 Set(enable_indexscan off)
435 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
436 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
439 Set(enable_bitmapscan off)
440 Set(enable_indexscan off)
452 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
453 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
456 Set(enable_bitmapscan off)
457 Set(enable_indexscan off)
469 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
470 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
473 Set(enable_bitmapscan off)
474 Set(enable_indexscan off)
486 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
487 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
490 Set(enable_bitmapscan off)
491 Set(enable_indexscan off)
503 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
504 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
507 Set(enable_bitmapscan off)
508 Set(enable_indexscan off)
520 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
521 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
524 Set(enable_bitmapscan off)
525 Set(enable_indexscan off)
537 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
538 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
541 Set(enable_bitmapscan off)
542 Set(enable_indexscan off)
554 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
555 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
558 Set(enable_bitmapscan off)
559 Set(enable_indexscan off)
572 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
573 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
576 Set(enable_bitmapscan off)
577 Set(enable_indexscan off)
589 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
591 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
594 Set(enable_bitmapscan off)
595 Set(enable_indexscan off)
609 (enable_indexscan"off")
611 (enable_bitmapscan"off")*/
612 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
615 Set(enable_bitmapscan off)
616 Set(enable_indexscan off)
630 enable_indexscan"off")Set
632 enable_bitmapscan"off")*/
633 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
636 Set(enable_bitmapscan off)
637 Set(enable_indexscan off)
649 /*+Set(enable_indexscan"off"
651 Set(enable_bitmapscan"off"
654 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
657 Set(enable_bitmapscan off)
658 Set(enable_indexscan off)
677 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
680 Set(enable_bitmapscan off)
681 Set(enable_indexscan off)
705 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
708 Set(enable_bitmapscan off)
709 Set(enable_indexscan off)
722 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
723 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
726 Set(enable_bitmapscan off)
727 Set(enable_indexscan off)
739 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
741 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
744 Set(enable_bitmapscan off)
745 Set(enable_indexscan off)
759 (enable_indexscan"off")
761 (enable_bitmapscan"off")*/
762 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
765 Set(enable_bitmapscan off)
766 Set(enable_indexscan off)
780 enable_indexscan"off")Set
782 enable_bitmapscan"off")*/
783 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
786 Set(enable_bitmapscan off)
787 Set(enable_indexscan off)
799 /*+Set(enable_indexscan"off"
801 Set(enable_bitmapscan"off"
804 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
807 Set(enable_bitmapscan off)
808 Set(enable_indexscan off)
827 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
830 Set(enable_bitmapscan off)
831 Set(enable_indexscan off)
855 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
858 Set(enable_bitmapscan off)
859 Set(enable_indexscan off)
871 ---- No. A-7-3 hint object pattern
872 ---- No. A-9-2 message object pattern
877 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
892 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
907 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
922 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
939 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
954 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
963 ----------------------
969 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
984 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
993 ----------------------
1001 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
1002 INFO: pg_hint_plan: hint syntax error at or near "()"
1003 DETAIL: Zero-length delimited string.
1005 ----------------------------------
1006 Index Scan using t1_i1 on t1 "("
1007 Index Cond: (c1 = 1)
1011 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
1020 --------------------
1028 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
1029 INFO: pg_hint_plan: hint syntax error at or near ")"
1030 DETAIL: SeqScan hint requires a relation.
1031 INFO: pg_hint_plan: hint syntax error at or near ")"
1032 DETAIL: Unrecognized hint keyword ")".
1041 ----------------------------------
1042 Index Scan using t1_i1 on t1 ")"
1043 Index Cond: (c1 = 1)
1047 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
1056 --------------------
1062 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
1071 ----------------------
1072 Seq Scan on t1 ")))"
1079 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
1080 INFO: pg_hint_plan: hint syntax error at or near ""
1081 DETAIL: Unterminated quoted string.
1083 -----------------------------------
1084 Index Scan using t1_i1 on t1 """"
1085 Index Cond: (c1 = 1)
1089 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
1098 ---------------------
1103 /*+SeqScan("""""""")*/
1104 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
1113 -------------------------
1114 Seq Scan on t1 """"""""
1121 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1122 INFO: pg_hint_plan: hint syntax error at or near ""
1123 DETAIL: SeqScan hint requires a relation.
1132 ----------------------------------
1133 Index Scan using t1_i1 on t1 " "
1134 Index Cond: (c1 = 1)
1138 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1147 --------------------
1153 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1162 ----------------------
1170 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1171 INFO: pg_hint_plan: hint syntax error at or near ""
1172 DETAIL: SeqScan hint requires a relation.
1181 -----------------------------------
1182 Index Scan using t1_i1 on t1 " "
1183 Index Cond: (c1 = 1)
1187 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1196 ---------------------------
1202 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1211 -------------------------------------------
1220 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1223 INFO: pg_hint_plan: hint syntax error at or near ""
1224 DETAIL: SeqScan hint requires a relation.
1233 --------------------------------
1234 Index Scan using t1_i1 on t1 "
1236 Index Cond: (c1 = 1)
1241 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1253 --------------------
1263 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1281 --------------------
1292 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1301 ----------------------
1302 Seq Scan on t1 "Set"
1307 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1316 ----------------------
1317 Seq Scan on t1 "Set"
1321 /*+SeqScan("Set SeqScan Leading")*/
1322 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
1325 SeqScan("Set SeqScan Leading")
1331 --------------------------------------
1332 Seq Scan on t1 "Set SeqScan Leading"
1339 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1348 ---------------------
1354 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1363 -------------------------
1364 Seq Scan on t1 "あいう"
1369 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1378 ---------------------
1384 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1393 -------------------------
1394 Seq Scan on t1 "あいう"
1401 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
1402 INFO: pg_hint_plan: hint syntax error at or near "/**/)*/
1403 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
1404 DETAIL: Nested block comments are not supported.
1406 -------------------------------------
1407 Index Scan using t1_i1 on t1 "/**/"
1408 Index Cond: (c1 = 1)
1411 /*+SeqScan(/**//**//**/)*/
1412 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
1413 INFO: pg_hint_plan: hint syntax error at or near "/**//**//**/)*/
1414 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
1415 DETAIL: Nested block comments are not supported.
1417 ---------------------------------------------
1418 Index Scan using t1_i1 on t1 "/**//**//**/"
1419 Index Cond: (c1 = 1)
1426 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1427 Set/**/あ" WHERE "tT()""
1429 INFO: pg_hint_plan: hint syntax error at or near "/**/あ")*/
1430 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1431 Set/**/あ" WHERE "tT()""
1433 DETAIL: Nested block comments are not supported.
1435 ------------------------------------------
1436 Index Scan using t1_i1 on t1 "tT()""
1438 Index Cond: (c1 = 1)
1444 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1456 --------------------------
1457 Seq Scan on t1 "tT()""
1464 /*+SeqScan(a123456789b123456789c123456789d123456789e123456789f123)*/
1465 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "123456789012345678901234567890123456789012345678901234" WHERE "123456789012345678901234567890123456789012345678901234".c1 = 1;
1469 SeqScan(a123456789b123456789c123456789d123456789e123456789f123)
1474 ---------------------------------------------------------------------------------------
1475 Index Scan using t1_i1 on t1 "123456789012345678901234567890123456789012345678901234"
1476 Index Cond: (c1 = 1)
1480 ---- No. A-7-4 hint parse error
1483 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1484 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1485 INFO: pg_hint_plan: hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1486 DETAIL: Opening parenthesis is necessary.
1489 Set(enable_indexscan off)
1495 ----------------------------------
1496 Bitmap Heap Scan on t1
1497 Recheck Cond: (c1 = 1)
1498 -> Bitmap Index Scan on t1_i1
1499 Index Cond: (c1 = 1)
1503 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
1504 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1505 INFO: pg_hint_plan: hint syntax error at or near "(enable_bitmapscan off)SeqScan(t1)"
1506 DETAIL: Zero-length delimited string.
1509 Set(enable_indexscan off)
1515 ----------------------------------
1516 Bitmap Heap Scan on t1
1517 Recheck Cond: (c1 = 1)
1518 -> Bitmap Index Scan on t1_i1
1519 Index Cond: (c1 = 1)
1523 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
1524 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1525 INFO: pg_hint_plan: hint syntax error at or near ""
1526 DETAIL: Unterminated quoted string.
1529 Set(enable_indexscan off)
1535 ----------------------------------
1536 Bitmap Heap Scan on t1
1537 Recheck Cond: (c1 = 1)
1538 -> Bitmap Index Scan on t1_i1
1539 Index Cond: (c1 = 1)
1543 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
1544 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1545 INFO: pg_hint_plan: hint syntax error at or near ")Set(enable_bitmapscan off)"
1546 DETAIL: Zero-length delimited string.
1549 Set(enable_indexscan off)
1555 ----------------------------------
1556 Bitmap Heap Scan on t1
1557 Recheck Cond: (c1 = 1)
1558 -> Bitmap Index Scan on t1_i1
1559 Index Cond: (c1 = 1)
1563 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1564 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1565 INFO: pg_hint_plan: hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1566 DETAIL: Unrecognized hint keyword "NoSet".
1569 Set(enable_indexscan off)
1575 ----------------------------------
1576 Bitmap Heap Scan on t1
1577 Recheck Cond: (c1 = 1)
1578 -> Bitmap Index Scan on t1_i1
1579 Index Cond: (c1 = 1)
1583 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1584 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1585 INFO: pg_hint_plan: hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1586 DETAIL: Unrecognized hint keyword ""Set"".
1589 Set(enable_indexscan off)
1595 ----------------------------------
1596 Bitmap Heap Scan on t1
1597 Recheck Cond: (c1 = 1)
1598 -> Bitmap Index Scan on t1_i1
1599 Index Cond: (c1 = 1)
1603 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1604 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1605 INFO: pg_hint_plan: hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1606 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
1607 DETAIL: Nested block comments are not supported.
1609 ------------------------------
1610 Index Scan using t1_i1 on t1
1611 Index Cond: (c1 = 1)
1615 ---- No. A-8-1 original GUC parameter
1617 ---- Don't test postgresql itself.
1619 -- SET ROLE super_user;
1620 -- SET pg_hint_plan.debug_print TO off;
1621 -- SHOW pg_hint_plan.enable_hint;
1622 -- SHOW pg_hint_plan.debug_print;
1623 -- SHOW pg_hint_plan.parse_messages;
1624 -- SET pg_hint_plan.enable_hint TO off;
1625 -- SET pg_hint_plan.debug_print TO on;
1626 -- SET pg_hint_plan.parse_messages TO error;
1627 -- SHOW pg_hint_plan.enable_hint;
1628 -- SHOW pg_hint_plan.debug_print;
1629 -- SHOW pg_hint_plan.parse_messages;
1630 -- RESET pg_hint_plan.enable_hint;
1631 -- RESET pg_hint_plan.debug_print;
1632 -- RESET pg_hint_plan.parse_messages;
1633 -- SHOW pg_hint_plan.enable_hint;
1634 -- SHOW pg_hint_plan.debug_print;
1635 -- SHOW pg_hint_plan.parse_messages;
1638 -- SET ROLE normal_user;
1639 -- SHOW pg_hint_plan.enable_hint;
1640 -- SHOW pg_hint_plan.debug_print;
1641 -- SHOW pg_hint_plan.parse_messages;
1642 -- SET pg_hint_plan.enable_hint TO off;
1643 -- SET pg_hint_plan.debug_print TO on;
1644 -- SET pg_hint_plan.parse_messages TO error;
1645 -- SHOW pg_hint_plan.enable_hint;
1646 -- SHOW pg_hint_plan.debug_print;
1647 -- SHOW pg_hint_plan.parse_messages;
1648 -- RESET pg_hint_plan.enable_hint;
1649 -- RESET pg_hint_plan.debug_print;
1650 -- RESET pg_hint_plan.parse_messages;
1651 -- SHOW pg_hint_plan.enable_hint;
1652 -- SHOW pg_hint_plan.debug_print;
1653 -- SHOW pg_hint_plan.parse_messages;
1657 ---- No. A-8-2 original GUC parameter pg_hint_plan.enable_hint
1660 SET pg_hint_plan.debug_print TO off;
1661 SET pg_hint_plan.enable_hint TO on;
1662 SHOW pg_hint_plan.enable_hint;
1663 pg_hint_plan.enable_hint
1664 --------------------------
1668 /*+Set(enable_indexscan off)*/
1669 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1671 ----------------------------------
1672 Bitmap Heap Scan on t1
1673 Recheck Cond: (c1 = 1)
1674 -> Bitmap Index Scan on t1_i1
1675 Index Cond: (c1 = 1)
1679 SET pg_hint_plan.enable_hint TO off;
1680 SHOW pg_hint_plan.enable_hint;
1681 pg_hint_plan.enable_hint
1682 --------------------------
1686 /*+Set(enable_indexscan off)*/
1687 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1689 ------------------------------
1690 Index Scan using t1_i1 on t1
1691 Index Cond: (c1 = 1)
1695 -- Don't test PostgreSQL itself.
1696 -- SET pg_hint_plan.enable_hint TO DEFAULT;
1697 -- SHOW pg_hint_plan.enable_hint;
1698 -- /*+Set(enable_indexscan off)*/
1699 -- EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1701 -- Don't test PostgreSQL itself
1702 -- SET pg_hint_plan.enable_hint TO enable;
1703 -- SHOW pg_hint_plan.enable_hint;
1705 ---- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
1708 SET pg_hint_plan.enable_hint TO on;
1709 SHOW pg_hint_plan.enable_hint;
1710 pg_hint_plan.enable_hint
1711 --------------------------
1715 SET pg_hint_plan.debug_print TO on;
1716 SHOW pg_hint_plan.debug_print;
1717 pg_hint_plan.debug_print
1718 --------------------------
1722 /*+Set(enable_indexscan off)*/
1723 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1726 Set(enable_indexscan off)
1732 ----------------------------------
1733 Bitmap Heap Scan on t1
1734 Recheck Cond: (c1 = 1)
1735 -> Bitmap Index Scan on t1_i1
1736 Index Cond: (c1 = 1)
1740 SET pg_hint_plan.debug_print TO off;
1741 SHOW pg_hint_plan.debug_print;
1742 pg_hint_plan.debug_print
1743 --------------------------
1747 /*+Set(enable_indexscan off)*/
1748 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1750 ----------------------------------
1751 Bitmap Heap Scan on t1
1752 Recheck Cond: (c1 = 1)
1753 -> Bitmap Index Scan on t1_i1
1754 Index Cond: (c1 = 1)
1758 SET pg_hint_plan.debug_print TO DEFAULT;
1759 SHOW pg_hint_plan.debug_print;
1760 pg_hint_plan.debug_print
1761 --------------------------
1765 /*+Set(enable_indexscan off)*/
1766 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1768 ----------------------------------
1769 Bitmap Heap Scan on t1
1770 Recheck Cond: (c1 = 1)
1771 -> Bitmap Index Scan on t1_i1
1772 Index Cond: (c1 = 1)
1776 SET pg_hint_plan.debug_print TO enable;
1777 ERROR: invalid value for parameter "pg_hint_plan.debug_print": "enable"
1778 HINT: Available values: off, on, detailed, verbose.
1779 SHOW pg_hint_plan.debug_print;
1780 pg_hint_plan.debug_print
1781 --------------------------
1786 ---- No. A-8-4 original GUC parameter pg_hint_plan.parse_messages
1788 SET client_min_messages TO debug5;
1789 DEBUG: CommitTransactionCommand
1790 DEBUG: CommitTransaction
1791 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1793 SET pg_hint_plan.parse_messages TO debug5;
1794 DEBUG: StartTransactionCommand
1795 DEBUG: StartTransaction
1796 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1797 DEBUG: ProcessUtility
1798 DEBUG: CommitTransactionCommand
1799 DEBUG: CommitTransaction
1800 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1801 SHOW pg_hint_plan.parse_messages;
1802 DEBUG: StartTransactionCommand
1803 DEBUG: StartTransaction
1804 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1805 DEBUG: ProcessUtility
1806 DEBUG: CommitTransactionCommand
1807 DEBUG: CommitTransaction
1808 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1809 pg_hint_plan.parse_messages
1810 -----------------------------
1815 DEBUG: StartTransactionCommand
1816 DEBUG: StartTransaction
1817 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1818 DEBUG: pg_hint_plan: hint syntax error at or near ""
1819 DETAIL: Opening parenthesis is necessary.
1820 DEBUG: CommitTransactionCommand
1821 DEBUG: CommitTransaction
1822 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1828 SET client_min_messages TO debug4;
1829 DEBUG: StartTransactionCommand
1830 DEBUG: StartTransaction
1831 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1832 DEBUG: ProcessUtility
1833 DEBUG: CommitTransactionCommand
1834 DEBUG: CommitTransaction
1835 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1837 DEBUG: StartTransactionCommand
1838 DEBUG: StartTransaction
1839 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1840 DEBUG: CommitTransactionCommand
1841 DEBUG: CommitTransaction
1842 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1849 SET pg_hint_plan.parse_messages TO debug4;
1850 DEBUG: StartTransactionCommand
1851 DEBUG: StartTransaction
1852 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1853 DEBUG: ProcessUtility
1854 DEBUG: CommitTransactionCommand
1855 DEBUG: CommitTransaction
1856 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1857 SHOW pg_hint_plan.parse_messages;
1858 DEBUG: StartTransactionCommand
1859 DEBUG: StartTransaction
1860 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1861 DEBUG: ProcessUtility
1862 DEBUG: CommitTransactionCommand
1863 DEBUG: CommitTransaction
1864 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1865 pg_hint_plan.parse_messages
1866 -----------------------------
1871 DEBUG: StartTransactionCommand
1872 DEBUG: StartTransaction
1873 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1874 DEBUG: pg_hint_plan: hint syntax error at or near ""
1875 DETAIL: Opening parenthesis is necessary.
1876 DEBUG: CommitTransactionCommand
1877 DEBUG: CommitTransaction
1878 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1884 SET client_min_messages TO debug3;
1885 DEBUG: StartTransactionCommand
1886 DEBUG: StartTransaction
1887 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1888 DEBUG: ProcessUtility
1889 DEBUG: CommitTransactionCommand
1890 DEBUG: CommitTransaction
1891 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1893 DEBUG: StartTransactionCommand
1894 DEBUG: StartTransaction
1895 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1896 DEBUG: CommitTransactionCommand
1897 DEBUG: CommitTransaction
1898 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1905 SET pg_hint_plan.parse_messages TO debug3;
1906 DEBUG: StartTransactionCommand
1907 DEBUG: StartTransaction
1908 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1909 DEBUG: ProcessUtility
1910 DEBUG: CommitTransactionCommand
1911 DEBUG: CommitTransaction
1912 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1913 SHOW pg_hint_plan.parse_messages;
1914 DEBUG: StartTransactionCommand
1915 DEBUG: StartTransaction
1916 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1917 DEBUG: ProcessUtility
1918 DEBUG: CommitTransactionCommand
1919 DEBUG: CommitTransaction
1920 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1921 pg_hint_plan.parse_messages
1922 -----------------------------
1927 DEBUG: StartTransactionCommand
1928 DEBUG: StartTransaction
1929 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1930 DEBUG: pg_hint_plan: hint syntax error at or near ""
1931 DETAIL: Opening parenthesis is necessary.
1932 DEBUG: CommitTransactionCommand
1933 DEBUG: CommitTransaction
1934 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1940 SET client_min_messages TO debug2;
1941 DEBUG: StartTransactionCommand
1942 DEBUG: StartTransaction
1943 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1944 DEBUG: ProcessUtility
1952 SET pg_hint_plan.parse_messages TO debug2;
1953 SHOW pg_hint_plan.parse_messages;
1954 pg_hint_plan.parse_messages
1955 -----------------------------
1960 DEBUG: pg_hint_plan: hint syntax error at or near ""
1961 DETAIL: Opening parenthesis is necessary.
1967 SET client_min_messages TO debug1;
1975 SET pg_hint_plan.parse_messages TO debug1;
1976 SHOW pg_hint_plan.parse_messages;
1977 pg_hint_plan.parse_messages
1978 -----------------------------
1983 DEBUG: pg_hint_plan: hint syntax error at or near ""
1984 DETAIL: Opening parenthesis is necessary.
1990 SET client_min_messages TO log;
1998 SET pg_hint_plan.parse_messages TO log;
1999 SHOW pg_hint_plan.parse_messages;
2000 pg_hint_plan.parse_messages
2001 -----------------------------
2006 LOG: pg_hint_plan: hint syntax error at or near ""
2007 DETAIL: Opening parenthesis is necessary.
2013 SET client_min_messages TO info;
2021 SET pg_hint_plan.parse_messages TO info;
2022 SHOW pg_hint_plan.parse_messages;
2023 pg_hint_plan.parse_messages
2024 -----------------------------
2029 INFO: pg_hint_plan: hint syntax error at or near ""
2030 DETAIL: Opening parenthesis is necessary.
2036 SET client_min_messages TO notice;
2038 INFO: pg_hint_plan: hint syntax error at or near ""
2039 DETAIL: Opening parenthesis is necessary.
2046 SET pg_hint_plan.parse_messages TO notice;
2047 SHOW pg_hint_plan.parse_messages;
2048 pg_hint_plan.parse_messages
2049 -----------------------------
2054 NOTICE: pg_hint_plan: hint syntax error at or near ""
2055 DETAIL: Opening parenthesis is necessary.
2061 SET client_min_messages TO warning;
2069 SET pg_hint_plan.parse_messages TO warning;
2070 SHOW pg_hint_plan.parse_messages;
2071 pg_hint_plan.parse_messages
2072 -----------------------------
2077 WARNING: pg_hint_plan: hint syntax error at or near ""
2078 DETAIL: Opening parenthesis is necessary.
2084 SET client_min_messages TO error;
2092 SET pg_hint_plan.parse_messages TO error;
2093 SHOW pg_hint_plan.parse_messages;
2094 pg_hint_plan.parse_messages
2095 -----------------------------
2100 ERROR: pg_hint_plan: hint syntax error at or near ""
2101 DETAIL: Opening parenthesis is necessary.
2102 SET client_min_messages TO fatal;
2105 RESET client_min_messages;
2106 SET pg_hint_plan.parse_messages TO DEFAULT;
2107 SHOW pg_hint_plan.parse_messages;
2108 pg_hint_plan.parse_messages
2109 -----------------------------
2114 INFO: pg_hint_plan: hint syntax error at or near ""
2115 DETAIL: Opening parenthesis is necessary.
2122 SET pg_hint_plan.parse_messages TO fatal;
2123 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2124 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2125 SHOW pg_hint_plan.parse_messages;
2126 pg_hint_plan.parse_messages
2127 -----------------------------
2132 SET pg_hint_plan.parse_messages TO panic;
2133 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2134 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2135 SHOW pg_hint_plan.parse_messages;
2136 pg_hint_plan.parse_messages
2137 -----------------------------
2142 SET pg_hint_plan.parse_messages TO on;
2143 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "on"
2144 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2145 SHOW pg_hint_plan.parse_messages;
2146 pg_hint_plan.parse_messages
2147 -----------------------------
2152 ---- No. A-8-5 original GUC parameter pg_hint_plan.enable_hint_table
2154 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
2156 'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
2160 SET pg_hint_plan.enable_hint_table TO on;
2161 SHOW pg_hint_plan.enable_hint_table;
2162 pg_hint_plan.enable_hint_table
2163 --------------------------------
2167 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2169 --------------------
2175 SET pg_hint_plan.enable_hint_table TO off;
2176 SHOW pg_hint_plan.enable_hint_table;
2177 pg_hint_plan.enable_hint_table
2178 --------------------------------
2182 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2184 ------------------------------
2185 Index Scan using t1_i1 on t1
2186 Index Cond: (c1 = 1)
2190 SET pg_hint_plan.enable_hint_table TO DEFAULT;
2191 SHOW pg_hint_plan.enable_hint_table;
2192 pg_hint_plan.enable_hint_table
2193 --------------------------------
2197 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2199 ------------------------------
2200 Index Scan using t1_i1 on t1
2201 Index Cond: (c1 = 1)
2205 SET pg_hint_plan.enable_hint_table TO enable;
2206 ERROR: parameter "pg_hint_plan.enable_hint_table" requires a Boolean value
2207 SHOW pg_hint_plan.enable_hint_table;
2208 pg_hint_plan.enable_hint_table
2209 --------------------------------
2213 TRUNCATE hint_plan.hints;
2215 ---- No. A-9-1 parse error message output
2218 /*+"Set"(enable_indexscan on)*/SELECT 1;
2219 INFO: pg_hint_plan: hint syntax error at or near ""Set"(enable_indexscan on)"
2220 DETAIL: Unrecognized hint keyword ""Set"".
2226 /*+Set()(enable_indexscan on)*/SELECT 1;
2227 INFO: pg_hint_plan: hint syntax error at or near "Set()(enable_indexscan on)"
2228 DETAIL: Set hint requires name and value of GUC parameter.
2229 INFO: pg_hint_plan: hint syntax error at or near "(enable_indexscan on)"
2230 DETAIL: Unrecognized hint keyword "".
2236 /*+Set(enable_indexscan on*/SELECT 1;
2237 INFO: pg_hint_plan: hint syntax error at or near ""
2238 DETAIL: Closing parenthesis is necessary.
2245 ---- No. A-9-3 hint state output
2247 SET pg_hint_plan.debug_print TO on;
2248 SET client_min_messages TO LOG;
2251 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2260 --------------------
2266 /*+SeqScan(no_table)*/
2267 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2276 ------------------------------
2277 Index Scan using t1_i1 on t1
2278 Index Cond: (c1 = 1)
2282 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2284 -----------------------------------
2286 TID Cond: (ctid = '(1,1)'::tid)
2290 /*+TidScan(t1)BitmapScan(t1)*/
2291 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2292 INFO: pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2293 DETAIL: Conflict scan method hint.
2303 ----------------------------------
2304 Bitmap Heap Scan on t1
2305 Recheck Cond: (c1 = 1)
2306 Filter: (ctid = '(1,1)'::tid)
2307 -> Bitmap Index Scan on t1_i1
2308 Index Cond: (c1 = 1)
2311 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2312 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2313 INFO: pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2314 DETAIL: Conflict scan method hint.
2315 INFO: pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2316 DETAIL: Conflict scan method hint.
2327 ---------------------------------
2328 Index Scan using t1_i1 on t1
2329 Index Cond: (c1 = 1)
2330 Filter: (ctid = '(1,1)'::tid)
2333 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2334 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2335 INFO: pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2336 DETAIL: Conflict scan method hint.
2337 INFO: pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2338 DETAIL: Conflict scan method hint.
2339 INFO: pg_hint_plan: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2340 DETAIL: Conflict scan method hint.
2352 ------------------------------------------------
2354 Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2358 /*+Set(enable_indexscan enable)*/
2359 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2360 INFO: parameter "enable_indexscan" requires a Boolean value
2366 Set(enable_indexscan enable)
2369 ------------------------------
2370 Index Scan using t1_i1 on t1
2371 Index Cond: (c1 = 1)
2375 ---- No. A-10-1 hint state output
2377 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2378 EXPLAIN (COSTS false) EXECUTE p1;
2380 ------------------------------
2381 Index Scan using t1_i1 on t1
2382 Index Cond: (c1 = 1)
2386 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2387 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2389 -----------------------
2394 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2396 -----------------------
2401 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2403 -----------------------
2408 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2410 -----------------------
2415 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2417 -----------------------
2422 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2424 ---------------------
2433 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2435 EXPLAIN (COSTS false) EXECUTE p1;
2444 --------------------
2449 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2451 EXPLAIN (COSTS false) EXECUTE p1;
2460 --------------------
2467 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2469 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2478 ----------------------------------
2479 Bitmap Heap Scan on t1
2480 Recheck Cond: (c1 < 1000)
2481 -> Bitmap Index Scan on t1_i1
2482 Index Cond: (c1 < 1000)
2486 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2495 ----------------------------------
2496 Bitmap Heap Scan on t1
2497 Recheck Cond: (c1 < 1000)
2498 -> Bitmap Index Scan on t1_i1
2499 Index Cond: (c1 < 1000)
2503 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2512 ----------------------------------
2513 Bitmap Heap Scan on t1
2514 Recheck Cond: (c1 < 1000)
2515 -> Bitmap Index Scan on t1_i1
2516 Index Cond: (c1 < 1000)
2520 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2529 ----------------------------------
2530 Bitmap Heap Scan on t1
2531 Recheck Cond: (c1 < 1000)
2532 -> Bitmap Index Scan on t1_i1
2533 Index Cond: (c1 < 1000)
2537 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2546 ----------------------------------
2547 Bitmap Heap Scan on t1
2548 Recheck Cond: (c1 < 1000)
2549 -> Bitmap Index Scan on t1_i1
2550 Index Cond: (c1 < 1000)
2554 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2563 ----------------------------------
2564 Bitmap Heap Scan on t1
2565 Recheck Cond: (c1 < $1)
2566 -> Bitmap Index Scan on t1_i1
2567 Index Cond: (c1 < $1)
2570 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2572 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2581 ----------------------------------
2582 Bitmap Heap Scan on t1
2583 Recheck Cond: (c1 < $1)
2584 -> Bitmap Index Scan on t1_i1
2585 Index Cond: (c1 < $1)
2592 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2593 EXPLAIN (COSTS false) EXECUTE p1;
2602 --------------------
2607 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2608 EXPLAIN (COSTS false) EXECUTE p1;
2617 --------------------
2624 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2625 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2634 ----------------------------------
2635 Bitmap Heap Scan on t1
2636 Recheck Cond: (c1 < 1000)
2637 -> Bitmap Index Scan on t1_i1
2638 Index Cond: (c1 < 1000)
2641 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2650 ----------------------------------
2651 Bitmap Heap Scan on t1
2652 Recheck Cond: (c1 < 1000)
2653 -> Bitmap Index Scan on t1_i1
2654 Index Cond: (c1 < 1000)
2657 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2666 ----------------------------------
2667 Bitmap Heap Scan on t1
2668 Recheck Cond: (c1 < 1000)
2669 -> Bitmap Index Scan on t1_i1
2670 Index Cond: (c1 < 1000)
2673 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2682 ----------------------------------
2683 Bitmap Heap Scan on t1
2684 Recheck Cond: (c1 < 1000)
2685 -> Bitmap Index Scan on t1_i1
2686 Index Cond: (c1 < 1000)
2689 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2698 ----------------------------------
2699 Bitmap Heap Scan on t1
2700 Recheck Cond: (c1 < 1000)
2701 -> Bitmap Index Scan on t1_i1
2702 Index Cond: (c1 < 1000)
2705 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2714 ----------------------------------
2715 Bitmap Heap Scan on t1
2716 Recheck Cond: (c1 < $1)
2717 -> Bitmap Index Scan on t1_i1
2718 Index Cond: (c1 < $1)
2721 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2722 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2731 ----------------------------------
2732 Bitmap Heap Scan on t1
2733 Recheck Cond: (c1 < $1)
2734 -> Bitmap Index Scan on t1_i1
2735 Index Cond: (c1 < $1)
2741 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2743 EXPLAIN (COSTS false) EXECUTE p1;
2745 ------------------------------
2746 Index Scan using t1_i1 on t1
2747 Index Cond: (c1 = 1)
2750 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2752 EXPLAIN (COSTS false) EXECUTE p1;
2754 ------------------------------
2755 Index Scan using t1_i1 on t1
2756 Index Cond: (c1 = 1)
2760 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2762 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2764 -----------------------
2769 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2771 -----------------------
2776 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2778 -----------------------
2783 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2785 -----------------------
2790 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2792 -----------------------
2797 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2799 ---------------------
2804 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2806 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2808 ---------------------
2817 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2819 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2828 --------------------
2833 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2835 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2844 --------------------
2851 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2853 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2862 ----------------------------------
2863 Bitmap Heap Scan on t1
2864 Recheck Cond: (c1 < 1000)
2865 -> Bitmap Index Scan on t1_i1
2866 Index Cond: (c1 < 1000)
2870 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2879 ----------------------------------
2880 Bitmap Heap Scan on t1
2881 Recheck Cond: (c1 < 1000)
2882 -> Bitmap Index Scan on t1_i1
2883 Index Cond: (c1 < 1000)
2887 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2896 ----------------------------------
2897 Bitmap Heap Scan on t1
2898 Recheck Cond: (c1 < 1000)
2899 -> Bitmap Index Scan on t1_i1
2900 Index Cond: (c1 < 1000)
2904 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2913 ----------------------------------
2914 Bitmap Heap Scan on t1
2915 Recheck Cond: (c1 < 1000)
2916 -> Bitmap Index Scan on t1_i1
2917 Index Cond: (c1 < 1000)
2921 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2930 ----------------------------------
2931 Bitmap Heap Scan on t1
2932 Recheck Cond: (c1 < 1000)
2933 -> Bitmap Index Scan on t1_i1
2934 Index Cond: (c1 < 1000)
2938 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2947 ----------------------------------
2948 Bitmap Heap Scan on t1
2949 Recheck Cond: (c1 < $1)
2950 -> Bitmap Index Scan on t1_i1
2951 Index Cond: (c1 < $1)
2954 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2956 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2965 ----------------------------------
2966 Bitmap Heap Scan on t1
2967 Recheck Cond: (c1 < $1)
2968 -> Bitmap Index Scan on t1_i1
2969 Index Cond: (c1 < $1)
2976 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2977 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2986 --------------------
2991 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2992 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3001 --------------------
3008 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
3009 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3018 ----------------------------------
3019 Bitmap Heap Scan on t1
3020 Recheck Cond: (c1 < 1000)
3021 -> Bitmap Index Scan on t1_i1
3022 Index Cond: (c1 < 1000)
3025 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3034 ----------------------------------
3035 Bitmap Heap Scan on t1
3036 Recheck Cond: (c1 < 1000)
3037 -> Bitmap Index Scan on t1_i1
3038 Index Cond: (c1 < 1000)
3041 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3050 ----------------------------------
3051 Bitmap Heap Scan on t1
3052 Recheck Cond: (c1 < 1000)
3053 -> Bitmap Index Scan on t1_i1
3054 Index Cond: (c1 < 1000)
3057 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3066 ----------------------------------
3067 Bitmap Heap Scan on t1
3068 Recheck Cond: (c1 < 1000)
3069 -> Bitmap Index Scan on t1_i1
3070 Index Cond: (c1 < 1000)
3073 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3082 ----------------------------------
3083 Bitmap Heap Scan on t1
3084 Recheck Cond: (c1 < 1000)
3085 -> Bitmap Index Scan on t1_i1
3086 Index Cond: (c1 < 1000)
3089 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3098 ----------------------------------
3099 Bitmap Heap Scan on t1
3100 Recheck Cond: (c1 < $1)
3101 -> Bitmap Index Scan on t1_i1
3102 Index Cond: (c1 < $1)
3105 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3106 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3115 ----------------------------------
3116 Bitmap Heap Scan on t1
3117 Recheck Cond: (c1 < $1)
3118 -> Bitmap Index Scan on t1_i1
3119 Index Cond: (c1 < $1)
3125 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3127 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3129 ------------------------------
3130 Index Scan using t1_i1 on t1
3131 Index Cond: (c1 = 1)
3134 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3136 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3138 ------------------------------
3139 Index Scan using t1_i1 on t1
3140 Index Cond: (c1 = 1)
3144 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
3146 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3148 -----------------------
3154 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3156 -----------------------
3162 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3164 -----------------------
3170 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3172 -----------------------
3178 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3180 -----------------------
3186 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3188 ---------------------
3193 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3195 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3197 ---------------------
3204 ---- No. A-10-4 EXECUTE statement name error
3208 ERROR: prepared statement "p1" does not exist
3209 SHOW pg_hint_plan.debug_print;
3210 pg_hint_plan.debug_print
3211 --------------------------
3216 ---- No. A-11-5 EXECUTE statement name error
3219 SELECT pg_stat_statements_reset();
3220 pg_stat_statements_reset
3221 --------------------------
3225 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3231 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3234 Set(enable_seqscan off)
3244 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3257 SELECT s.query, s.calls
3258 FROM public.pg_stat_statements s
3259 JOIN pg_catalog.pg_database d
3263 --------------------------------------+-------
3264 SELECT * FROM s1.t1 WHERE t1.c1 = ?; | 3
3265 SELECT pg_stat_statements_reset(); | 1
3269 ---- No. A-12-1 reset of global variable of core at the error
3270 ---- No. A-12-2 reset of global variable of original at the error
3272 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3274 ------------------------------------
3276 Merge Cond: (t1.c1 = t2.c1)
3277 -> Index Scan using t1_i1 on t1
3283 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3284 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3285 EXPLAIN (COSTS false) EXECUTE p1;
3286 INFO: pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3287 DETAIL: Relation name "t1" is duplicated.
3292 Set(enable_seqscan off)
3293 Set(geqo_threshold 100)
3300 ------------------------------------
3302 Merge Cond: (t1.c1 = t2.c1)
3306 -> Index Scan using t2_i1 on t2
3311 SELECT name, setting FROM settings;
3313 ----------------------------+-----------
3316 geqo_generations | 0
3319 geqo_selection_bias | 2
3321 constraint_exclusion | partition
3322 cursor_tuple_fraction | 0.1
3323 default_statistics_target | 100
3324 force_parallel_mode | off
3325 from_collapse_limit | 8
3326 join_collapse_limit | 8
3327 cpu_index_tuple_cost | 0.005
3328 cpu_operator_cost | 0.0025
3329 cpu_tuple_cost | 0.01
3330 effective_cache_size | 16384
3331 min_parallel_relation_size | 1024
3332 parallel_setup_cost | 1000
3333 parallel_tuple_cost | 0.1
3334 random_page_cost | 4
3336 enable_bitmapscan | on
3338 enable_hashjoin | on
3339 enable_indexonlyscan | on
3340 enable_indexscan | on
3341 enable_material | on
3342 enable_mergejoin | on
3343 enable_nestloop | on
3347 client_min_messages | log
3350 SET pg_hint_plan.parse_messages TO error;
3351 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3352 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3353 ERROR: pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3354 DETAIL: Relation name "t1" is duplicated.
3355 SELECT name, setting FROM settings;
3357 ----------------------------+-----------
3360 geqo_generations | 0
3363 geqo_selection_bias | 2
3365 constraint_exclusion | partition
3366 cursor_tuple_fraction | 0.1
3367 default_statistics_target | 100
3368 force_parallel_mode | off
3369 from_collapse_limit | 8
3370 join_collapse_limit | 8
3371 cpu_index_tuple_cost | 0.005
3372 cpu_operator_cost | 0.0025
3373 cpu_tuple_cost | 0.01
3374 effective_cache_size | 16384
3375 min_parallel_relation_size | 1024
3376 parallel_setup_cost | 1000
3377 parallel_tuple_cost | 0.1
3378 random_page_cost | 4
3380 enable_bitmapscan | on
3382 enable_hashjoin | on
3383 enable_indexonlyscan | on
3384 enable_indexscan | on
3385 enable_material | on
3386 enable_mergejoin | on
3387 enable_nestloop | on
3391 client_min_messages | log
3394 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3395 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3400 Set(enable_seqscan off)
3401 Set(geqo_threshold 100)
3407 ------------------------------------
3409 Merge Cond: (t1.c1 = t2.c1)
3413 -> Index Scan using t2_i1 on t2
3418 SELECT name, setting FROM settings;
3420 ----------------------------+-----------
3423 geqo_generations | 0
3426 geqo_selection_bias | 2
3428 constraint_exclusion | partition
3429 cursor_tuple_fraction | 0.1
3430 default_statistics_target | 100
3431 force_parallel_mode | off
3432 from_collapse_limit | 8
3433 join_collapse_limit | 8
3434 cpu_index_tuple_cost | 0.005
3435 cpu_operator_cost | 0.0025
3436 cpu_tuple_cost | 0.01
3437 effective_cache_size | 16384
3438 min_parallel_relation_size | 1024
3439 parallel_setup_cost | 1000
3440 parallel_tuple_cost | 0.1
3441 random_page_cost | 4
3443 enable_bitmapscan | on
3445 enable_hashjoin | on
3446 enable_indexonlyscan | on
3447 enable_indexscan | on
3448 enable_material | on
3449 enable_mergejoin | on
3450 enable_nestloop | on
3454 client_min_messages | log
3457 SET pg_hint_plan.parse_messages TO error;
3458 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3459 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3460 ERROR: pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3461 DETAIL: Relation name "t1" is duplicated.
3462 SELECT name, setting FROM settings;
3464 ----------------------------+-----------
3467 geqo_generations | 0
3470 geqo_selection_bias | 2
3472 constraint_exclusion | partition
3473 cursor_tuple_fraction | 0.1
3474 default_statistics_target | 100
3475 force_parallel_mode | off
3476 from_collapse_limit | 8
3477 join_collapse_limit | 8
3478 cpu_index_tuple_cost | 0.005
3479 cpu_operator_cost | 0.0025
3480 cpu_tuple_cost | 0.01
3481 effective_cache_size | 16384
3482 min_parallel_relation_size | 1024
3483 parallel_setup_cost | 1000
3484 parallel_tuple_cost | 0.1
3485 random_page_cost | 4
3487 enable_bitmapscan | on
3489 enable_hashjoin | on
3490 enable_indexonlyscan | on
3491 enable_indexscan | on
3492 enable_material | on
3493 enable_mergejoin | on
3494 enable_nestloop | on
3498 client_min_messages | log
3501 EXPLAIN (COSTS false) EXECUTE p1;
3503 ------------------------------------
3505 Merge Cond: (t1.c1 = t2.c1)
3509 -> Index Scan using t2_i1 on t2
3514 SELECT name, setting FROM settings;
3516 ----------------------------+-----------
3519 geqo_generations | 0
3522 geqo_selection_bias | 2
3524 constraint_exclusion | partition
3525 cursor_tuple_fraction | 0.1
3526 default_statistics_target | 100
3527 force_parallel_mode | off
3528 from_collapse_limit | 8
3529 join_collapse_limit | 8
3530 cpu_index_tuple_cost | 0.005
3531 cpu_operator_cost | 0.0025
3532 cpu_tuple_cost | 0.01
3533 effective_cache_size | 16384
3534 min_parallel_relation_size | 1024
3535 parallel_setup_cost | 1000
3536 parallel_tuple_cost | 0.1
3537 random_page_cost | 4
3539 enable_bitmapscan | on
3541 enable_hashjoin | on
3542 enable_indexonlyscan | on
3543 enable_indexscan | on
3544 enable_material | on
3545 enable_mergejoin | on
3546 enable_nestloop | on
3550 client_min_messages | log
3553 SET pg_hint_plan.parse_messages TO error;
3554 EXPLAIN (COSTS false) EXECUTE p2;
3555 ERROR: prepared statement "p2" does not exist
3556 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3557 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3562 Set(enable_seqscan off)
3563 Set(geqo_threshold 100)
3569 ------------------------------------
3571 Merge Cond: (t1.c1 = t2.c1)
3575 -> Index Scan using t2_i1 on t2
3578 EXPLAIN (COSTS false) EXECUTE p1;
3580 ------------------------------------
3582 Merge Cond: (t1.c1 = t2.c1)
3586 -> Index Scan using t2_i1 on t2
3589 SELECT name, setting FROM settings;
3591 ----------------------------+-----------
3594 geqo_generations | 0
3597 geqo_selection_bias | 2
3599 constraint_exclusion | partition
3600 cursor_tuple_fraction | 0.1
3601 default_statistics_target | 100
3602 force_parallel_mode | off
3603 from_collapse_limit | 8
3604 join_collapse_limit | 8
3605 cpu_index_tuple_cost | 0.005
3606 cpu_operator_cost | 0.0025
3607 cpu_tuple_cost | 0.01
3608 effective_cache_size | 16384
3609 min_parallel_relation_size | 1024
3610 parallel_setup_cost | 1000
3611 parallel_tuple_cost | 0.1
3612 random_page_cost | 4
3614 enable_bitmapscan | on
3616 enable_hashjoin | on
3617 enable_indexonlyscan | on
3618 enable_indexscan | on
3619 enable_material | on
3620 enable_mergejoin | on
3621 enable_nestloop | on
3625 client_min_messages | log
3630 SELECT name, setting FROM settings;
3632 ----------------------------+-----------
3635 geqo_generations | 0
3638 geqo_selection_bias | 2
3640 constraint_exclusion | partition
3641 cursor_tuple_fraction | 0.1
3642 default_statistics_target | 100
3643 force_parallel_mode | off
3644 from_collapse_limit | 8
3645 join_collapse_limit | 8
3646 cpu_index_tuple_cost | 0.005
3647 cpu_operator_cost | 0.0025
3648 cpu_tuple_cost | 0.01
3649 effective_cache_size | 16384
3650 min_parallel_relation_size | 1024
3651 parallel_setup_cost | 1000
3652 parallel_tuple_cost | 0.1
3653 random_page_cost | 4
3655 enable_bitmapscan | on
3657 enable_hashjoin | on
3658 enable_indexonlyscan | on
3659 enable_indexscan | on
3660 enable_material | on
3661 enable_mergejoin | on
3662 enable_nestloop | on
3666 client_min_messages | log
3669 SET pg_hint_plan.parse_messages TO error;
3670 EXPLAIN (COSTS false) EXECUTE p2;
3671 ERROR: prepared statement "p2" does not exist
3672 EXPLAIN (COSTS false) EXECUTE p1;
3674 ------------------------------------
3676 Merge Cond: (t1.c1 = t2.c1)
3680 -> Index Scan using t2_i1 on t2
3683 SELECT name, setting FROM settings;
3685 ----------------------------+-----------
3688 geqo_generations | 0
3691 geqo_selection_bias | 2
3693 constraint_exclusion | partition
3694 cursor_tuple_fraction | 0.1
3695 default_statistics_target | 100
3696 force_parallel_mode | off
3697 from_collapse_limit | 8
3698 join_collapse_limit | 8
3699 cpu_index_tuple_cost | 0.005
3700 cpu_operator_cost | 0.0025
3701 cpu_tuple_cost | 0.01
3702 effective_cache_size | 16384
3703 min_parallel_relation_size | 1024
3704 parallel_setup_cost | 1000
3705 parallel_tuple_cost | 0.1
3706 random_page_cost | 4
3708 enable_bitmapscan | on
3710 enable_hashjoin | on
3711 enable_indexonlyscan | on
3712 enable_indexscan | on
3713 enable_material | on
3714 enable_mergejoin | on
3715 enable_nestloop | on
3719 client_min_messages | log
3723 SET pg_hint_plan.parse_messages TO LOG;
3725 ---- No. A-12-3 effective range of the hint
3727 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3729 ------------------------------------
3731 Merge Cond: (t1.c1 = t2.c1)
3732 -> Index Scan using t1_i1 on t1
3739 SET enable_indexscan TO off;
3740 SET enable_mergejoin TO off;
3741 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3743 ------------------------------
3745 Hash Cond: (t1.c1 = t2.c1)
3751 SELECT name, setting FROM settings;
3753 ----------------------------+-----------
3756 geqo_generations | 0
3759 geqo_selection_bias | 2
3761 constraint_exclusion | partition
3762 cursor_tuple_fraction | 0.1
3763 default_statistics_target | 100
3764 force_parallel_mode | off
3765 from_collapse_limit | 8
3766 join_collapse_limit | 8
3767 cpu_index_tuple_cost | 0.005
3768 cpu_operator_cost | 0.0025
3769 cpu_tuple_cost | 0.01
3770 effective_cache_size | 16384
3771 min_parallel_relation_size | 1024
3772 parallel_setup_cost | 1000
3773 parallel_tuple_cost | 0.1
3774 random_page_cost | 4
3776 enable_bitmapscan | on
3778 enable_hashjoin | on
3779 enable_indexonlyscan | on
3780 enable_indexscan | off
3781 enable_material | on
3782 enable_mergejoin | off
3783 enable_nestloop | on
3787 client_min_messages | log
3790 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3791 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3797 Set(enable_indexscan on)
3798 Set(geqo_threshold 100)
3804 ------------------------------------
3806 Merge Cond: (t1.c1 = t2.c1)
3807 -> Index Scan using t1_i1 on t1
3808 -> Index Scan using t2_i1 on t2
3811 SELECT name, setting FROM settings;
3813 ----------------------------+-----------
3816 geqo_generations | 0
3819 geqo_selection_bias | 2
3821 constraint_exclusion | partition
3822 cursor_tuple_fraction | 0.1
3823 default_statistics_target | 100
3824 force_parallel_mode | off
3825 from_collapse_limit | 8
3826 join_collapse_limit | 8
3827 cpu_index_tuple_cost | 0.005
3828 cpu_operator_cost | 0.0025
3829 cpu_tuple_cost | 0.01
3830 effective_cache_size | 16384
3831 min_parallel_relation_size | 1024
3832 parallel_setup_cost | 1000
3833 parallel_tuple_cost | 0.1
3834 random_page_cost | 4
3836 enable_bitmapscan | on
3838 enable_hashjoin | on
3839 enable_indexonlyscan | on
3840 enable_indexscan | off
3841 enable_material | on
3842 enable_mergejoin | off
3843 enable_nestloop | on
3847 client_min_messages | log
3850 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3852 ------------------------------
3854 Hash Cond: (t1.c1 = t2.c1)
3861 SET enable_indexscan TO off;
3862 SET enable_mergejoin TO off;
3863 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3865 ------------------------------
3867 Hash Cond: (t1.c1 = t2.c1)
3873 SELECT name, setting FROM settings;
3875 ----------------------------+-----------
3878 geqo_generations | 0
3881 geqo_selection_bias | 2
3883 constraint_exclusion | partition
3884 cursor_tuple_fraction | 0.1
3885 default_statistics_target | 100
3886 force_parallel_mode | off
3887 from_collapse_limit | 8
3888 join_collapse_limit | 8
3889 cpu_index_tuple_cost | 0.005
3890 cpu_operator_cost | 0.0025
3891 cpu_tuple_cost | 0.01
3892 effective_cache_size | 16384
3893 min_parallel_relation_size | 1024
3894 parallel_setup_cost | 1000
3895 parallel_tuple_cost | 0.1
3896 random_page_cost | 4
3898 enable_bitmapscan | on
3900 enable_hashjoin | on
3901 enable_indexonlyscan | on
3902 enable_indexscan | off
3903 enable_material | on
3904 enable_mergejoin | off
3905 enable_nestloop | on
3909 client_min_messages | log
3913 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3914 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3920 Set(enable_indexscan on)
3921 Set(geqo_threshold 100)
3927 ------------------------------------
3929 Merge Cond: (t1.c1 = t2.c1)
3930 -> Index Scan using t1_i1 on t1
3931 -> Index Scan using t2_i1 on t2
3936 SELECT name, setting FROM settings;
3938 ----------------------------+-----------
3941 geqo_generations | 0
3944 geqo_selection_bias | 2
3946 constraint_exclusion | partition
3947 cursor_tuple_fraction | 0.1
3948 default_statistics_target | 100
3949 force_parallel_mode | off
3950 from_collapse_limit | 8
3951 join_collapse_limit | 8
3952 cpu_index_tuple_cost | 0.005
3953 cpu_operator_cost | 0.0025
3954 cpu_tuple_cost | 0.01
3955 effective_cache_size | 16384
3956 min_parallel_relation_size | 1024
3957 parallel_setup_cost | 1000
3958 parallel_tuple_cost | 0.1
3959 random_page_cost | 4
3961 enable_bitmapscan | on
3963 enable_hashjoin | on
3964 enable_indexonlyscan | on
3965 enable_indexscan | off
3966 enable_material | on
3967 enable_mergejoin | off
3968 enable_nestloop | on
3972 client_min_messages | log
3975 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3977 ------------------------------
3979 Hash Cond: (t1.c1 = t2.c1)
3987 SET enable_indexscan TO off;
3988 SET enable_mergejoin TO off;
3989 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3991 ------------------------------
3993 Hash Cond: (t1.c1 = t2.c1)
3999 SELECT name, setting FROM settings;
4001 ----------------------------+-----------
4004 geqo_generations | 0
4007 geqo_selection_bias | 2
4009 constraint_exclusion | partition
4010 cursor_tuple_fraction | 0.1
4011 default_statistics_target | 100
4012 force_parallel_mode | off
4013 from_collapse_limit | 8
4014 join_collapse_limit | 8
4015 cpu_index_tuple_cost | 0.005
4016 cpu_operator_cost | 0.0025
4017 cpu_tuple_cost | 0.01
4018 effective_cache_size | 16384
4019 min_parallel_relation_size | 1024
4020 parallel_setup_cost | 1000
4021 parallel_tuple_cost | 0.1
4022 random_page_cost | 4
4024 enable_bitmapscan | on
4026 enable_hashjoin | on
4027 enable_indexonlyscan | on
4028 enable_indexscan | off
4029 enable_material | on
4030 enable_mergejoin | off
4031 enable_nestloop | on
4035 client_min_messages | log
4038 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4039 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4045 Set(enable_indexscan on)
4046 Set(geqo_threshold 100)
4052 ------------------------------------
4054 Merge Cond: (t1.c1 = t2.c1)
4055 -> Index Scan using t1_i1 on t1
4056 -> Index Scan using t2_i1 on t2
4060 SET enable_indexscan TO off;
4061 SET enable_mergejoin TO off;
4062 LOAD 'pg_hint_plan';
4063 SELECT name, setting FROM settings;
4065 ----------------------------+-----------
4068 geqo_generations | 0
4071 geqo_selection_bias | 2
4073 constraint_exclusion | partition
4074 cursor_tuple_fraction | 0.1
4075 default_statistics_target | 100
4076 force_parallel_mode | off
4077 from_collapse_limit | 8
4078 join_collapse_limit | 8
4079 cpu_index_tuple_cost | 0.005
4080 cpu_operator_cost | 0.0025
4081 cpu_tuple_cost | 0.01
4082 effective_cache_size | 16384
4083 min_parallel_relation_size | 1024
4084 parallel_setup_cost | 1000
4085 parallel_tuple_cost | 0.1
4086 random_page_cost | 4
4088 enable_bitmapscan | on
4090 enable_hashjoin | on
4091 enable_indexonlyscan | on
4092 enable_indexscan | off
4093 enable_material | on
4094 enable_mergejoin | off
4095 enable_nestloop | on
4099 client_min_messages | notice
4102 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4104 ------------------------------
4106 Hash Cond: (t1.c1 = t2.c1)
4112 SET pg_hint_plan.enable_hint TO on;
4113 SET pg_hint_plan.debug_print TO on;
4114 SET client_min_messages TO LOG;
4115 SET search_path TO public;
4116 RESET enable_indexscan;
4117 RESET enable_mergejoin;
4119 ---- No. A-13 call planner recursively
4121 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4125 RAISE NOTICE 'nested_planner(%)', cnt;
4132 SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4134 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4135 ORDER BY t_1.c1 LIMIT 1;
4139 $$ LANGUAGE plpgsql IMMUTABLE;
4141 ---- No. A-13-2 use hint of main query
4144 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4145 NOTICE: nested_planner(1)
4147 ---------------------------------------
4148 Index Only Scan using t1_i1 on t1 t_1
4152 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4153 NOTICE: nested_planner(1)
4162 --------------------------
4165 -> Seq Scan on t1 t_1
4169 ---- No. A-13-3 output number of times of debugging log
4172 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4173 NOTICE: nested_planner(1)
4175 ---------------------------------------
4176 Index Only Scan using t1_i1 on t1 t_1
4180 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4181 NOTICE: nested_planner(1)
4190 ---------------------------------------
4191 Index Only Scan using t1_i1 on t1 t_1
4195 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4196 NOTICE: nested_planner(2)
4197 NOTICE: nested_planner(1)
4206 ---------------------------------------
4207 Index Only Scan using t1_i1 on t1 t_1
4211 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4212 NOTICE: nested_planner(2)
4213 NOTICE: nested_planner(1)
4229 ---------------------------------------
4230 Index Only Scan using t1_i1 on t1 t_1
4235 -- Redefine not to use cached plan
4237 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4241 RAISE NOTICE 'nested_planner(%)', cnt;
4248 SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4250 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4251 ORDER BY t_1.c1 LIMIT 1;
4255 $$ LANGUAGE plpgsql IMMUTABLE;
4256 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4257 NOTICE: nested_planner(5)
4258 NOTICE: nested_planner(4)
4259 NOTICE: nested_planner(3)
4260 NOTICE: nested_planner(2)
4261 NOTICE: nested_planner(1)
4286 ---------------------------------------
4287 Index Only Scan using t1_i1 on t1 t_1
4291 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4292 NOTICE: nested_planner(5)
4293 NOTICE: nested_planner(4)
4294 NOTICE: nested_planner(3)
4295 NOTICE: nested_planner(2)
4296 NOTICE: nested_planner(1)
4333 ---------------------------------------
4334 Index Only Scan using t1_i1 on t1 t_1
4338 ---- No. A-13-4 output of debugging log on hint status
4340 CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
4341 SELECT /*+ IndexScan(t_1) */t_1.c1
4343 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4344 ORDER BY t_1.c1 LIMIT 1;
4345 $$ LANGUAGE SQL IMMUTABLE;
4347 /*+HashJoin(t_1 t_2)*/
4348 EXPLAIN (COSTS false)
4349 SELECT recall_planner() FROM s1.t1 t_1
4350 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4367 --------------------------------------
4371 Hash Cond: (t_1.c1 = t_2.c1)
4372 -> Seq Scan on t1 t_1
4374 -> Seq Scan on t2 t_2
4378 /*+HashJoin(st_1 st_2)*/
4379 EXPLAIN (COSTS false)
4380 SELECT recall_planner() FROM s1.t1 st_1
4381 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4398 ----------------------------------------
4402 Hash Cond: (st_1.c1 = st_2.c1)
4403 -> Seq Scan on t1 st_1
4405 -> Seq Scan on t2 st_2
4409 /*+HashJoin(t_1 t_2)*/
4410 EXPLAIN (COSTS false)
4411 SELECT recall_planner() FROM s1.t1 st_1
4412 JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4429 ----------------------------------------------
4431 Merge Cond: (st_1.c1 = st_2.c1)
4432 -> Index Only Scan using t1_i1 on t1 st_1
4435 -> Seq Scan on t2 st_2
4439 /*+HashJoin(st_1 st_2)*/
4440 EXPLAIN (COSTS false)
4441 SELECT recall_planner() FROM s1.t1 t_1
4442 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4459 ---------------------------------------------
4461 Merge Cond: (t_1.c1 = t_2.c1)
4462 -> Index Only Scan using t1_i1 on t1 t_1
4465 -> Seq Scan on t2 t_2
4469 /*+HashJoin(t_1 t_1)*/
4470 EXPLAIN (COSTS false)
4471 SELECT recall_planner() FROM s1.t1 t_1
4473 INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4474 DETAIL: Relation name "t_1" is duplicated.
4490 ---------------------------------------
4491 Index Only Scan using t1_i1 on t1 t_1
4495 CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
4496 SELECT /*+ IndexScan(t_1) */t_1.c1
4498 ORDER BY t_1.c1 LIMIT 1;
4499 $$ LANGUAGE SQL IMMUTABLE;
4500 EXPLAIN (COSTS false)
4501 SELECT recall_planner_one_t() FROM s1.t1 t_1
4502 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4505 ---------------------------------------------
4507 Merge Cond: (t_1.c1 = t_2.c1)
4508 -> Index Only Scan using t1_i1 on t1 t_1
4511 -> Seq Scan on t2 t_2
4514 /*+HashJoin(t_1 t_1)*/
4515 EXPLAIN (COSTS false)
4516 SELECT recall_planner_one_t() FROM s1.t1 t_1
4517 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4526 INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4527 DETAIL: Relation name "t_1" is duplicated.
4536 ---------------------------------------------
4538 Merge Cond: (t_1.c1 = t_2.c1)
4539 -> Index Only Scan using t1_i1 on t1 t_1
4542 -> Seq Scan on t2 t_2
4545 DROP FUNCTION recall_planner_one_t(int);
4546 ERROR: function recall_planner_one_t(integer) does not exist
4548 /*+HashJoin(t_1 t_1)*/
4549 EXPLAIN (COSTS false)
4550 SELECT recall_planner() FROM s1.t1 t_1
4551 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4553 INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4554 DETAIL: Relation name "t_1" is duplicated.
4562 INFO: pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4563 DETAIL: Relation name "t_1" is duplicated.
4572 ---------------------------------------------
4574 Merge Cond: (t_1.c1 = t_2.c1)
4575 -> Index Only Scan using t1_i1 on t1 t_1
4578 -> Seq Scan on t2 t_2
4582 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
4583 EXPLAIN (COSTS false)
4584 SELECT recall_planner() FROM s1.t1 t_1
4585 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4587 INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4588 DETAIL: Conflict join method hint.
4589 INFO: pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4590 DETAIL: Conflict join method hint.
4608 --------------------------------------
4612 Hash Cond: (t_1.c1 = t_2.c1)
4613 -> Seq Scan on t1 t_1
4615 -> Seq Scan on t2 t_2