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;
7 ---- No. A-5-1 hint format
11 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
27 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
29 ------------------------------
30 Index Scan using t1_i1 on t1
36 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
38 ------------------------------
39 Index Scan using t1_i1 on t1
45 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
47 ------------------------------
48 Index Scan using t1_i1 on t1
54 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
56 ------------------------------
57 Index Scan using t1_i1 on t1
63 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
65 ------------------------------
66 Index Scan using t1_i1 on t1
71 /*+SeqScan(t1) /* nest comment */ */
72 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
73 INFO: hint syntax error at or near "/* nest comment */ */
74 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
75 DETAIL: Nested block comments are not supported.
77 ------------------------------
78 Index Scan using t1_i1 on t1
83 /* +SeqScan(t1) /* nest comment */ */
84 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
86 ------------------------------
87 Index Scan using t1_i1 on t1
92 /*SeqScan(t1) /* nest comment */ */
93 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
95 ------------------------------
96 Index Scan using t1_i1 on t1
101 ---- No. A-5-2 hint position
105 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
122 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
124 ------------------------------
125 Index Scan using t1_i1 on t1
130 EXPLAIN (COSTS false) SELECT /*+SeqScan(t1)*/ * FROM s1.t1 WHERE t1.c1 = 1;
132 ------------------------------
133 Index Scan using t1_i1 on t1
138 ---- No. A-5-4 hint delimiter
140 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
142 ------------------------------
143 Index Scan using t1_i1 on t1
154 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
155 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
158 Set(enable_bitmapscan off)
159 Set(enable_indexscan off)
171 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
172 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
175 Set(enable_bitmapscan off)
176 Set(enable_indexscan off)
188 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
189 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
192 Set(enable_bitmapscan off)
193 Set(enable_indexscan off)
205 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
206 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
209 Set(enable_bitmapscan off)
210 Set(enable_indexscan off)
222 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
223 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
226 Set(enable_bitmapscan off)
227 Set(enable_indexscan off)
239 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
240 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
243 Set(enable_bitmapscan off)
244 Set(enable_indexscan off)
256 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
257 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
260 Set(enable_bitmapscan off)
261 Set(enable_indexscan off)
273 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
274 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
277 Set(enable_bitmapscan off)
278 Set(enable_indexscan off)
290 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
291 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
294 Set(enable_bitmapscan off)
295 Set(enable_indexscan off)
307 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
308 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
311 Set(enable_bitmapscan off)
312 Set(enable_indexscan off)
324 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
325 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
328 Set(enable_bitmapscan off)
329 Set(enable_indexscan off)
341 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
342 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
345 Set(enable_bitmapscan off)
346 Set(enable_indexscan off)
358 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
359 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
362 Set(enable_bitmapscan off)
363 Set(enable_indexscan off)
375 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
376 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
379 Set(enable_bitmapscan off)
380 Set(enable_indexscan off)
392 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
393 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
396 Set(enable_bitmapscan off)
397 Set(enable_indexscan off)
410 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
411 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
414 Set(enable_bitmapscan off)
415 Set(enable_indexscan off)
427 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
429 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
432 Set(enable_bitmapscan off)
433 Set(enable_indexscan off)
447 (enable_indexscan"off")
449 (enable_bitmapscan"off")*/
450 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
453 Set(enable_bitmapscan off)
454 Set(enable_indexscan off)
468 enable_indexscan"off")Set
470 enable_bitmapscan"off")*/
471 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
474 Set(enable_bitmapscan off)
475 Set(enable_indexscan off)
487 /*+Set(enable_indexscan"off"
489 Set(enable_bitmapscan"off"
492 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
495 Set(enable_bitmapscan off)
496 Set(enable_indexscan off)
515 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
518 Set(enable_bitmapscan off)
519 Set(enable_indexscan off)
543 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
546 Set(enable_bitmapscan off)
547 Set(enable_indexscan off)
560 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
561 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
564 Set(enable_bitmapscan off)
565 Set(enable_indexscan off)
577 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
579 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
582 Set(enable_bitmapscan off)
583 Set(enable_indexscan off)
597 (enable_indexscan"off")
599 (enable_bitmapscan"off")*/
600 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
603 Set(enable_bitmapscan off)
604 Set(enable_indexscan off)
618 enable_indexscan"off")Set
620 enable_bitmapscan"off")*/
621 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
624 Set(enable_bitmapscan off)
625 Set(enable_indexscan off)
637 /*+Set(enable_indexscan"off"
639 Set(enable_bitmapscan"off"
642 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
645 Set(enable_bitmapscan off)
646 Set(enable_indexscan off)
665 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
668 Set(enable_bitmapscan off)
669 Set(enable_indexscan off)
693 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
696 Set(enable_bitmapscan off)
697 Set(enable_indexscan off)
709 ---- No. A-5-5 hint object pattern
710 ---- No. A-7-2 message object pattern
715 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
730 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
745 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
760 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
777 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
792 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
801 ----------------------
807 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
822 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
831 ----------------------
839 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
854 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(((" WHERE "(((".c1 = 1;
863 ----------------------
869 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
884 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(((" WHERE "(((".c1 = 1;
893 ----------------------
901 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
902 INFO: hint syntax error at or near "))"
903 DETAIL: Relation name is necessary.
905 ----------------------------------
906 Index Scan using t1_i1 on t1 ")"
911 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
926 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
935 ----------------------
943 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
944 INFO: hint syntax error at or near ""
945 DETAIL: Unterminated quoted relation name.
947 -----------------------------------
948 Index Scan using t1_i1 on t1 """"
953 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
962 ---------------------
967 /*+SeqScan("""""""")*/
968 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
977 -------------------------
978 Seq Scan on t1 """"""""
985 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
986 INFO: hint syntax error at or near ")"
987 DETAIL: Relation name is necessary.
989 ----------------------------------
990 Index Scan using t1_i1 on t1 " "
995 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1004 --------------------
1010 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1019 ----------------------
1027 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1028 INFO: hint syntax error at or near ")"
1029 DETAIL: Relation name is necessary.
1031 -----------------------------------
1032 Index Scan using t1_i1 on t1 " "
1033 Index Cond: (c1 = 1)
1037 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1046 ---------------------------
1052 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1061 -------------------------------------------
1070 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1073 INFO: hint syntax error at or near ")"
1074 DETAIL: Relation name is necessary.
1076 --------------------------------
1077 Index Scan using t1_i1 on t1 "
1079 Index Cond: (c1 = 1)
1084 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1096 --------------------
1106 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1124 --------------------
1135 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1144 ----------------------
1145 Seq Scan on t1 "Set"
1150 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1159 ----------------------
1160 Seq Scan on t1 "Set"
1164 /*+SeqScan("Set SeqScan Leading")*/
1165 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
1168 SeqScan("Set SeqScan Leading")
1174 --------------------------------------
1175 Seq Scan on t1 "Set SeqScan Leading"
1182 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1191 ---------------------
1197 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1206 -------------------------
1207 Seq Scan on t1 "あいう"
1212 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1221 ---------------------
1227 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1236 -------------------------
1237 Seq Scan on t1 "あいう"
1244 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
1245 INFO: hint syntax error at or near "/**/)*/
1246 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
1247 DETAIL: Nested block comments are not supported.
1249 -------------------------------------
1250 Index Scan using t1_i1 on t1 "/**/"
1251 Index Cond: (c1 = 1)
1254 /*+SeqScan(/**//**//**/)*/
1255 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
1256 INFO: hint syntax error at or near "/**//**//**/)*/
1257 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
1258 DETAIL: Nested block comments are not supported.
1260 ---------------------------------------------
1261 Index Scan using t1_i1 on t1 "/**//**//**/"
1262 Index Cond: (c1 = 1)
1269 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1270 Set/**/あ" WHERE "tT()""
1272 INFO: hint syntax error at or near "/**/あ")*/
1273 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1274 Set/**/あ" WHERE "tT()""
1276 DETAIL: Nested block comments are not supported.
1278 ------------------------------------------
1279 Index Scan using t1_i1 on t1 "tT()""
1281 Index Cond: (c1 = 1)
1287 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""
1299 --------------------------
1300 Seq Scan on t1 "tT()""
1306 ---- No. A-5-6 hint parse error
1309 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1310 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1311 INFO: hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1312 DETAIL: Opening parenthesis is necessary.
1315 Set(enable_indexscan off)
1321 ----------------------------------
1322 Bitmap Heap Scan on t1
1323 Recheck Cond: (c1 = 1)
1324 -> Bitmap Index Scan on t1_i1
1325 Index Cond: (c1 = 1)
1329 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
1330 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1331 INFO: hint syntax error at or near "Set(enable_bitmapscan off)SeqScan(t1)"
1332 DETAIL: Closing parenthesis is necessary.
1335 Set(enable_indexscan off)
1341 ----------------------------------
1342 Bitmap Heap Scan on t1
1343 Recheck Cond: (c1 = 1)
1344 -> Bitmap Index Scan on t1_i1
1345 Index Cond: (c1 = 1)
1349 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
1350 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1351 INFO: hint syntax error at or near ""
1352 DETAIL: Unterminated quoted parameter value.
1355 Set(enable_indexscan off)
1361 ----------------------------------
1362 Bitmap Heap Scan on t1
1363 Recheck Cond: (c1 = 1)
1364 -> Bitmap Index Scan on t1_i1
1365 Index Cond: (c1 = 1)
1369 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
1370 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1371 INFO: hint syntax error at or near ")Set(enable_bitmapscan off)"
1372 DETAIL: Relation name is necessary.
1375 Set(enable_indexscan off)
1381 ----------------------------------
1382 Bitmap Heap Scan on t1
1383 Recheck Cond: (c1 = 1)
1384 -> Bitmap Index Scan on t1_i1
1385 Index Cond: (c1 = 1)
1389 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1390 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1391 INFO: hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1392 DETAIL: Unrecognized hint keyword "NoSet".
1395 Set(enable_indexscan off)
1401 ----------------------------------
1402 Bitmap Heap Scan on t1
1403 Recheck Cond: (c1 = 1)
1404 -> Bitmap Index Scan on t1_i1
1405 Index Cond: (c1 = 1)
1409 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1410 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1411 INFO: hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1412 DETAIL: Unrecognized hint keyword ""Set"".
1415 Set(enable_indexscan off)
1421 ----------------------------------
1422 Bitmap Heap Scan on t1
1423 Recheck Cond: (c1 = 1)
1424 -> Bitmap Index Scan on t1_i1
1425 Index Cond: (c1 = 1)
1429 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1430 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1431 INFO: hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1432 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
1433 DETAIL: Nested block comments are not supported.
1435 ------------------------------
1436 Index Scan using t1_i1 on t1
1437 Index Cond: (c1 = 1)
1441 ---- No. A-6-1 original GUC parameter
1444 SET ROLE super_user;
1445 SET pg_hint_plan.debug_print TO off;
1446 SHOW pg_hint_plan.enable_hint;
1447 pg_hint_plan.enable_hint
1448 --------------------------
1452 SHOW pg_hint_plan.debug_print;
1453 pg_hint_plan.debug_print
1454 --------------------------
1458 SHOW pg_hint_plan.parse_messages;
1459 pg_hint_plan.parse_messages
1460 -----------------------------
1464 SET pg_hint_plan.enable_hint TO off;
1465 SET pg_hint_plan.debug_print TO on;
1466 SET pg_hint_plan.parse_messages TO error;
1467 SHOW pg_hint_plan.enable_hint;
1468 pg_hint_plan.enable_hint
1469 --------------------------
1473 SHOW pg_hint_plan.debug_print;
1474 pg_hint_plan.debug_print
1475 --------------------------
1479 SHOW pg_hint_plan.parse_messages;
1480 pg_hint_plan.parse_messages
1481 -----------------------------
1485 RESET pg_hint_plan.enable_hint;
1486 RESET pg_hint_plan.debug_print;
1487 RESET pg_hint_plan.parse_messages;
1488 SHOW pg_hint_plan.enable_hint;
1489 pg_hint_plan.enable_hint
1490 --------------------------
1494 SHOW pg_hint_plan.debug_print;
1495 pg_hint_plan.debug_print
1496 --------------------------
1500 SHOW pg_hint_plan.parse_messages;
1501 pg_hint_plan.parse_messages
1502 -----------------------------
1507 SET ROLE normal_user;
1508 SHOW pg_hint_plan.enable_hint;
1509 pg_hint_plan.enable_hint
1510 --------------------------
1514 SHOW pg_hint_plan.debug_print;
1515 pg_hint_plan.debug_print
1516 --------------------------
1520 SHOW pg_hint_plan.parse_messages;
1521 pg_hint_plan.parse_messages
1522 -----------------------------
1526 SET pg_hint_plan.enable_hint TO off;
1527 SET pg_hint_plan.debug_print TO on;
1528 SET pg_hint_plan.parse_messages TO error;
1529 SHOW pg_hint_plan.enable_hint;
1530 pg_hint_plan.enable_hint
1531 --------------------------
1535 SHOW pg_hint_plan.debug_print;
1536 pg_hint_plan.debug_print
1537 --------------------------
1541 SHOW pg_hint_plan.parse_messages;
1542 pg_hint_plan.parse_messages
1543 -----------------------------
1547 RESET pg_hint_plan.enable_hint;
1548 RESET pg_hint_plan.debug_print;
1549 RESET pg_hint_plan.parse_messages;
1550 SHOW pg_hint_plan.enable_hint;
1551 pg_hint_plan.enable_hint
1552 --------------------------
1556 SHOW pg_hint_plan.debug_print;
1557 pg_hint_plan.debug_print
1558 --------------------------
1562 SHOW pg_hint_plan.parse_messages;
1563 pg_hint_plan.parse_messages
1564 -----------------------------
1570 ---- No. A-6-2 original GUC parameter pg_hint_plan.enable_hint
1573 SET pg_hint_plan.enable_hint TO on;
1574 SHOW pg_hint_plan.enable_hint;
1575 pg_hint_plan.enable_hint
1576 --------------------------
1580 /*+Set(enable_indexscan off)*/
1581 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1583 ----------------------------------
1584 Bitmap Heap Scan on t1
1585 Recheck Cond: (c1 = 1)
1586 -> Bitmap Index Scan on t1_i1
1587 Index Cond: (c1 = 1)
1591 SET pg_hint_plan.enable_hint TO off;
1592 SHOW pg_hint_plan.enable_hint;
1593 pg_hint_plan.enable_hint
1594 --------------------------
1598 /*+Set(enable_indexscan off)*/
1599 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1601 ------------------------------
1602 Index Scan using t1_i1 on t1
1603 Index Cond: (c1 = 1)
1607 SET pg_hint_plan.enable_hint TO DEFAULT;
1608 SHOW pg_hint_plan.enable_hint;
1609 pg_hint_plan.enable_hint
1610 --------------------------
1614 /*+Set(enable_indexscan off)*/
1615 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1617 ----------------------------------
1618 Bitmap Heap Scan on t1
1619 Recheck Cond: (c1 = 1)
1620 -> Bitmap Index Scan on t1_i1
1621 Index Cond: (c1 = 1)
1625 SET pg_hint_plan.enable_hint TO enable;
1626 ERROR: parameter "pg_hint_plan.enable_hint" requires a Boolean value
1627 SHOW pg_hint_plan.enable_hint;
1628 pg_hint_plan.enable_hint
1629 --------------------------
1634 ---- No. A-6-3 original GUC parameter pg_hint_plan.debug_print
1637 SET pg_hint_plan.debug_print TO on;
1638 SHOW pg_hint_plan.debug_print;
1639 pg_hint_plan.debug_print
1640 --------------------------
1644 /*+Set(enable_indexscan off)*/
1645 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1648 Set(enable_indexscan off)
1654 ----------------------------------
1655 Bitmap Heap Scan on t1
1656 Recheck Cond: (c1 = 1)
1657 -> Bitmap Index Scan on t1_i1
1658 Index Cond: (c1 = 1)
1662 SET pg_hint_plan.debug_print TO off;
1663 SHOW pg_hint_plan.debug_print;
1664 pg_hint_plan.debug_print
1665 --------------------------
1669 /*+Set(enable_indexscan off)*/
1670 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1672 ----------------------------------
1673 Bitmap Heap Scan on t1
1674 Recheck Cond: (c1 = 1)
1675 -> Bitmap Index Scan on t1_i1
1676 Index Cond: (c1 = 1)
1680 SET pg_hint_plan.debug_print TO DEFAULT;
1681 SHOW pg_hint_plan.debug_print;
1682 pg_hint_plan.debug_print
1683 --------------------------
1687 /*+Set(enable_indexscan off)*/
1688 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1690 ----------------------------------
1691 Bitmap Heap Scan on t1
1692 Recheck Cond: (c1 = 1)
1693 -> Bitmap Index Scan on t1_i1
1694 Index Cond: (c1 = 1)
1698 SET pg_hint_plan.debug_print TO enable;
1699 ERROR: parameter "pg_hint_plan.debug_print" requires a Boolean value
1700 SHOW pg_hint_plan.debug_print;
1701 pg_hint_plan.debug_print
1702 --------------------------
1707 ---- No. A-6-4 original GUC parameter pg_hint_plan.parse_messages
1709 SET client_min_messages TO debug5;
1710 DEBUG: CommitTransactionCommand
1711 DEBUG: CommitTransaction
1712 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1714 SET pg_hint_plan.parse_messages TO debug5;
1715 DEBUG: StartTransactionCommand
1716 DEBUG: StartTransaction
1717 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1718 DEBUG: ProcessUtility
1719 DEBUG: CommitTransactionCommand
1720 DEBUG: CommitTransaction
1721 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1722 SHOW pg_hint_plan.parse_messages;
1723 DEBUG: StartTransactionCommand
1724 DEBUG: StartTransaction
1725 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1726 DEBUG: ProcessUtility
1727 DEBUG: CommitTransactionCommand
1728 DEBUG: CommitTransaction
1729 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1730 pg_hint_plan.parse_messages
1731 -----------------------------
1736 DEBUG: StartTransactionCommand
1737 DEBUG: StartTransaction
1738 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1739 DEBUG: hint syntax error at or near ""
1740 DETAIL: Opening parenthesis is necessary.
1741 DEBUG: CommitTransactionCommand
1742 DEBUG: CommitTransaction
1743 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1749 SET client_min_messages TO debug4;
1750 DEBUG: StartTransactionCommand
1751 DEBUG: StartTransaction
1752 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1753 DEBUG: ProcessUtility
1754 DEBUG: CommitTransactionCommand
1755 DEBUG: CommitTransaction
1756 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1758 DEBUG: StartTransactionCommand
1759 DEBUG: StartTransaction
1760 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1761 DEBUG: CommitTransactionCommand
1762 DEBUG: CommitTransaction
1763 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1770 SET pg_hint_plan.parse_messages TO debug4;
1771 DEBUG: StartTransactionCommand
1772 DEBUG: StartTransaction
1773 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1774 DEBUG: ProcessUtility
1775 DEBUG: CommitTransactionCommand
1776 DEBUG: CommitTransaction
1777 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1778 SHOW pg_hint_plan.parse_messages;
1779 DEBUG: StartTransactionCommand
1780 DEBUG: StartTransaction
1781 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1782 DEBUG: ProcessUtility
1783 DEBUG: CommitTransactionCommand
1784 DEBUG: CommitTransaction
1785 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1786 pg_hint_plan.parse_messages
1787 -----------------------------
1792 DEBUG: StartTransactionCommand
1793 DEBUG: StartTransaction
1794 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1795 DEBUG: hint syntax error at or near ""
1796 DETAIL: Opening parenthesis is necessary.
1797 DEBUG: CommitTransactionCommand
1798 DEBUG: CommitTransaction
1799 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1805 SET client_min_messages TO debug3;
1806 DEBUG: StartTransactionCommand
1807 DEBUG: StartTransaction
1808 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1809 DEBUG: ProcessUtility
1810 DEBUG: CommitTransactionCommand
1811 DEBUG: CommitTransaction
1812 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1814 DEBUG: StartTransactionCommand
1815 DEBUG: StartTransaction
1816 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1817 DEBUG: CommitTransactionCommand
1818 DEBUG: CommitTransaction
1819 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1826 SET pg_hint_plan.parse_messages TO debug3;
1827 DEBUG: StartTransactionCommand
1828 DEBUG: StartTransaction
1829 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1830 DEBUG: ProcessUtility
1831 DEBUG: CommitTransactionCommand
1832 DEBUG: CommitTransaction
1833 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1834 SHOW pg_hint_plan.parse_messages;
1835 DEBUG: StartTransactionCommand
1836 DEBUG: StartTransaction
1837 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1838 DEBUG: ProcessUtility
1839 DEBUG: CommitTransactionCommand
1840 DEBUG: CommitTransaction
1841 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1842 pg_hint_plan.parse_messages
1843 -----------------------------
1848 DEBUG: StartTransactionCommand
1849 DEBUG: StartTransaction
1850 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1851 DEBUG: hint syntax error at or near ""
1852 DETAIL: Opening parenthesis is necessary.
1853 DEBUG: CommitTransactionCommand
1854 DEBUG: CommitTransaction
1855 DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1861 SET client_min_messages TO debug2;
1862 DEBUG: StartTransactionCommand
1863 DEBUG: StartTransaction
1864 DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
1865 DEBUG: ProcessUtility
1873 SET pg_hint_plan.parse_messages TO debug2;
1874 SHOW pg_hint_plan.parse_messages;
1875 pg_hint_plan.parse_messages
1876 -----------------------------
1881 DEBUG: hint syntax error at or near ""
1882 DETAIL: Opening parenthesis is necessary.
1888 SET client_min_messages TO debug1;
1896 SET pg_hint_plan.parse_messages TO debug1;
1897 SHOW pg_hint_plan.parse_messages;
1898 pg_hint_plan.parse_messages
1899 -----------------------------
1904 DEBUG: hint syntax error at or near ""
1905 DETAIL: Opening parenthesis is necessary.
1911 SET client_min_messages TO log;
1919 SET pg_hint_plan.parse_messages TO log;
1920 SHOW pg_hint_plan.parse_messages;
1921 pg_hint_plan.parse_messages
1922 -----------------------------
1927 LOG: hint syntax error at or near ""
1928 DETAIL: Opening parenthesis is necessary.
1934 SET client_min_messages TO info;
1942 SET pg_hint_plan.parse_messages TO info;
1943 SHOW pg_hint_plan.parse_messages;
1944 pg_hint_plan.parse_messages
1945 -----------------------------
1950 INFO: hint syntax error at or near ""
1951 DETAIL: Opening parenthesis is necessary.
1957 SET client_min_messages TO notice;
1959 INFO: hint syntax error at or near ""
1960 DETAIL: Opening parenthesis is necessary.
1967 SET pg_hint_plan.parse_messages TO notice;
1968 SHOW pg_hint_plan.parse_messages;
1969 pg_hint_plan.parse_messages
1970 -----------------------------
1975 NOTICE: hint syntax error at or near ""
1976 DETAIL: Opening parenthesis is necessary.
1982 SET client_min_messages TO warning;
1990 SET pg_hint_plan.parse_messages TO warning;
1991 SHOW pg_hint_plan.parse_messages;
1992 pg_hint_plan.parse_messages
1993 -----------------------------
1998 WARNING: hint syntax error at or near ""
1999 DETAIL: Opening parenthesis is necessary.
2005 SET client_min_messages TO error;
2013 SET pg_hint_plan.parse_messages TO error;
2014 SHOW pg_hint_plan.parse_messages;
2015 pg_hint_plan.parse_messages
2016 -----------------------------
2021 ERROR: hint syntax error at or near ""
2022 DETAIL: Opening parenthesis is necessary.
2023 SET client_min_messages TO fatal;
2026 RESET client_min_messages;
2027 SET pg_hint_plan.parse_messages TO DEFAULT;
2028 SHOW pg_hint_plan.parse_messages;
2029 pg_hint_plan.parse_messages
2030 -----------------------------
2035 INFO: hint syntax error at or near ""
2036 DETAIL: Opening parenthesis is necessary.
2043 SET pg_hint_plan.parse_messages TO fatal;
2044 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2045 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2046 SHOW pg_hint_plan.parse_messages;
2047 pg_hint_plan.parse_messages
2048 -----------------------------
2053 SET pg_hint_plan.parse_messages TO panic;
2054 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2055 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2056 SHOW pg_hint_plan.parse_messages;
2057 pg_hint_plan.parse_messages
2058 -----------------------------
2063 SET pg_hint_plan.parse_messages TO on;
2064 ERROR: invalid value for parameter "pg_hint_plan.parse_messages": "on"
2065 HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2066 SHOW pg_hint_plan.parse_messages;
2067 pg_hint_plan.parse_messages
2068 -----------------------------
2073 ---- No. A-7-1 parse error message output
2076 /*+"Set"(enable_indexscan on)*/SELECT 1;
2077 INFO: hint syntax error at or near ""Set"(enable_indexscan on)"
2078 DETAIL: Unrecognized hint keyword ""Set"".
2084 /*+Set()(enable_indexscan on)*/SELECT 1;
2085 INFO: hint syntax error at or near ")(enable_indexscan on)"
2086 DETAIL: Parameter name is necessary.
2092 /*+Set(enable_indexscan on*/SELECT 1;
2093 INFO: hint syntax error at or near ""
2094 DETAIL: Closing parenthesis is necessary.
2101 ---- No. A-7-3 hint state output
2103 SET pg_hint_plan.debug_print TO on;
2104 SET client_min_messages TO LOG;
2107 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2116 --------------------
2122 /*+SeqScan(no_table)*/
2123 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2132 ------------------------------
2133 Index Scan using t1_i1 on t1
2134 Index Cond: (c1 = 1)
2138 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2140 -----------------------------------
2142 TID Cond: (ctid = '(1,1)'::tid)
2146 /*+TidScan(t1)BitmapScan(t1)*/
2147 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2148 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2149 DETAIL: Conflict scan method hint.
2159 ----------------------------------
2160 Bitmap Heap Scan on t1
2161 Recheck Cond: (c1 = 1)
2162 Filter: (ctid = '(1,1)'::tid)
2163 -> Bitmap Index Scan on t1_i1
2164 Index Cond: (c1 = 1)
2167 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2168 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2169 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2170 DETAIL: Conflict scan method hint.
2171 INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2172 DETAIL: Conflict scan method hint.
2183 ---------------------------------
2184 Index Scan using t1_i1 on t1
2185 Index Cond: (c1 = 1)
2186 Filter: (ctid = '(1,1)'::tid)
2189 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2190 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2191 INFO: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2192 DETAIL: Conflict scan method hint.
2193 INFO: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2194 DETAIL: Conflict scan method hint.
2195 INFO: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2196 DETAIL: Conflict scan method hint.
2208 ------------------------------------------------
2210 Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2214 /*+Set(enable_indexscan enable)*/
2215 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2216 INFO: parameter "enable_indexscan" requires a Boolean value
2222 Set(enable_indexscan enable)
2225 ------------------------------
2226 Index Scan using t1_i1 on t1
2227 Index Cond: (c1 = 1)
2231 ---- No. A-8-1 hint state output
2233 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2234 EXPLAIN (COSTS false) EXECUTE p1;
2236 ------------------------------
2237 Index Scan using t1_i1 on t1
2238 Index Cond: (c1 = 1)
2242 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2243 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2245 ---------------------
2250 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2252 ---------------------
2257 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2259 ---------------------
2264 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2266 ---------------------
2271 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2273 ---------------------
2278 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2280 ---------------------
2289 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2298 EXPLAIN (COSTS false) EXECUTE p1;
2300 --------------------
2305 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2307 EXPLAIN (COSTS false) EXECUTE p1;
2316 --------------------
2323 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2332 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2334 ----------------------------------
2335 Bitmap Heap Scan on t1
2336 Recheck Cond: (c1 < $1)
2337 -> Bitmap Index Scan on t1_i1
2338 Index Cond: (c1 < $1)
2342 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2344 ----------------------------------
2345 Bitmap Heap Scan on t1
2346 Recheck Cond: (c1 < $1)
2347 -> Bitmap Index Scan on t1_i1
2348 Index Cond: (c1 < $1)
2352 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2354 ----------------------------------
2355 Bitmap Heap Scan on t1
2356 Recheck Cond: (c1 < $1)
2357 -> Bitmap Index Scan on t1_i1
2358 Index Cond: (c1 < $1)
2362 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2364 ----------------------------------
2365 Bitmap Heap Scan on t1
2366 Recheck Cond: (c1 < $1)
2367 -> Bitmap Index Scan on t1_i1
2368 Index Cond: (c1 < $1)
2372 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2374 ----------------------------------
2375 Bitmap Heap Scan on t1
2376 Recheck Cond: (c1 < $1)
2377 -> Bitmap Index Scan on t1_i1
2378 Index Cond: (c1 < $1)
2382 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2384 ----------------------------------
2385 Bitmap Heap Scan on t1
2386 Recheck Cond: (c1 < $1)
2387 -> Bitmap Index Scan on t1_i1
2388 Index Cond: (c1 < $1)
2391 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2393 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2402 ----------------------------------
2403 Bitmap Heap Scan on t1
2404 Recheck Cond: (c1 < $1)
2405 -> Bitmap Index Scan on t1_i1
2406 Index Cond: (c1 < $1)
2413 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2421 EXPLAIN (COSTS false) EXECUTE p1;
2423 --------------------
2428 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2429 EXPLAIN (COSTS false) EXECUTE p1;
2438 --------------------
2445 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2453 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2455 ----------------------------------
2456 Bitmap Heap Scan on t1
2457 Recheck Cond: (c1 < $1)
2458 -> Bitmap Index Scan on t1_i1
2459 Index Cond: (c1 < $1)
2462 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2464 ----------------------------------
2465 Bitmap Heap Scan on t1
2466 Recheck Cond: (c1 < $1)
2467 -> Bitmap Index Scan on t1_i1
2468 Index Cond: (c1 < $1)
2471 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2473 ----------------------------------
2474 Bitmap Heap Scan on t1
2475 Recheck Cond: (c1 < $1)
2476 -> Bitmap Index Scan on t1_i1
2477 Index Cond: (c1 < $1)
2480 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2482 ----------------------------------
2483 Bitmap Heap Scan on t1
2484 Recheck Cond: (c1 < $1)
2485 -> Bitmap Index Scan on t1_i1
2486 Index Cond: (c1 < $1)
2489 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2491 ----------------------------------
2492 Bitmap Heap Scan on t1
2493 Recheck Cond: (c1 < $1)
2494 -> Bitmap Index Scan on t1_i1
2495 Index Cond: (c1 < $1)
2498 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2500 ----------------------------------
2501 Bitmap Heap Scan on t1
2502 Recheck Cond: (c1 < $1)
2503 -> Bitmap Index Scan on t1_i1
2504 Index Cond: (c1 < $1)
2507 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2508 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2517 ----------------------------------
2518 Bitmap Heap Scan on t1
2519 Recheck Cond: (c1 < $1)
2520 -> Bitmap Index Scan on t1_i1
2521 Index Cond: (c1 < $1)
2527 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2529 EXPLAIN (COSTS false) EXECUTE p1;
2531 ------------------------------
2532 Index Scan using t1_i1 on t1
2533 Index Cond: (c1 = 1)
2536 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2538 EXPLAIN (COSTS false) EXECUTE p1;
2540 ------------------------------
2541 Index Scan using t1_i1 on t1
2542 Index Cond: (c1 = 1)
2546 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2548 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2550 ---------------------
2555 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2557 ---------------------
2562 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2564 ---------------------
2569 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2571 ---------------------
2576 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2578 ---------------------
2583 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2585 ---------------------
2590 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2592 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2594 ---------------------
2601 ---- No. A-8-4 EXECUTE statement name error
2605 ERROR: prepared statement "p1" does not exist
2606 SHOW pg_hint_plan.debug_print;
2607 pg_hint_plan.debug_print
2608 --------------------------
2613 ---- No. A-9-5 EXECUTE statement name error
2616 SELECT pg_stat_statements_reset();
2617 pg_stat_statements_reset
2618 --------------------------
2622 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2628 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2631 Set(enable_seqscan off)
2641 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2654 SELECT s.query, s.calls
2655 FROM public.pg_stat_statements s
2656 JOIN pg_catalog.pg_database d
2660 -------------------------------------------------------------------+-------
2661 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2662 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2663 SELECT * FROM s1.t1 WHERE t1.c1 = 1; | 1
2664 SELECT pg_stat_statements_reset(); | 1
2668 ---- No. A-10-1 duplicate hint
2671 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2673 -----------------------------------------------------
2675 Join Filter: (t1.c1 = t4.c1)
2677 Join Filter: (t1.c1 = t3.c1)
2679 Join Filter: (t1.c1 = t2.c1)
2681 TID Cond: (ctid = '(1,1)'::tid)
2683 Filter: (ctid = '(1,1)'::tid)
2685 TID Cond: (ctid = '(1,1)'::tid)
2687 TID Cond: (ctid = '(1,1)'::tid)
2691 Set(enable_tidscan aaa)
2692 Set(enable_tidscan on)
2693 Set(enable_tidscan off)
2701 Leading(t2 t1 t4 t3)
2702 Leading(t1 t4 t3 t2)
2703 Leading(t4 t3 t2 t1)
2705 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2706 INFO: hint syntax error at or near "SeqScan(t4)
2713 Leading(t2 t1 t4 t3)
2714 Leading(t1 t4 t3 t2)
2715 Leading(t4 t3 t2 t1)
2717 DETAIL: Conflict scan method hint.
2718 INFO: hint syntax error at or near "IndexScan(t4)
2724 Leading(t2 t1 t4 t3)
2725 Leading(t1 t4 t3 t2)
2726 Leading(t4 t3 t2 t1)
2728 DETAIL: Conflict scan method hint.
2729 INFO: hint syntax error at or near "BitmapScan(t4)
2734 Leading(t2 t1 t4 t3)
2735 Leading(t1 t4 t3 t2)
2736 Leading(t4 t3 t2 t1)
2738 DETAIL: Conflict scan method hint.
2739 INFO: hint syntax error at or near "NestLoop(t4 t3)
2742 Leading(t2 t1 t4 t3)
2743 Leading(t1 t4 t3 t2)
2744 Leading(t4 t3 t2 t1)
2746 DETAIL: Conflict join method hint.
2747 INFO: hint syntax error at or near "MergeJoin(t4 t3)
2749 Leading(t2 t1 t4 t3)
2750 Leading(t1 t4 t3 t2)
2751 Leading(t4 t3 t2 t1)
2753 DETAIL: Conflict join method hint.
2754 INFO: hint syntax error at or near "Leading(t2 t1 t4 t3)
2755 Leading(t1 t4 t3 t2)
2756 Leading(t4 t3 t2 t1)
2758 DETAIL: Conflict leading hint.
2759 INFO: hint syntax error at or near "Leading(t1 t4 t3 t2)
2760 Leading(t4 t3 t2 t1)
2762 DETAIL: Conflict leading hint.
2763 INFO: hint syntax error at or near "Set(enable_tidscan aaa)
2764 Set(enable_tidscan on)
2765 Set(enable_tidscan off)
2773 Leading(t2 t1 t4 t3)
2774 Leading(t1 t4 t3 t2)
2775 Leading(t4 t3 t2 t1)
2777 DETAIL: Conflict set hint.
2778 INFO: hint syntax error at or near "Set(enable_tidscan on)
2779 Set(enable_tidscan off)
2787 Leading(t2 t1 t4 t3)
2788 Leading(t1 t4 t3 t2)
2789 Leading(t4 t3 t2 t1)
2791 DETAIL: Conflict set hint.
2796 Leading(t4 t3 t2 t1)
2797 Set(enable_tidscan off)
2805 Leading(t2 t1 t4 t3)
2806 Leading(t1 t4 t3 t2)
2807 Set(enable_tidscan aaa)
2808 Set(enable_tidscan on)
2812 -----------------------------------------------------------
2815 Join Filter: (t3.c1 = t2.c1)
2817 Hash Cond: (t3.c1 = t4.c1)
2819 Filter: (ctid = '(1,1)'::tid)
2822 TID Cond: (ctid = '(1,1)'::tid)
2824 Filter: (ctid = '(1,1)'::tid)
2825 -> Index Scan using t1_i1 on t1
2826 Index Cond: (c1 = t2.c1)
2827 Filter: (ctid = '(1,1)'::tid)
2831 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2833 -----------------------------------------------------
2835 Join Filter: (t1.c1 = t4.c1)
2837 Join Filter: (t1.c1 = t3.c1)
2839 Join Filter: (t1.c1 = t2.c1)
2841 TID Cond: (ctid = '(1,1)'::tid)
2843 Filter: (ctid = '(1,1)'::tid)
2845 TID Cond: (ctid = '(1,1)'::tid)
2847 TID Cond: (ctid = '(1,1)'::tid)
2852 Set(enable_tidscan aaa)
2855 Leading(t2 t1 t4 t3)
2856 Set(enable_tidscan on)
2859 Leading(t1 t4 t3 t2)
2860 Set(enable_tidscan off)
2863 Leading(t4 t3 t2 t1)
2865 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2866 INFO: hint syntax error at or near "SeqScan(t4)
2867 Set(enable_tidscan aaa)
2870 Leading(t2 t1 t4 t3)
2871 Set(enable_tidscan on)
2874 Leading(t1 t4 t3 t2)
2875 Set(enable_tidscan off)
2878 Leading(t4 t3 t2 t1)
2880 DETAIL: Conflict scan method hint.
2881 INFO: hint syntax error at or near "IndexScan(t4)
2883 Leading(t2 t1 t4 t3)
2884 Set(enable_tidscan on)
2887 Leading(t1 t4 t3 t2)
2888 Set(enable_tidscan off)
2891 Leading(t4 t3 t2 t1)
2893 DETAIL: Conflict scan method hint.
2894 INFO: hint syntax error at or near "BitmapScan(t4)
2896 Leading(t1 t4 t3 t2)
2897 Set(enable_tidscan off)
2900 Leading(t4 t3 t2 t1)
2902 DETAIL: Conflict scan method hint.
2903 INFO: hint syntax error at or near "NestLoop(t4 t3)
2904 Leading(t2 t1 t4 t3)
2905 Set(enable_tidscan on)
2908 Leading(t1 t4 t3 t2)
2909 Set(enable_tidscan off)
2912 Leading(t4 t3 t2 t1)
2914 DETAIL: Conflict join method hint.
2915 INFO: hint syntax error at or near "MergeJoin(t4 t3)
2916 Leading(t1 t4 t3 t2)
2917 Set(enable_tidscan off)
2920 Leading(t4 t3 t2 t1)
2922 DETAIL: Conflict join method hint.
2923 INFO: hint syntax error at or near "Leading(t2 t1 t4 t3)
2924 Set(enable_tidscan on)
2927 Leading(t1 t4 t3 t2)
2928 Set(enable_tidscan off)
2931 Leading(t4 t3 t2 t1)
2933 DETAIL: Conflict leading hint.
2934 INFO: hint syntax error at or near "Leading(t1 t4 t3 t2)
2935 Set(enable_tidscan off)
2938 Leading(t4 t3 t2 t1)
2940 DETAIL: Conflict leading hint.
2941 INFO: hint syntax error at or near "Set(enable_tidscan aaa)
2944 Leading(t2 t1 t4 t3)
2945 Set(enable_tidscan on)
2948 Leading(t1 t4 t3 t2)
2949 Set(enable_tidscan off)
2952 Leading(t4 t3 t2 t1)
2954 DETAIL: Conflict set hint.
2955 INFO: hint syntax error at or near "Set(enable_tidscan on)
2958 Leading(t1 t4 t3 t2)
2959 Set(enable_tidscan off)
2962 Leading(t4 t3 t2 t1)
2964 DETAIL: Conflict set hint.
2969 Leading(t4 t3 t2 t1)
2970 Set(enable_tidscan off)
2978 Leading(t2 t1 t4 t3)
2979 Leading(t1 t4 t3 t2)
2980 Set(enable_tidscan aaa)
2981 Set(enable_tidscan on)
2985 -----------------------------------------------------------
2988 Join Filter: (t3.c1 = t2.c1)
2990 Hash Cond: (t3.c1 = t4.c1)
2992 Filter: (ctid = '(1,1)'::tid)
2995 TID Cond: (ctid = '(1,1)'::tid)
2997 Filter: (ctid = '(1,1)'::tid)
2998 -> Index Scan using t1_i1 on t1
2999 Index Cond: (c1 = t2.c1)
3000 Filter: (ctid = '(1,1)'::tid)
3004 ---- No. A-10-2 restrict query type
3007 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3009 ------------------------------
3011 Hash Cond: (t1.c1 = t2.c1)
3017 /*+HashJoin(t1 t2)*/
3018 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3027 ------------------------------
3029 Hash Cond: (t1.c1 = t2.c1)
3035 /*+MergeJoin(t1 t2)*/
3036 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3045 ------------------------------------
3047 Merge Cond: (t1.c1 = t2.c1)
3048 -> Index Scan using t1_i1 on t1
3054 /*+NestLoop(t1 t2)*/
3055 EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3064 --------------------------------------------------------------------------
3065 Hash Full Join (cost=10000000003.25..10000000024.00 rows=1000 width=29)
3066 Hash Cond: (t1.c1 = t2.c1)
3067 -> Seq Scan on t1 (cost=0.00..16.00 rows=1000 width=15)
3068 -> Hash (cost=2.00..2.00 rows=100 width=14)
3069 -> Seq Scan on t2 (cost=0.00..2.00 rows=100 width=14)
3073 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3075 -----------------------------------
3077 TID Cond: (ctid = '(1,1)'::tid)
3082 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3091 ---------------------------------
3092 Index Scan using t1_i on t1
3093 Index Cond: (c3 = 1)
3094 Filter: (ctid = '(1,1)'::tid)
3097 /*+IndexScan(t1 t1_i)*/
3098 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3107 ---------------------------------
3108 Index Scan using t1_i on t1
3109 Index Cond: (c3 = 1)
3110 Filter: (ctid = '(1,1)'::tid)
3113 /*+IndexScan(t1 t1_i1)*/
3114 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3123 -----------------------------------------------------------------------
3124 Tid Scan on t1 (cost=10000000000.00..10000000004.02 rows=1 width=15)
3125 TID Cond: (ctid = '(1,1)'::tid)
3130 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3132 ------------------------------
3133 Index Scan using t1_i1 on t1
3134 Index Cond: (c1 = 1)
3138 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3147 -----------------------------------------------------------------------
3148 Seq Scan on t1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
3153 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3162 -----------------------------------
3164 TID Cond: (ctid = '(1,1)'::tid)
3169 ---- No. A-10-3 VIEW, RULE multi specified
3172 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3174 ----------------------------------
3176 Hash Cond: (v1t1.c1 = v1t1.c1)
3177 -> Seq Scan on t1 v1t1
3179 -> Seq Scan on t1 v1t1
3182 /*+Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)*/
3183 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3184 INFO: hint syntax error at or near "HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3185 DETAIL: Relation name "v1t1" is ambiguous.
3186 INFO: hint syntax error at or near "Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3187 DETAIL: Relation name "v1t1" is ambiguous.
3198 ------------------------------------------
3200 -> Index Scan using t1_i1 on t1 v1t1
3201 -> Bitmap Heap Scan on t1 v1t1
3202 Recheck Cond: (c1 = v1t1.c1)
3203 -> Bitmap Index Scan on t1_i1
3204 Index Cond: (c1 = v1t1.c1)
3208 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3210 -----------------------------------
3212 Hash Cond: (v1t1.c1 = v1t1_.c1)
3213 -> Seq Scan on t1 v1t1
3215 -> Seq Scan on t1 v1t1_
3218 /*+Leading(v1t1 v1t1_)NestLoop(v1t1 v1t1_)SeqScan(v1t1)BitmapScan(v1t1_)*/
3219 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3224 NestLoop(v1t1 v1t1_)
3231 ------------------------------------------
3233 -> Seq Scan on t1 v1t1
3234 -> Bitmap Heap Scan on t1 v1t1_
3235 Recheck Cond: (c1 = v1t1.c1)
3236 -> Bitmap Index Scan on t1_i1
3237 Index Cond: (c1 = v1t1.c1)
3241 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3243 ----------------------------------
3245 Hash Cond: (r4t1.c1 = r4t1.c1)
3246 -> Seq Scan on t1 r4t1
3248 -> Seq Scan on t1 r4t1
3251 /*+Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)*/
3252 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3253 INFO: hint syntax error at or near "HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3254 DETAIL: Relation name "r4t1" is ambiguous.
3255 INFO: hint syntax error at or near "Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3256 DETAIL: Relation name "r4t1" is ambiguous.
3267 ------------------------------------------
3269 -> Index Scan using t1_i1 on t1 r4t1
3270 -> Bitmap Heap Scan on t1 r4t1
3271 Recheck Cond: (c1 = r4t1.c1)
3272 -> Bitmap Index Scan on t1_i1
3273 Index Cond: (c1 = r4t1.c1)
3277 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3279 ----------------------------------
3281 Hash Cond: (r4t1.c1 = r5t1.c1)
3282 -> Seq Scan on t1 r4t1
3284 -> Seq Scan on t1 r5t1
3287 /*+Leading(r4t1 r5t1)NestLoop(r4t1 r5t1)SeqScan(r4t1)BitmapScan(r5t1)*/
3288 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3300 ------------------------------------------
3302 -> Seq Scan on t1 r4t1
3303 -> Bitmap Heap Scan on t1 r5t1
3304 Recheck Cond: (c1 = r4t1.c1)
3305 -> Bitmap Index Scan on t1_i1
3306 Index Cond: (c1 = r4t1.c1)
3310 ---- No. A-11-1 psql command
3312 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3319 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3335 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3351 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3359 ---- No. A-12-4 PL/pgSQL function
3362 CREATE OR REPLACE FUNCTION f1() RETURNS SETOF text LANGUAGE plpgsql AS $$
3366 FOR r IN EXPLAIN SELECT c4 FROM s1.t1 WHERE t1.c1 = 1
3368 RETURN NEXT r; -- return current row of SELECT
3375 ----------------------------------------------------------------
3376 Index Scan using t1_i1 on t1 (cost=0.00..8.27 rows=1 width=3)
3377 Index Cond: (c1 = 1)
3396 CONTEXT: PL/pgSQL function "f1" line 5 at FOR over SELECT rows
3398 ---------------------------------------------------
3399 Seq Scan on t1 (cost=0.00..18.50 rows=1 width=3)
3404 /*+SeqScan(t1)*/CREATE OR REPLACE FUNCTION f1() RETURNS SETOF text LANGUAGE plpgsql AS $$
3408 /*+SeqScan(t1)*/FOR r IN EXPLAIN /*+SeqScan(t1)*/SELECT c4 FROM s1.t1 WHERE t1.c1 = 1
3410 /*+SeqScan(t1)*/RETURN NEXT r; -- return current row of SELECT
3412 /*+SeqScan(t1)*/RETURN;
3417 ----------------------------------------------------------------
3418 Index Scan using t1_i1 on t1 (cost=0.00..8.27 rows=1 width=3)
3419 Index Cond: (c1 = 1)
3423 ---- No. A-12-1 reset of global variable of core at the error
3424 ---- No. A-12-2 reset of global variable of original at the error
3426 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3428 ------------------------------------
3430 Merge Cond: (t1.c1 = t2.c1)
3431 -> Index Scan using t1_i1 on t1
3437 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3438 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3439 INFO: hint syntax error at or near "NestLoop(t1 t1)"
3440 DETAIL: Relation name "t1" is duplicated.
3445 Set(enable_seqscan off)
3446 Set(geqo_threshold 100)
3452 EXPLAIN (COSTS false) EXECUTE p1;
3454 ------------------------------------
3456 Merge Cond: (t1.c1 = t2.c1)
3460 -> Index Scan using t2_i1 on t2
3465 SELECT name, setting FROM settings;
3467 ---------------------------+-----------
3470 geqo_generations | 0
3473 geqo_selection_bias | 2
3475 constraint_exclusion | partition
3476 cursor_tuple_fraction | 0.1
3477 default_statistics_target | 100
3478 from_collapse_limit | 8
3479 join_collapse_limit | 8
3480 cpu_index_tuple_cost | 0.005
3481 cpu_operator_cost | 0.0025
3482 cpu_tuple_cost | 0.01
3483 effective_cache_size | 16384
3484 random_page_cost | 4
3486 enable_bitmapscan | on
3488 enable_hashjoin | on
3489 enable_indexscan | on
3490 enable_material | on
3491 enable_mergejoin | on
3492 enable_nestloop | on
3496 client_min_messages | log
3499 SET pg_hint_plan.parse_messages TO error;
3500 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3501 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3502 ERROR: hint syntax error at or near "NestLoop(t1 t1)"
3503 DETAIL: Relation name "t1" is duplicated.
3504 SELECT name, setting FROM settings;
3506 ---------------------------+-----------
3509 geqo_generations | 0
3512 geqo_selection_bias | 2
3514 constraint_exclusion | partition
3515 cursor_tuple_fraction | 0.1
3516 default_statistics_target | 100
3517 from_collapse_limit | 8
3518 join_collapse_limit | 8
3519 cpu_index_tuple_cost | 0.005
3520 cpu_operator_cost | 0.0025
3521 cpu_tuple_cost | 0.01
3522 effective_cache_size | 16384
3523 random_page_cost | 4
3525 enable_bitmapscan | on
3527 enable_hashjoin | on
3528 enable_indexscan | on
3529 enable_material | on
3530 enable_mergejoin | on
3531 enable_nestloop | on
3535 client_min_messages | log
3538 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3539 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3544 Set(enable_seqscan off)
3545 Set(geqo_threshold 100)
3551 ------------------------------------
3553 Merge Cond: (t1.c1 = t2.c1)
3557 -> Index Scan using t2_i1 on t2
3562 SELECT name, setting FROM settings;
3564 ---------------------------+-----------
3567 geqo_generations | 0
3570 geqo_selection_bias | 2
3572 constraint_exclusion | partition
3573 cursor_tuple_fraction | 0.1
3574 default_statistics_target | 100
3575 from_collapse_limit | 8
3576 join_collapse_limit | 8
3577 cpu_index_tuple_cost | 0.005
3578 cpu_operator_cost | 0.0025
3579 cpu_tuple_cost | 0.01
3580 effective_cache_size | 16384
3581 random_page_cost | 4
3583 enable_bitmapscan | on
3585 enable_hashjoin | on
3586 enable_indexscan | on
3587 enable_material | on
3588 enable_mergejoin | on
3589 enable_nestloop | on
3593 client_min_messages | log
3596 SET pg_hint_plan.parse_messages TO error;
3597 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3598 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3599 ERROR: hint syntax error at or near "NestLoop(t1 t1)"
3600 DETAIL: Relation name "t1" is duplicated.
3601 SELECT name, setting FROM settings;
3603 ---------------------------+-----------
3606 geqo_generations | 0
3609 geqo_selection_bias | 2
3611 constraint_exclusion | partition
3612 cursor_tuple_fraction | 0.1
3613 default_statistics_target | 100
3614 from_collapse_limit | 8
3615 join_collapse_limit | 8
3616 cpu_index_tuple_cost | 0.005
3617 cpu_operator_cost | 0.0025
3618 cpu_tuple_cost | 0.01
3619 effective_cache_size | 16384
3620 random_page_cost | 4
3622 enable_bitmapscan | on
3624 enable_hashjoin | on
3625 enable_indexscan | on
3626 enable_material | on
3627 enable_mergejoin | on
3628 enable_nestloop | on
3632 client_min_messages | log
3635 EXPLAIN (COSTS false) EXECUTE p1;
3637 ------------------------------------
3639 Merge Cond: (t1.c1 = t2.c1)
3643 -> Index Scan using t2_i1 on t2
3648 SELECT name, setting FROM settings;
3650 ---------------------------+-----------
3653 geqo_generations | 0
3656 geqo_selection_bias | 2
3658 constraint_exclusion | partition
3659 cursor_tuple_fraction | 0.1
3660 default_statistics_target | 100
3661 from_collapse_limit | 8
3662 join_collapse_limit | 8
3663 cpu_index_tuple_cost | 0.005
3664 cpu_operator_cost | 0.0025
3665 cpu_tuple_cost | 0.01
3666 effective_cache_size | 16384
3667 random_page_cost | 4
3669 enable_bitmapscan | on
3671 enable_hashjoin | on
3672 enable_indexscan | on
3673 enable_material | on
3674 enable_mergejoin | on
3675 enable_nestloop | on
3679 client_min_messages | log
3682 SET pg_hint_plan.parse_messages TO error;
3683 EXPLAIN (COSTS false) EXECUTE p2;
3684 ERROR: prepared statement "p2" does not exist
3685 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3686 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3691 Set(enable_seqscan off)
3692 Set(geqo_threshold 100)
3698 ------------------------------------
3700 Merge Cond: (t1.c1 = t2.c1)
3704 -> Index Scan using t2_i1 on t2
3707 EXPLAIN (COSTS false) EXECUTE p1;
3709 ------------------------------------
3711 Merge Cond: (t1.c1 = t2.c1)
3715 -> Index Scan using t2_i1 on t2
3718 SELECT name, setting FROM settings;
3720 ---------------------------+-----------
3723 geqo_generations | 0
3726 geqo_selection_bias | 2
3728 constraint_exclusion | partition
3729 cursor_tuple_fraction | 0.1
3730 default_statistics_target | 100
3731 from_collapse_limit | 8
3732 join_collapse_limit | 8
3733 cpu_index_tuple_cost | 0.005
3734 cpu_operator_cost | 0.0025
3735 cpu_tuple_cost | 0.01
3736 effective_cache_size | 16384
3737 random_page_cost | 4
3739 enable_bitmapscan | on
3741 enable_hashjoin | on
3742 enable_indexscan | on
3743 enable_material | on
3744 enable_mergejoin | on
3745 enable_nestloop | on
3749 client_min_messages | log
3754 SELECT name, setting FROM settings;
3756 ---------------------------+-----------
3759 geqo_generations | 0
3762 geqo_selection_bias | 2
3764 constraint_exclusion | partition
3765 cursor_tuple_fraction | 0.1
3766 default_statistics_target | 100
3767 from_collapse_limit | 8
3768 join_collapse_limit | 8
3769 cpu_index_tuple_cost | 0.005
3770 cpu_operator_cost | 0.0025
3771 cpu_tuple_cost | 0.01
3772 effective_cache_size | 16384
3773 random_page_cost | 4
3775 enable_bitmapscan | on
3777 enable_hashjoin | on
3778 enable_indexscan | on
3779 enable_material | on
3780 enable_mergejoin | on
3781 enable_nestloop | on
3785 client_min_messages | log
3788 SET pg_hint_plan.parse_messages TO error;
3789 EXPLAIN (COSTS false) EXECUTE p2;
3790 ERROR: prepared statement "p2" does not exist
3791 EXPLAIN (COSTS false) EXECUTE p1;
3793 ------------------------------------
3795 Merge Cond: (t1.c1 = t2.c1)
3799 -> Index Scan using t2_i1 on t2
3802 SELECT name, setting FROM settings;
3804 ---------------------------+-----------
3807 geqo_generations | 0
3810 geqo_selection_bias | 2
3812 constraint_exclusion | partition
3813 cursor_tuple_fraction | 0.1
3814 default_statistics_target | 100
3815 from_collapse_limit | 8
3816 join_collapse_limit | 8
3817 cpu_index_tuple_cost | 0.005
3818 cpu_operator_cost | 0.0025
3819 cpu_tuple_cost | 0.01
3820 effective_cache_size | 16384
3821 random_page_cost | 4
3823 enable_bitmapscan | on
3825 enable_hashjoin | on
3826 enable_indexscan | on
3827 enable_material | on
3828 enable_mergejoin | on
3829 enable_nestloop | on
3833 client_min_messages | log
3837 SET pg_hint_plan.parse_messages TO LOG;
3839 ---- No. A-12-3 effective range of the hint
3841 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3843 ------------------------------------
3845 Merge Cond: (t1.c1 = t2.c1)
3846 -> Index Scan using t1_i1 on t1
3853 SET enable_indexscan TO off;
3854 SET enable_mergejoin TO off;
3855 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3857 ------------------------------
3859 Hash Cond: (t1.c1 = t2.c1)
3865 SELECT name, setting FROM settings;
3867 ---------------------------+-----------
3870 geqo_generations | 0
3873 geqo_selection_bias | 2
3875 constraint_exclusion | partition
3876 cursor_tuple_fraction | 0.1
3877 default_statistics_target | 100
3878 from_collapse_limit | 8
3879 join_collapse_limit | 8
3880 cpu_index_tuple_cost | 0.005
3881 cpu_operator_cost | 0.0025
3882 cpu_tuple_cost | 0.01
3883 effective_cache_size | 16384
3884 random_page_cost | 4
3886 enable_bitmapscan | on
3888 enable_hashjoin | on
3889 enable_indexscan | off
3890 enable_material | on
3891 enable_mergejoin | off
3892 enable_nestloop | on
3896 client_min_messages | log
3899 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3900 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3906 Set(enable_indexscan on)
3907 Set(geqo_threshold 100)
3913 ------------------------------------
3915 Merge Cond: (t1.c1 = t2.c1)
3916 -> Index Scan using t1_i1 on t1
3917 -> Index Scan using t2_i1 on t2
3920 SELECT name, setting FROM settings;
3922 ---------------------------+-----------
3925 geqo_generations | 0
3928 geqo_selection_bias | 2
3930 constraint_exclusion | partition
3931 cursor_tuple_fraction | 0.1
3932 default_statistics_target | 100
3933 from_collapse_limit | 8
3934 join_collapse_limit | 8
3935 cpu_index_tuple_cost | 0.005
3936 cpu_operator_cost | 0.0025
3937 cpu_tuple_cost | 0.01
3938 effective_cache_size | 16384
3939 random_page_cost | 4
3941 enable_bitmapscan | on
3943 enable_hashjoin | on
3944 enable_indexscan | off
3945 enable_material | on
3946 enable_mergejoin | off
3947 enable_nestloop | on
3951 client_min_messages | log
3954 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3956 ------------------------------
3958 Hash Cond: (t1.c1 = t2.c1)
3965 SET enable_indexscan TO off;
3966 SET enable_mergejoin TO off;
3967 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3969 ------------------------------
3971 Hash Cond: (t1.c1 = t2.c1)
3977 SELECT name, setting FROM settings;
3979 ---------------------------+-----------
3982 geqo_generations | 0
3985 geqo_selection_bias | 2
3987 constraint_exclusion | partition
3988 cursor_tuple_fraction | 0.1
3989 default_statistics_target | 100
3990 from_collapse_limit | 8
3991 join_collapse_limit | 8
3992 cpu_index_tuple_cost | 0.005
3993 cpu_operator_cost | 0.0025
3994 cpu_tuple_cost | 0.01
3995 effective_cache_size | 16384
3996 random_page_cost | 4
3998 enable_bitmapscan | on
4000 enable_hashjoin | on
4001 enable_indexscan | off
4002 enable_material | on
4003 enable_mergejoin | off
4004 enable_nestloop | on
4008 client_min_messages | log
4012 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4013 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4019 Set(enable_indexscan on)
4020 Set(geqo_threshold 100)
4026 ------------------------------------
4028 Merge Cond: (t1.c1 = t2.c1)
4029 -> Index Scan using t1_i1 on t1
4030 -> Index Scan using t2_i1 on t2
4035 SELECT name, setting FROM settings;
4037 ---------------------------+-----------
4040 geqo_generations | 0
4043 geqo_selection_bias | 2
4045 constraint_exclusion | partition
4046 cursor_tuple_fraction | 0.1
4047 default_statistics_target | 100
4048 from_collapse_limit | 8
4049 join_collapse_limit | 8
4050 cpu_index_tuple_cost | 0.005
4051 cpu_operator_cost | 0.0025
4052 cpu_tuple_cost | 0.01
4053 effective_cache_size | 16384
4054 random_page_cost | 4
4056 enable_bitmapscan | on
4058 enable_hashjoin | on
4059 enable_indexscan | off
4060 enable_material | on
4061 enable_mergejoin | off
4062 enable_nestloop | on
4066 client_min_messages | log
4069 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4071 ------------------------------
4073 Hash Cond: (t1.c1 = t2.c1)
4081 SET enable_indexscan TO off;
4082 SET enable_mergejoin TO off;
4083 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4085 ------------------------------
4087 Hash Cond: (t1.c1 = t2.c1)
4093 SELECT name, setting FROM settings;
4095 ---------------------------+-----------
4098 geqo_generations | 0
4101 geqo_selection_bias | 2
4103 constraint_exclusion | partition
4104 cursor_tuple_fraction | 0.1
4105 default_statistics_target | 100
4106 from_collapse_limit | 8
4107 join_collapse_limit | 8
4108 cpu_index_tuple_cost | 0.005
4109 cpu_operator_cost | 0.0025
4110 cpu_tuple_cost | 0.01
4111 effective_cache_size | 16384
4112 random_page_cost | 4
4114 enable_bitmapscan | on
4116 enable_hashjoin | on
4117 enable_indexscan | off
4118 enable_material | on
4119 enable_mergejoin | off
4120 enable_nestloop | on
4124 client_min_messages | log
4127 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4128 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4134 Set(enable_indexscan on)
4135 Set(geqo_threshold 100)
4141 ------------------------------------
4143 Merge Cond: (t1.c1 = t2.c1)
4144 -> Index Scan using t1_i1 on t1
4145 -> Index Scan using t2_i1 on t2
4149 LOAD 'pg_hint_plan';
4150 SELECT name, setting FROM settings;
4152 ---------------------------+-----------
4155 geqo_generations | 0
4158 geqo_selection_bias | 2
4160 constraint_exclusion | partition
4161 cursor_tuple_fraction | 0.1
4162 default_statistics_target | 100
4163 from_collapse_limit | 8
4164 join_collapse_limit | 8
4165 cpu_index_tuple_cost | 0.005
4166 cpu_operator_cost | 0.0025
4167 cpu_tuple_cost | 0.01
4168 effective_cache_size | 16384
4169 random_page_cost | 4
4171 enable_bitmapscan | on
4173 enable_hashjoin | on
4174 enable_indexscan | on
4175 enable_material | on
4176 enable_mergejoin | on
4177 enable_nestloop | on
4181 client_min_messages | notice
4184 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4186 ------------------------------------
4188 Merge Cond: (t1.c1 = t2.c1)
4189 -> Index Scan using t1_i1 on t1
4195 SET pg_hint_plan.enable_hint TO on;
4196 SET pg_hint_plan.debug_print TO on;
4197 SET client_min_messages TO LOG;
4198 SET search_path TO public;