2 SET pg_hint_plan.enable 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. J-3-4 hint state output
11 /*+Set(enable_indexscan off)NestLoop("")Set(enable_bitmapscan off)*/
12 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
13 INFO: hint syntax error at or near ")Set(enable_bitmapscan off)"
14 DETAIL: Relation name is necessary.
17 Set(enable_indexscan off)
23 ------------------------------------
24 Bitmap Heap Scan on t1
25 Recheck Cond: (c1 = 1)
26 -> Bitmap Index Scan on t1_pkey
31 ---- No. A-5-1 hint format
35 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
51 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
53 --------------------------------
54 Index Scan using t1_pkey on t1
60 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
62 --------------------------------
63 Index Scan using t1_pkey on t1
69 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
71 --------------------------------
72 Index Scan using t1_pkey on t1
78 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
80 --------------------------------
81 Index Scan using t1_pkey on t1
87 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
89 --------------------------------
90 Index Scan using t1_pkey on t1
95 /*+SeqScan(t1) /* nest comment */ */
96 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
97 INFO: hint syntax error at or near "/* nest comment */ */
98 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
99 DETAIL: Block comments nest doesn't supported.
101 --------------------------------
102 Index Scan using t1_pkey on t1
107 /* +SeqScan(t1) /* nest comment */ */
108 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
110 --------------------------------
111 Index Scan using t1_pkey on t1
116 /*SeqScan(t1) /* nest comment */ */
117 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
119 --------------------------------
120 Index Scan using t1_pkey on t1
125 ---- No. A-5-2 hint position
129 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
146 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
148 --------------------------------
149 Index Scan using t1_pkey on t1
154 EXPLAIN (COSTS false) SELECT /*+SeqScan(t1)*/ * FROM s1.t1 WHERE t1.c1 = 1;
156 --------------------------------
157 Index Scan using t1_pkey on t1
162 ---- No. A-5-4 hint delimiter
164 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
166 --------------------------------
167 Index Scan using t1_pkey on t1
178 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
179 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
182 Set(enable_bitmapscan off)
183 Set(enable_indexscan off)
195 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
196 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
199 Set(enable_bitmapscan off)
200 Set(enable_indexscan off)
212 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
213 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
216 Set(enable_bitmapscan off)
217 Set(enable_indexscan off)
229 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
230 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
233 Set(enable_bitmapscan off)
234 Set(enable_indexscan off)
246 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
247 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
250 Set(enable_bitmapscan off)
251 Set(enable_indexscan off)
263 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
264 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
267 Set(enable_bitmapscan off)
268 Set(enable_indexscan off)
280 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
281 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
284 Set(enable_bitmapscan off)
285 Set(enable_indexscan off)
297 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
298 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
301 Set(enable_bitmapscan off)
302 Set(enable_indexscan off)
314 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
315 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
318 Set(enable_bitmapscan off)
319 Set(enable_indexscan off)
331 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
332 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
335 Set(enable_bitmapscan off)
336 Set(enable_indexscan off)
348 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
349 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
352 Set(enable_bitmapscan off)
353 Set(enable_indexscan off)
365 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
366 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
369 Set(enable_bitmapscan off)
370 Set(enable_indexscan off)
382 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
383 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
386 Set(enable_bitmapscan off)
387 Set(enable_indexscan off)
399 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
400 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
403 Set(enable_bitmapscan off)
404 Set(enable_indexscan off)
416 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
417 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
420 Set(enable_bitmapscan off)
421 Set(enable_indexscan off)
434 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
435 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
438 Set(enable_bitmapscan off)
439 Set(enable_indexscan off)
451 /*+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)
471 (enable_indexscan"off")
473 (enable_bitmapscan"off")*/
474 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
477 Set(enable_bitmapscan off)
478 Set(enable_indexscan off)
492 enable_indexscan"off")Set
494 enable_bitmapscan"off")*/
495 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
498 Set(enable_bitmapscan off)
499 Set(enable_indexscan off)
511 /*+Set(enable_indexscan"off"
513 Set(enable_bitmapscan"off"
516 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
519 Set(enable_bitmapscan off)
520 Set(enable_indexscan off)
539 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
542 Set(enable_bitmapscan off)
543 Set(enable_indexscan off)
567 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
570 Set(enable_bitmapscan off)
571 Set(enable_indexscan off)
584 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
585 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
588 Set(enable_bitmapscan off)
589 Set(enable_indexscan off)
601 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
603 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
606 Set(enable_bitmapscan off)
607 Set(enable_indexscan off)
621 (enable_indexscan"off")
623 (enable_bitmapscan"off")*/
624 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
627 Set(enable_bitmapscan off)
628 Set(enable_indexscan off)
642 enable_indexscan"off")Set
644 enable_bitmapscan"off")*/
645 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
648 Set(enable_bitmapscan off)
649 Set(enable_indexscan off)
661 /*+Set(enable_indexscan"off"
663 Set(enable_bitmapscan"off"
666 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
669 Set(enable_bitmapscan off)
670 Set(enable_indexscan off)
689 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
692 Set(enable_bitmapscan off)
693 Set(enable_indexscan off)
717 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
720 Set(enable_bitmapscan off)
721 Set(enable_indexscan off)
733 ---- No. A-5-5 hint object pattern
734 ---- No. A-7-2 message object pattern
739 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
754 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
769 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
784 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
801 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
816 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
825 ----------------------
831 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
846 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
855 ----------------------
863 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
878 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(((" WHERE "(((".c1 = 1;
887 ----------------------
893 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
908 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(((" WHERE "(((".c1 = 1;
917 ----------------------
925 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
926 INFO: hint syntax error at or near "))"
927 DETAIL: Relation name is necessary.
929 ------------------------------------
930 Index Scan using t1_pkey on t1 ")"
935 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
950 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
959 ----------------------
967 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
968 INFO: hint syntax error at or near ""
969 DETAIL: Unterminated quoted relation name.
971 -------------------------------------
972 Index Scan using t1_pkey on t1 """"
977 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
986 ---------------------
991 /*+SeqScan("""""""")*/
992 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
1001 -------------------------
1002 Seq Scan on t1 """"""""
1009 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1010 INFO: hint syntax error at or near ")"
1011 DETAIL: Relation name is necessary.
1013 ------------------------------------
1014 Index Scan using t1_pkey on t1 " "
1015 Index Cond: (c1 = 1)
1019 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1028 --------------------
1034 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1043 ----------------------
1051 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1052 INFO: hint syntax error at or near ")"
1053 DETAIL: Relation name is necessary.
1055 -------------------------------------------
1056 Index Scan using t1_pkey on t1 " "
1057 Index Cond: (c1 = 1)
1061 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1070 ---------------------------
1076 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1085 -------------------------------------------
1094 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1097 INFO: hint syntax error at or near ")"
1098 DETAIL: Relation name is necessary.
1100 ----------------------------------
1101 Index Scan using t1_pkey on t1 "
1103 Index Cond: (c1 = 1)
1108 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1120 --------------------
1130 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1148 --------------------
1159 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1168 ----------------------
1169 Seq Scan on t1 "Set"
1174 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1183 ----------------------
1184 Seq Scan on t1 "Set"
1188 /*+SeqScan("Set SeqScan Leading")*/
1189 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
1192 SeqScan("Set SeqScan Leading")
1198 --------------------------------------
1199 Seq Scan on t1 "Set SeqScan Leading"
1206 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1215 ---------------------
1221 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1230 -------------------------
1231 Seq Scan on t1 "あいう"
1236 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1245 ---------------------
1251 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1260 -------------------------
1261 Seq Scan on t1 "あいう"
1268 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
1269 INFO: hint syntax error at or near "/**/)*/
1270 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
1271 DETAIL: Block comments nest doesn't supported.
1273 ---------------------------------------
1274 Index Scan using t1_pkey on t1 "/**/"
1275 Index Cond: (c1 = 1)
1278 /*+SeqScan(/**//**//**/)*/
1279 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
1280 INFO: hint syntax error at or near "/**//**//**/)*/
1281 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
1282 DETAIL: Block comments nest doesn't supported.
1284 -----------------------------------------------
1285 Index Scan using t1_pkey on t1 "/**//**//**/"
1286 Index Cond: (c1 = 1)
1293 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1294 Set/**/あ" WHERE "tT()""
1296 INFO: hint syntax error at or near "/**/あ")*/
1297 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1298 Set/**/あ" WHERE "tT()""
1300 DETAIL: Block comments nest doesn't supported.
1302 ------------------------------------------
1303 Index Scan using t1_pkey on t1 "tT()""
1305 Index Cond: (c1 = 1)
1311 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1323 --------------------------
1324 Seq Scan on t1 "tT()""
1330 ---- No. A-5-6 hint parse error
1333 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1334 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1335 INFO: hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1336 DETAIL: Opened parenthesis is necessary.
1339 Set(enable_indexscan off)
1345 ------------------------------------
1346 Bitmap Heap Scan on t1
1347 Recheck Cond: (c1 = 1)
1348 -> Bitmap Index Scan on t1_pkey
1349 Index Cond: (c1 = 1)
1353 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
1354 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1355 INFO: hint syntax error at or near "Set(enable_bitmapscan off)SeqScan(t1)"
1356 DETAIL: Closed parenthesis is necessary.
1359 Set(enable_indexscan off)
1365 ------------------------------------
1366 Bitmap Heap Scan on t1
1367 Recheck Cond: (c1 = 1)
1368 -> Bitmap Index Scan on t1_pkey
1369 Index Cond: (c1 = 1)
1373 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
1374 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1375 INFO: hint syntax error at or near ""
1376 DETAIL: Unterminated quoted parameter value.
1379 Set(enable_indexscan off)
1385 ------------------------------------
1386 Bitmap Heap Scan on t1
1387 Recheck Cond: (c1 = 1)
1388 -> Bitmap Index Scan on t1_pkey
1389 Index Cond: (c1 = 1)
1393 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
1394 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1395 INFO: hint syntax error at or near ")Set(enable_bitmapscan off)"
1396 DETAIL: Relation name is necessary.
1399 Set(enable_indexscan off)
1405 ------------------------------------
1406 Bitmap Heap Scan on t1
1407 Recheck Cond: (c1 = 1)
1408 -> Bitmap Index Scan on t1_pkey
1409 Index Cond: (c1 = 1)
1413 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1414 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1415 INFO: hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1416 DETAIL: Keyword "NoSet" does not exist.
1419 Set(enable_indexscan off)
1425 ------------------------------------
1426 Bitmap Heap Scan on t1
1427 Recheck Cond: (c1 = 1)
1428 -> Bitmap Index Scan on t1_pkey
1429 Index Cond: (c1 = 1)
1433 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1434 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1435 INFO: hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1436 DETAIL: Keyword ""Set"" does not exist.
1439 Set(enable_indexscan off)
1445 ------------------------------------
1446 Bitmap Heap Scan on t1
1447 Recheck Cond: (c1 = 1)
1448 -> Bitmap Index Scan on t1_pkey
1449 Index Cond: (c1 = 1)
1453 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1454 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1455 INFO: hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1456 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
1457 DETAIL: Block comments nest doesn't supported.
1459 --------------------------------
1460 Index Scan using t1_pkey on t1
1461 Index Cond: (c1 = 1)
1465 ---- No. A-6-1 original GUC parameter
1468 SET ROLE super_user;
1469 SET pg_hint_plan.debug_print TO off;
1470 SHOW pg_hint_plan.enable;
1472 ---------------------
1476 SHOW pg_hint_plan.debug_print;
1477 pg_hint_plan.debug_print
1478 --------------------------
1482 SHOW pg_hint_plan.parse_messages;
1483 pg_hint_plan.parse_messages
1484 -----------------------------
1488 SET pg_hint_plan.enable TO off;
1489 SET pg_hint_plan.debug_print TO on;
1490 SET pg_hint_plan.parse_messages TO error;
1491 SHOW pg_hint_plan.enable;
1493 ---------------------
1497 SHOW pg_hint_plan.debug_print;
1498 pg_hint_plan.debug_print
1499 --------------------------
1503 SHOW pg_hint_plan.parse_messages;
1504 pg_hint_plan.parse_messages
1505 -----------------------------
1509 RESET pg_hint_plan.enable;
1510 RESET pg_hint_plan.debug_print;
1511 RESET pg_hint_plan.parse_messages;
1512 SHOW pg_hint_plan.enable;
1514 ---------------------
1518 SHOW pg_hint_plan.debug_print;
1519 pg_hint_plan.debug_print
1520 --------------------------
1524 SHOW pg_hint_plan.parse_messages;
1525 pg_hint_plan.parse_messages
1526 -----------------------------
1531 SET ROLE normal_user;
1532 SHOW pg_hint_plan.enable;
1534 ---------------------
1538 SHOW pg_hint_plan.debug_print;
1539 pg_hint_plan.debug_print
1540 --------------------------
1544 SHOW pg_hint_plan.parse_messages;
1545 pg_hint_plan.parse_messages
1546 -----------------------------
1550 SET pg_hint_plan.enable TO off;
1551 SET pg_hint_plan.debug_print TO on;
1552 SET pg_hint_plan.parse_messages TO error;
1553 SHOW pg_hint_plan.enable;
1555 ---------------------
1559 SHOW pg_hint_plan.debug_print;
1560 pg_hint_plan.debug_print
1561 --------------------------
1565 SHOW pg_hint_plan.parse_messages;
1566 pg_hint_plan.parse_messages
1567 -----------------------------
1571 RESET pg_hint_plan.enable;
1572 RESET pg_hint_plan.debug_print;
1573 RESET pg_hint_plan.parse_messages;
1574 SHOW pg_hint_plan.enable;
1576 ---------------------
1580 SHOW pg_hint_plan.debug_print;
1581 pg_hint_plan.debug_print
1582 --------------------------
1586 SHOW pg_hint_plan.parse_messages;
1587 pg_hint_plan.parse_messages
1588 -----------------------------
1594 ---- No. A-6-2 original GUC parameter pg_hint_plan.enable
1597 SET pg_hint_plan.enable TO on;
1598 SHOW pg_hint_plan.enable;
1600 ---------------------
1604 /*+Set(enable_indexscan off)*/
1605 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1607 ------------------------------------
1608 Bitmap Heap Scan on t1
1609 Recheck Cond: (c1 = 1)
1610 -> Bitmap Index Scan on t1_pkey
1611 Index Cond: (c1 = 1)
1615 SET pg_hint_plan.enable TO off;
1616 SHOW pg_hint_plan.enable;
1618 ---------------------
1622 /*+Set(enable_indexscan off)*/
1623 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1625 --------------------------------
1626 Index Scan using t1_pkey on t1
1627 Index Cond: (c1 = 1)
1631 SET pg_hint_plan.enable TO DEFAULT;
1632 SHOW pg_hint_plan.enable;
1634 ---------------------
1638 /*+Set(enable_indexscan off)*/
1639 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1641 ------------------------------------
1642 Bitmap Heap Scan on t1
1643 Recheck Cond: (c1 = 1)
1644 -> Bitmap Index Scan on t1_pkey
1645 Index Cond: (c1 = 1)
1649 SET pg_hint_plan.enable TO enable;
1650 ERROR: parameter "pg_hint_plan.enable" requires a Boolean value
1651 SHOW pg_hint_plan.enable;
1653 ---------------------
1658 ---- No. A-6-3 original GUC parameter pg_hint_plan.debug_print
1661 SET pg_hint_plan.debug_print TO on;
1662 SHOW pg_hint_plan.debug_print;
1663 pg_hint_plan.debug_print
1664 --------------------------
1668 /*+Set(enable_indexscan off)*/
1669 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1672 Set(enable_indexscan off)
1678 ------------------------------------
1679 Bitmap Heap Scan on t1
1680 Recheck Cond: (c1 = 1)
1681 -> Bitmap Index Scan on t1_pkey
1682 Index Cond: (c1 = 1)
1686 SET pg_hint_plan.debug_print TO off;
1687 SHOW pg_hint_plan.debug_print;
1688 pg_hint_plan.debug_print
1689 --------------------------
1693 /*+Set(enable_indexscan off)*/
1694 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1696 ------------------------------------
1697 Bitmap Heap Scan on t1
1698 Recheck Cond: (c1 = 1)
1699 -> Bitmap Index Scan on t1_pkey
1700 Index Cond: (c1 = 1)
1704 SET pg_hint_plan.debug_print TO DEFAULT;
1705 SHOW pg_hint_plan.debug_print;
1706 pg_hint_plan.debug_print
1707 --------------------------
1711 /*+Set(enable_indexscan off)*/
1712 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1714 ------------------------------------
1715 Bitmap Heap Scan on t1
1716 Recheck Cond: (c1 = 1)
1717 -> Bitmap Index Scan on t1_pkey
1718 Index Cond: (c1 = 1)
1722 SET pg_hint_plan.debug_print TO enable;
1723 ERROR: parameter "pg_hint_plan.debug_print" requires a Boolean value
1724 SHOW pg_hint_plan.debug_print;
1725 pg_hint_plan.debug_print
1726 --------------------------
1731 ---- No. A-6-4 original GUC parameter pg_hint_plan.parse_messages
1733 SET client_min_messages TO debug5;
1734 DEBUG: CommitTransactionCommand
1735 DEBUG: CommitTransaction
1736 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1738 SET pg_hint_plan.parse_messages TO debug5;
1739 DEBUG: StartTransactionCommand
1740 DEBUG: StartTransaction
1741 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1742 DEBUG: ProcessUtility
1743 DEBUG: CommitTransactionCommand
1744 DEBUG: CommitTransaction
1745 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1746 SHOW pg_hint_plan.parse_messages;
1747 DEBUG: StartTransactionCommand
1748 DEBUG: StartTransaction
1749 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1750 DEBUG: ProcessUtility
1751 DEBUG: CommitTransactionCommand
1752 DEBUG: CommitTransaction
1753 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1754 pg_hint_plan.parse_messages
1755 -----------------------------
1760 DEBUG: StartTransactionCommand
1761 DEBUG: StartTransaction
1762 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1763 DEBUG: hint syntax error at or near ""
1764 DETAIL: Opened parenthesis is necessary.
1765 DEBUG: CommitTransactionCommand
1766 DEBUG: CommitTransaction
1767 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1773 SET client_min_messages TO debug4;
1774 DEBUG: StartTransactionCommand
1775 DEBUG: StartTransaction
1776 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1777 DEBUG: ProcessUtility
1778 DEBUG: CommitTransactionCommand
1779 DEBUG: CommitTransaction
1780 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1782 DEBUG: StartTransactionCommand
1783 DEBUG: StartTransaction
1784 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1785 DEBUG: CommitTransactionCommand
1786 DEBUG: CommitTransaction
1787 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1794 SET pg_hint_plan.parse_messages TO debug4;
1795 DEBUG: StartTransactionCommand
1796 DEBUG: StartTransaction
1797 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1798 DEBUG: ProcessUtility
1799 DEBUG: CommitTransactionCommand
1800 DEBUG: CommitTransaction
1801 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1802 SHOW pg_hint_plan.parse_messages;
1803 DEBUG: StartTransactionCommand
1804 DEBUG: StartTransaction
1805 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1806 DEBUG: ProcessUtility
1807 DEBUG: CommitTransactionCommand
1808 DEBUG: CommitTransaction
1809 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1810 pg_hint_plan.parse_messages
1811 -----------------------------
1816 DEBUG: StartTransactionCommand
1817 DEBUG: StartTransaction
1818 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1819 DEBUG: hint syntax error at or near ""
1820 DETAIL: Opened parenthesis is necessary.
1821 DEBUG: CommitTransactionCommand
1822 DEBUG: CommitTransaction
1823 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1829 SET client_min_messages TO debug3;
1830 DEBUG: StartTransactionCommand
1831 DEBUG: StartTransaction
1832 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1833 DEBUG: ProcessUtility
1834 DEBUG: CommitTransactionCommand
1835 DEBUG: CommitTransaction
1836 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1838 DEBUG: StartTransactionCommand
1839 DEBUG: StartTransaction
1840 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1841 DEBUG: CommitTransactionCommand
1842 DEBUG: CommitTransaction
1843 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1850 SET pg_hint_plan.parse_messages TO debug3;
1851 DEBUG: StartTransactionCommand
1852 DEBUG: StartTransaction
1853 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1854 DEBUG: ProcessUtility
1855 DEBUG: CommitTransactionCommand
1856 DEBUG: CommitTransaction
1857 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1858 SHOW pg_hint_plan.parse_messages;
1859 DEBUG: StartTransactionCommand
1860 DEBUG: StartTransaction
1861 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1862 DEBUG: ProcessUtility
1863 DEBUG: CommitTransactionCommand
1864 DEBUG: CommitTransaction
1865 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1866 pg_hint_plan.parse_messages
1867 -----------------------------
1872 DEBUG: StartTransactionCommand
1873 DEBUG: StartTransaction
1874 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1875 DEBUG: hint syntax error at or near ""
1876 DETAIL: Opened parenthesis is necessary.
1877 DEBUG: CommitTransactionCommand
1878 DEBUG: CommitTransaction
1879 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1885 SET client_min_messages TO debug2;
1886 DEBUG: StartTransactionCommand
1887 DEBUG: StartTransaction
1888 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1889 DEBUG: ProcessUtility
1897 SET pg_hint_plan.parse_messages TO debug2;
1898 SHOW pg_hint_plan.parse_messages;
1899 pg_hint_plan.parse_messages
1900 -----------------------------
1905 DEBUG: hint syntax error at or near ""
1906 DETAIL: Opened parenthesis is necessary.
1912 SET client_min_messages TO debug1;
1920 SET pg_hint_plan.parse_messages TO debug1;
1921 SHOW pg_hint_plan.parse_messages;
1922 pg_hint_plan.parse_messages
1923 -----------------------------
1928 DEBUG: hint syntax error at or near ""
1929 DETAIL: Opened parenthesis is necessary.
1935 SET client_min_messages TO log;
1943 SET pg_hint_plan.parse_messages TO log;
1944 SHOW pg_hint_plan.parse_messages;
1945 pg_hint_plan.parse_messages
1946 -----------------------------
1951 LOG: hint syntax error at or near ""
1952 DETAIL: Opened parenthesis is necessary.
1958 SET client_min_messages TO info;
1966 SET pg_hint_plan.parse_messages TO info;
1967 SHOW pg_hint_plan.parse_messages;
1968 pg_hint_plan.parse_messages
1969 -----------------------------
1974 INFO: hint syntax error at or near ""
1975 DETAIL: Opened parenthesis is necessary.
1981 SET client_min_messages TO notice;
1983 INFO: hint syntax error at or near ""
1984 DETAIL: Opened parenthesis is necessary.
1991 SET pg_hint_plan.parse_messages TO notice;
1992 SHOW pg_hint_plan.parse_messages;
1993 pg_hint_plan.parse_messages
1994 -----------------------------
1999 NOTICE: hint syntax error at or near ""
2000 DETAIL: Opened parenthesis is necessary.
2006 SET client_min_messages TO warning;
2014 SET pg_hint_plan.parse_messages TO warning;
2015 SHOW pg_hint_plan.parse_messages;
2016 pg_hint_plan.parse_messages
2017 -----------------------------
2022 WARNING: hint syntax error at or near ""
2023 DETAIL: Opened parenthesis is necessary.
2029 SET client_min_messages TO error;
2037 SET pg_hint_plan.parse_messages TO error;
2038 SHOW pg_hint_plan.parse_messages;
2039 pg_hint_plan.parse_messages
2040 -----------------------------
2045 ERROR: hint syntax error at or near ""
2046 DETAIL: Opened parenthesis is necessary.
2047 SET client_min_messages TO fatal;
2050 RESET client_min_messages;
2051 SET pg_hint_plan.parse_messages TO DEFAULT;
2052 SHOW pg_hint_plan.parse_messages;
2053 pg_hint_plan.parse_messages
2054 -----------------------------
2059 INFO: hint syntax error at or near ""
2060 DETAIL: Opened parenthesis is necessary.
2067 SET pg_hint_plan.parse_messages TO fatal;
2068 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2069 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2070 SHOW pg_hint_plan.parse_messages;
2071 pg_hint_plan.parse_messages
2072 -----------------------------
2077 SET pg_hint_plan.parse_messages TO panic;
2078 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2079 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2080 SHOW pg_hint_plan.parse_messages;
2081 pg_hint_plan.parse_messages
2082 -----------------------------
2087 SET pg_hint_plan.parse_messages TO on;
2088 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "on"
2089 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2090 SHOW pg_hint_plan.parse_messages;
2091 pg_hint_plan.parse_messages
2092 -----------------------------
2097 ---- No. A-7-1 parse error message output
2100 /*+"Set"(enable_indexscan on)*/SELECT 1;
2101 INFO: hint syntax error at or near ""Set"(enable_indexscan on)"
2102 DETAIL: Keyword ""Set"" does not exist.
2108 /*+Set()(enable_indexscan on)*/SELECT 1;
2109 INFO: hint syntax error at or near ")(enable_indexscan on)"
2110 DETAIL: Parameter name is necessary.
2116 /*+Set(enable_indexscan on*/SELECT 1;
2117 INFO: hint syntax error at or near ""
2118 DETAIL: Closed parenthesis is necessary.
2125 ---- No. A-7-3 hint state output
2127 SET pg_hint_plan.debug_print TO on;
2128 SET client_min_messages TO LOG;
2131 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2140 --------------------
2146 /*+SeqScan(no_table)*/
2147 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2156 --------------------------------
2157 Index Scan using t1_pkey on t1
2158 Index Cond: (c1 = 1)
2162 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2164 -----------------------------------
2166 TID Cond: (ctid = '(1,1)'::tid)
2170 /*+TidScan(t1)BitmapScan(t1)*/
2171 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2172 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2173 DETAIL: Conflict scan method hint.
2183 ------------------------------------
2184 Bitmap Heap Scan on t1
2185 Recheck Cond: (c1 = 1)
2186 Filter: (ctid = '(1,1)'::tid)
2187 -> Bitmap Index Scan on t1_pkey
2188 Index Cond: (c1 = 1)
2191 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2192 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2193 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2194 DETAIL: Conflict scan method hint.
2195 INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2196 DETAIL: Conflict scan method hint.
2207 ---------------------------------
2208 Index Scan using t1_pkey on t1
2209 Index Cond: (c1 = 1)
2210 Filter: (ctid = '(1,1)'::tid)
2213 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2214 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2215 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2216 DETAIL: Conflict scan method hint.
2217 INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2218 DETAIL: Conflict scan method hint.
2219 INFO: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2220 DETAIL: Conflict scan method hint.
2232 ------------------------------------------------
2234 Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2238 /*+Set(enable_indexscan enable)*/
2239 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2240 INFO: parameter "enable_indexscan" requires a Boolean value
2246 Set(enable_indexscan enable)
2249 --------------------------------
2250 Index Scan using t1_pkey on t1
2251 Index Cond: (c1 = 1)
2255 ---- No. A-8-1 hint state output
2257 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2258 EXPLAIN (COSTS false) EXECUTE p1;
2260 --------------------------------
2261 Index Scan using t1_pkey on t1
2262 Index Cond: (c1 = 1)
2266 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2267 EXPLAIN (COSTS false) EXECUTE p1 (1);
2269 ---------------------
2278 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2287 EXPLAIN (COSTS false) EXECUTE p1;
2289 --------------------
2294 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2296 EXPLAIN (COSTS false) EXECUTE p1;
2305 --------------------
2312 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2321 EXPLAIN (COSTS false) EXECUTE p1 (1);
2323 ------------------------------------
2324 Bitmap Heap Scan on t1
2325 Recheck Cond: (c1 < $1)
2326 -> Bitmap Index Scan on t1_pkey
2327 Index Cond: (c1 < $1)
2330 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2332 EXPLAIN (COSTS false) EXECUTE p1 (1);
2341 ------------------------------------
2342 Bitmap Heap Scan on t1
2343 Recheck Cond: (c1 < $1)
2344 -> Bitmap Index Scan on t1_pkey
2345 Index Cond: (c1 < $1)
2352 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2360 EXPLAIN (COSTS false) EXECUTE p1;
2362 --------------------
2367 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2368 EXPLAIN (COSTS false) EXECUTE p1;
2377 --------------------
2384 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2392 EXPLAIN (COSTS false) EXECUTE p1 (1);
2394 ------------------------------------
2395 Bitmap Heap Scan on t1
2396 Recheck Cond: (c1 < $1)
2397 -> Bitmap Index Scan on t1_pkey
2398 Index Cond: (c1 < $1)
2401 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2402 EXPLAIN (COSTS false) EXECUTE p1 (1);
2411 ------------------------------------
2412 Bitmap Heap Scan on t1
2413 Recheck Cond: (c1 < $1)
2414 -> Bitmap Index Scan on t1_pkey
2415 Index Cond: (c1 < $1)
2421 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2423 EXPLAIN (COSTS false) EXECUTE p1;
2425 --------------------------------
2426 Index Scan using t1_pkey on t1
2427 Index Cond: (c1 = 1)
2430 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2432 EXPLAIN (COSTS false) EXECUTE p1;
2434 --------------------------------
2435 Index Scan using t1_pkey on t1
2436 Index Cond: (c1 = 1)
2440 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2442 EXPLAIN (COSTS false) EXECUTE p1 (1);
2444 ---------------------
2449 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2451 EXPLAIN (COSTS false) EXECUTE p1 (1);
2453 ---------------------
2460 ---- No. A-8-4 EXECUTE statement name error
2464 ERROR: prepared statement "p1" does not exist
2465 SHOW pg_hint_plan.debug_print;
2466 pg_hint_plan.debug_print
2467 --------------------------
2472 ---- No. A-9-5 EXECUTE statement name error
2475 CREATE EXTENSION pg_stat_statements;
2476 SELECT pg_stat_statements_reset();
2477 pg_stat_statements_reset
2478 --------------------------
2482 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2488 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2491 Set(enable_seqscan off)
2501 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2514 SELECT s.query, s.calls
2515 FROM public.pg_stat_statements s
2516 JOIN pg_catalog.pg_database d
2520 -------------------------------------------------------------------+-------
2521 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2522 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2523 SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2524 SELECT pg_stat_statements_reset(); | 1
2528 ---- No. A-12-1 reset of global variable of core at the error
2529 ---- No. A-12-2 reset of global variable of original at the error
2531 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2533 --------------------------------------
2535 Merge Cond: (t1.c1 = t2.c1)
2536 -> Index Scan using t1_pkey on t1
2542 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
2543 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2544 INFO: hint syntax error at or near "NestLoop(t1 t1)"
2545 DETAIL: Relation name "t1" is duplicate.
2550 Set(enable_seqscan off)
2551 Set(geqo_threshold 100)
2557 EXPLAIN (COSTS false) EXECUTE p1;
2559 --------------------------------------
2561 Merge Cond: (t1.c1 = t2.c1)
2565 -> Index Scan using t2_pkey on t2
2570 SELECT name, setting FROM settings;
2572 ---------------------------+-----------
2575 geqo_generations | 0
2578 geqo_selection_bias | 2
2580 constraint_exclusion | partition
2581 cursor_tuple_fraction | 0.1
2582 default_statistics_target | 100
2583 from_collapse_limit | 8
2584 join_collapse_limit | 8
2585 cpu_index_tuple_cost | 0.005
2586 cpu_operator_cost | 0.0025
2587 cpu_tuple_cost | 0.01
2588 effective_cache_size | 16384
2589 random_page_cost | 4
2591 enable_bitmapscan | on
2593 enable_hashjoin | on
2594 enable_indexscan | on
2595 enable_material | on
2596 enable_mergejoin | on
2597 enable_nestloop | on
2601 client_min_messages | log
2604 SET pg_hint_plan.parse_messages TO error;
2605 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
2606 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2607 ERROR: hint syntax error at or near "NestLoop(t1 t1)"
2608 DETAIL: Relation name "t1" is duplicate.
2609 SELECT name, setting FROM settings;
2611 ---------------------------+-----------
2614 geqo_generations | 0
2617 geqo_selection_bias | 2
2619 constraint_exclusion | partition
2620 cursor_tuple_fraction | 0.1
2621 default_statistics_target | 100
2622 from_collapse_limit | 8
2623 join_collapse_limit | 8
2624 cpu_index_tuple_cost | 0.005
2625 cpu_operator_cost | 0.0025
2626 cpu_tuple_cost | 0.01
2627 effective_cache_size | 16384
2628 random_page_cost | 4
2630 enable_bitmapscan | on
2632 enable_hashjoin | on
2633 enable_indexscan | on
2634 enable_material | on
2635 enable_mergejoin | on
2636 enable_nestloop | on
2640 client_min_messages | log
2643 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
2644 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2649 Set(enable_seqscan off)
2650 Set(geqo_threshold 100)
2656 --------------------------------------
2658 Merge Cond: (t1.c1 = t2.c1)
2662 -> Index Scan using t2_pkey on t2
2667 SELECT name, setting FROM settings;
2669 ---------------------------+-----------
2672 geqo_generations | 0
2675 geqo_selection_bias | 2
2677 constraint_exclusion | partition
2678 cursor_tuple_fraction | 0.1
2679 default_statistics_target | 100
2680 from_collapse_limit | 8
2681 join_collapse_limit | 8
2682 cpu_index_tuple_cost | 0.005
2683 cpu_operator_cost | 0.0025
2684 cpu_tuple_cost | 0.01
2685 effective_cache_size | 16384
2686 random_page_cost | 4
2688 enable_bitmapscan | on
2690 enable_hashjoin | on
2691 enable_indexscan | on
2692 enable_material | on
2693 enable_mergejoin | on
2694 enable_nestloop | on
2698 client_min_messages | log
2701 SET pg_hint_plan.parse_messages TO error;
2702 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
2703 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2704 ERROR: hint syntax error at or near "NestLoop(t1 t1)"
2705 DETAIL: Relation name "t1" is duplicate.
2706 SELECT name, setting FROM settings;
2708 ---------------------------+-----------
2711 geqo_generations | 0
2714 geqo_selection_bias | 2
2716 constraint_exclusion | partition
2717 cursor_tuple_fraction | 0.1
2718 default_statistics_target | 100
2719 from_collapse_limit | 8
2720 join_collapse_limit | 8
2721 cpu_index_tuple_cost | 0.005
2722 cpu_operator_cost | 0.0025
2723 cpu_tuple_cost | 0.01
2724 effective_cache_size | 16384
2725 random_page_cost | 4
2727 enable_bitmapscan | on
2729 enable_hashjoin | on
2730 enable_indexscan | on
2731 enable_material | on
2732 enable_mergejoin | on
2733 enable_nestloop | on
2737 client_min_messages | log
2740 EXPLAIN (COSTS false) EXECUTE p1;
2742 --------------------------------------
2744 Merge Cond: (t1.c1 = t2.c1)
2748 -> Index Scan using t2_pkey on t2
2753 SELECT name, setting FROM settings;
2755 ---------------------------+-----------
2758 geqo_generations | 0
2761 geqo_selection_bias | 2
2763 constraint_exclusion | partition
2764 cursor_tuple_fraction | 0.1
2765 default_statistics_target | 100
2766 from_collapse_limit | 8
2767 join_collapse_limit | 8
2768 cpu_index_tuple_cost | 0.005
2769 cpu_operator_cost | 0.0025
2770 cpu_tuple_cost | 0.01
2771 effective_cache_size | 16384
2772 random_page_cost | 4
2774 enable_bitmapscan | on
2776 enable_hashjoin | on
2777 enable_indexscan | on
2778 enable_material | on
2779 enable_mergejoin | on
2780 enable_nestloop | on
2784 client_min_messages | log
2787 SET pg_hint_plan.parse_messages TO error;
2788 EXPLAIN (COSTS false) EXECUTE p2;
2789 ERROR: prepared statement "p2" does not exist
2790 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
2791 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2796 Set(enable_seqscan off)
2797 Set(geqo_threshold 100)
2803 --------------------------------------
2805 Merge Cond: (t1.c1 = t2.c1)
2809 -> Index Scan using t2_pkey on t2
2812 EXPLAIN (COSTS false) EXECUTE p1;
2814 --------------------------------------
2816 Merge Cond: (t1.c1 = t2.c1)
2820 -> Index Scan using t2_pkey on t2
2823 SELECT name, setting FROM settings;
2825 ---------------------------+-----------
2828 geqo_generations | 0
2831 geqo_selection_bias | 2
2833 constraint_exclusion | partition
2834 cursor_tuple_fraction | 0.1
2835 default_statistics_target | 100
2836 from_collapse_limit | 8
2837 join_collapse_limit | 8
2838 cpu_index_tuple_cost | 0.005
2839 cpu_operator_cost | 0.0025
2840 cpu_tuple_cost | 0.01
2841 effective_cache_size | 16384
2842 random_page_cost | 4
2844 enable_bitmapscan | on
2846 enable_hashjoin | on
2847 enable_indexscan | on
2848 enable_material | on
2849 enable_mergejoin | on
2850 enable_nestloop | on
2854 client_min_messages | log
2859 SELECT name, setting FROM settings;
2861 ---------------------------+-----------
2864 geqo_generations | 0
2867 geqo_selection_bias | 2
2869 constraint_exclusion | partition
2870 cursor_tuple_fraction | 0.1
2871 default_statistics_target | 100
2872 from_collapse_limit | 8
2873 join_collapse_limit | 8
2874 cpu_index_tuple_cost | 0.005
2875 cpu_operator_cost | 0.0025
2876 cpu_tuple_cost | 0.01
2877 effective_cache_size | 16384
2878 random_page_cost | 4
2880 enable_bitmapscan | on
2882 enable_hashjoin | on
2883 enable_indexscan | on
2884 enable_material | on
2885 enable_mergejoin | on
2886 enable_nestloop | on
2890 client_min_messages | log
2893 SET pg_hint_plan.parse_messages TO error;
2894 EXPLAIN (COSTS false) EXECUTE p2;
2895 ERROR: prepared statement "p2" does not exist
2896 EXPLAIN (COSTS false) EXECUTE p1;
2898 --------------------------------------
2900 Merge Cond: (t1.c1 = t2.c1)
2904 -> Index Scan using t2_pkey on t2
2907 SELECT name, setting FROM settings;
2909 ---------------------------+-----------
2912 geqo_generations | 0
2915 geqo_selection_bias | 2
2917 constraint_exclusion | partition
2918 cursor_tuple_fraction | 0.1
2919 default_statistics_target | 100
2920 from_collapse_limit | 8
2921 join_collapse_limit | 8
2922 cpu_index_tuple_cost | 0.005
2923 cpu_operator_cost | 0.0025
2924 cpu_tuple_cost | 0.01
2925 effective_cache_size | 16384
2926 random_page_cost | 4
2928 enable_bitmapscan | on
2930 enable_hashjoin | on
2931 enable_indexscan | on
2932 enable_material | on
2933 enable_mergejoin | on
2934 enable_nestloop | on
2938 client_min_messages | log
2942 SET pg_hint_plan.parse_messages TO LOG;
2944 ---- No. A-12-3 effective range of the hint
2946 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2948 --------------------------------------
2950 Merge Cond: (t1.c1 = t2.c1)
2951 -> Index Scan using t1_pkey on t1
2958 SET enable_indexscan TO off;
2959 SET enable_mergejoin TO off;
2960 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
2962 ------------------------------
2964 Hash Cond: (t1.c1 = t2.c1)
2970 SELECT name, setting FROM settings;
2972 ---------------------------+-----------
2975 geqo_generations | 0
2978 geqo_selection_bias | 2
2980 constraint_exclusion | partition
2981 cursor_tuple_fraction | 0.1
2982 default_statistics_target | 100
2983 from_collapse_limit | 8
2984 join_collapse_limit | 8
2985 cpu_index_tuple_cost | 0.005
2986 cpu_operator_cost | 0.0025
2987 cpu_tuple_cost | 0.01
2988 effective_cache_size | 16384
2989 random_page_cost | 4
2991 enable_bitmapscan | on
2993 enable_hashjoin | on
2994 enable_indexscan | off
2995 enable_material | on
2996 enable_mergejoin | off
2997 enable_nestloop | on
3001 client_min_messages | log
3004 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3005 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3011 Set(enable_indexscan on)
3012 Set(geqo_threshold 100)
3018 --------------------------------------
3020 Merge Cond: (t1.c1 = t2.c1)
3021 -> Index Scan using t1_pkey on t1
3022 -> Index Scan using t2_pkey on t2
3025 SELECT name, setting FROM settings;
3027 ---------------------------+-----------
3030 geqo_generations | 0
3033 geqo_selection_bias | 2
3035 constraint_exclusion | partition
3036 cursor_tuple_fraction | 0.1
3037 default_statistics_target | 100
3038 from_collapse_limit | 8
3039 join_collapse_limit | 8
3040 cpu_index_tuple_cost | 0.005
3041 cpu_operator_cost | 0.0025
3042 cpu_tuple_cost | 0.01
3043 effective_cache_size | 16384
3044 random_page_cost | 4
3046 enable_bitmapscan | on
3048 enable_hashjoin | on
3049 enable_indexscan | off
3050 enable_material | on
3051 enable_mergejoin | off
3052 enable_nestloop | on
3056 client_min_messages | log
3059 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3061 ------------------------------
3063 Hash Cond: (t1.c1 = t2.c1)
3070 SET enable_indexscan TO off;
3071 SET enable_mergejoin TO off;
3072 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3074 ------------------------------
3076 Hash Cond: (t1.c1 = t2.c1)
3082 SELECT name, setting FROM settings;
3084 ---------------------------+-----------
3087 geqo_generations | 0
3090 geqo_selection_bias | 2
3092 constraint_exclusion | partition
3093 cursor_tuple_fraction | 0.1
3094 default_statistics_target | 100
3095 from_collapse_limit | 8
3096 join_collapse_limit | 8
3097 cpu_index_tuple_cost | 0.005
3098 cpu_operator_cost | 0.0025
3099 cpu_tuple_cost | 0.01
3100 effective_cache_size | 16384
3101 random_page_cost | 4
3103 enable_bitmapscan | on
3105 enable_hashjoin | on
3106 enable_indexscan | off
3107 enable_material | on
3108 enable_mergejoin | off
3109 enable_nestloop | on
3113 client_min_messages | log
3117 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3118 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3124 Set(enable_indexscan on)
3125 Set(geqo_threshold 100)
3131 --------------------------------------
3133 Merge Cond: (t1.c1 = t2.c1)
3134 -> Index Scan using t1_pkey on t1
3135 -> Index Scan using t2_pkey on t2
3140 SELECT name, setting FROM settings;
3142 ---------------------------+-----------
3145 geqo_generations | 0
3148 geqo_selection_bias | 2
3150 constraint_exclusion | partition
3151 cursor_tuple_fraction | 0.1
3152 default_statistics_target | 100
3153 from_collapse_limit | 8
3154 join_collapse_limit | 8
3155 cpu_index_tuple_cost | 0.005
3156 cpu_operator_cost | 0.0025
3157 cpu_tuple_cost | 0.01
3158 effective_cache_size | 16384
3159 random_page_cost | 4
3161 enable_bitmapscan | on
3163 enable_hashjoin | on
3164 enable_indexscan | off
3165 enable_material | on
3166 enable_mergejoin | off
3167 enable_nestloop | on
3171 client_min_messages | log
3174 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3176 ------------------------------
3178 Hash Cond: (t1.c1 = t2.c1)
3186 SET enable_indexscan TO off;
3187 SET enable_mergejoin TO off;
3188 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3190 ------------------------------
3192 Hash Cond: (t1.c1 = t2.c1)
3198 SELECT name, setting FROM settings;
3200 ---------------------------+-----------
3203 geqo_generations | 0
3206 geqo_selection_bias | 2
3208 constraint_exclusion | partition
3209 cursor_tuple_fraction | 0.1
3210 default_statistics_target | 100
3211 from_collapse_limit | 8
3212 join_collapse_limit | 8
3213 cpu_index_tuple_cost | 0.005
3214 cpu_operator_cost | 0.0025
3215 cpu_tuple_cost | 0.01
3216 effective_cache_size | 16384
3217 random_page_cost | 4
3219 enable_bitmapscan | on
3221 enable_hashjoin | on
3222 enable_indexscan | off
3223 enable_material | on
3224 enable_mergejoin | off
3225 enable_nestloop | on
3229 client_min_messages | log
3232 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3233 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3239 Set(enable_indexscan on)
3240 Set(geqo_threshold 100)
3246 --------------------------------------
3248 Merge Cond: (t1.c1 = t2.c1)
3249 -> Index Scan using t1_pkey on t1
3250 -> Index Scan using t2_pkey on t2
3254 LOAD 'pg_hint_plan';
3255 SELECT name, setting FROM settings;
3257 ---------------------------+-----------
3260 geqo_generations | 0
3263 geqo_selection_bias | 2
3265 constraint_exclusion | partition
3266 cursor_tuple_fraction | 0.1
3267 default_statistics_target | 100
3268 from_collapse_limit | 8
3269 join_collapse_limit | 8
3270 cpu_index_tuple_cost | 0.005
3271 cpu_operator_cost | 0.0025
3272 cpu_tuple_cost | 0.01
3273 effective_cache_size | 16384
3274 random_page_cost | 4
3276 enable_bitmapscan | on
3278 enable_hashjoin | on
3279 enable_indexscan | on
3280 enable_material | on
3281 enable_mergejoin | on
3282 enable_nestloop | on
3286 client_min_messages | notice
3289 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3291 --------------------------------------
3293 Merge Cond: (t1.c1 = t2.c1)
3294 -> Index Scan using t1_pkey on t1
3300 SET pg_hint_plan.enable TO on;
3301 SET pg_hint_plan.debug_print TO on;
3302 SET client_min_messages TO LOG;
3303 SET search_path TO public;