OSDN Git Service

No.L-2-3の試験のPG9.1用予測結果を更新した。
[pghintplan/pg_hint_plan.git] / expected / ut-A-9.2.out
1 LOAD 'pg_hint_plan';
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;
6 ----
7 ---- No.A-1-1 install
8 ---- No.A-2-1 uninstall
9 ----
10 -- No.A-1-1-3
11 CREATE EXTENSION pg_hint_plan;
12 -- No.A-1-2-3
13 DROP EXTENSION pg_hint_plan;
14 -- No.A-1-1-4
15 CREATE EXTENSION pg_hint_plan SCHEMA other_name;
16 ERROR:  extension "pg_hint_plan" must be installed in schema "hint_plan"
17 CREATE EXTENSION pg_hint_plan;
18 ----
19 ---- No. A-5-1 comment pattern
20 ----
21 -- No. A-5-1-1
22 /*+SeqScan(t1)*/
23 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
24 LOG:  pg_hint_plan:
25 used hint:
26 SeqScan(t1)
27 not used hint:
28 duplication hint:
29 error hint:
30
31      QUERY PLAN     
32 --------------------
33  Seq Scan on t1
34    Filter: (c1 = 1)
35 (2 rows)
36
37 -- No. A-5-1-2
38 /* +SeqScan(t1)*/
39 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
40           QUERY PLAN          
41 ------------------------------
42  Index Scan using t1_i1 on t1
43    Index Cond: (c1 = 1)
44 (2 rows)
45
46 -- No. A-5-1-3
47 --+SeqScan(t1)
48 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
49           QUERY PLAN          
50 ------------------------------
51  Index Scan using t1_i1 on t1
52    Index Cond: (c1 = 1)
53 (2 rows)
54
55 -- No. A-5-1-4
56 --+SeqScan(t1)
57 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
58           QUERY PLAN          
59 ------------------------------
60  Index Scan using t1_i1 on t1
61    Index Cond: (c1 = 1)
62 (2 rows)
63
64 -- No. A-5-1-5
65 -- +SeqScan(t1)
66 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
67           QUERY PLAN          
68 ------------------------------
69  Index Scan using t1_i1 on t1
70    Index Cond: (c1 = 1)
71 (2 rows)
72
73 -- No. A-5-1-6
74 --SeqScan(t1)
75 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
76           QUERY PLAN          
77 ------------------------------
78  Index Scan using t1_i1 on t1
79    Index Cond: (c1 = 1)
80 (2 rows)
81
82 -- No. A-5-1-7
83 /*+SeqScan(t1) /* nest comment */ */
84 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
85 INFO:  hint syntax error at or near "/* nest comment */ */
86 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
87 DETAIL:  Nested block comments are not supported.
88           QUERY PLAN          
89 ------------------------------
90  Index Scan using t1_i1 on t1
91    Index Cond: (c1 = 1)
92 (2 rows)
93
94 -- No. A-5-1-8
95 /* +SeqScan(t1) /* nest comment */ */
96 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
97           QUERY PLAN          
98 ------------------------------
99  Index Scan using t1_i1 on t1
100    Index Cond: (c1 = 1)
101 (2 rows)
102
103 -- No. A-5-1-9
104 /*SeqScan(t1) /* nest comment */ */
105 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
106           QUERY PLAN          
107 ------------------------------
108  Index Scan using t1_i1 on t1
109    Index Cond: (c1 = 1)
110 (2 rows)
111
112 ----
113 ---- No. A-5-2 hint position
114 ----
115 -- No. A-5-2-1
116 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
117             QUERY PLAN             
118 -----------------------------------
119  Index Only Scan using t1_i1 on t1
120    Index Cond: (c1 = 1)
121 (2 rows)
122
123 /*+SeqScan(t1)*/
124 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1 WHERE t1.c1 = 1;
125 LOG:  pg_hint_plan:
126 used hint:
127 SeqScan(t1)
128 not used hint:
129 duplication hint:
130 error hint:
131
132      QUERY PLAN     
133 --------------------
134  Seq Scan on t1
135    Filter: (c1 = 1)
136 (2 rows)
137
138 -- No. A-5-2-2
139 EXPLAIN (COSTS false) SELECT c1, c2 AS c_2 /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
140 LOG:  pg_hint_plan:
141 used hint:
142 SeqScan(t1)
143 not used hint:
144 duplication hint:
145 error hint:
146
147      QUERY PLAN     
148 --------------------
149  Seq Scan on t1
150    Filter: (c1 = 1)
151 (2 rows)
152
153 -- No. A-5-2-3
154 EXPLAIN (COSTS false) SELECT c1 AS "c1"/*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
155             QUERY PLAN             
156 -----------------------------------
157  Index Only Scan using t1_i1 on t1
158    Index Cond: (c1 = 1)
159 (2 rows)
160
161 -- No. A-5-2-4
162 EXPLAIN (COSTS false) SELECT * /*+SeqScan(t1)*/ FROM s1.t1 WHERE t1.c1 = 1;
163           QUERY PLAN          
164 ------------------------------
165  Index Scan using t1_i1 on t1
166    Index Cond: (c1 = 1)
167 (2 rows)
168
169 ----
170 ---- No. A-6-1 hint's table definition
171 ----
172 SET pg_hint_plan.enable_hint_table TO on;
173 -- No. A-6-1-1
174 \d hint_plan.hints
175        Table "hint_plan.hints"
176       Column       | Type | Modifiers 
177 -------------------+------+-----------
178  norm_query_string | text | not null
179  application_name  | text | not null
180  hints             | text | not null
181 Indexes:
182     "hints_pkey" PRIMARY KEY, btree (norm_query_string, application_name)
183
184 ----
185 ---- No. A-6-2 search condition
186 ----
187 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
188           QUERY PLAN          
189 ------------------------------
190  Index Scan using t1_i1 on t1
191    Index Cond: (c1 = 1)
192 (2 rows)
193
194 -- No. A-6-2-1
195 INSERT INTO hint_plan.hints VALUES (
196         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
197         '',
198         'SeqScan(t1)');
199 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
200 LOG:  pg_hint_plan:
201 used hint:
202 SeqScan(t1)
203 not used hint:
204 duplication hint:
205 error hint:
206
207      QUERY PLAN     
208 --------------------
209  Seq Scan on t1
210    Filter: (c1 = 1)
211 (2 rows)
212
213 -- No. A-6-2-2
214 INSERT INTO hint_plan.hints VALUES (
215         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
216         'psql',
217         'BitmapScan(t1)');
218 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
219 LOG:  pg_hint_plan:
220 used hint:
221 SeqScan(t1)
222 not used hint:
223 duplication hint:
224 error hint:
225
226      QUERY PLAN     
227 --------------------
228  Seq Scan on t1
229    Filter: (c1 = 1)
230 (2 rows)
231
232 TRUNCATE hint_plan.hints;
233 -- No. A-6-2-3
234 INSERT INTO hint_plan.hints VALUES (
235         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
236         'dummy_application_name',
237         'SeqScan(t1)'
238 );
239 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
240           QUERY PLAN          
241 ------------------------------
242  Index Scan using t1_i1 on t1
243    Index Cond: (c1 = 1)
244 (2 rows)
245
246 TRUNCATE hint_plan.hints;
247 -- No. A-6-2-4
248 INSERT INTO hint_plan.hints VALUES (
249         'EXPLAIN (COSTS false) SELECT * FROM s1.t1;',
250         '',
251         'SeqScan(t1)'
252 );
253 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
254           QUERY PLAN          
255 ------------------------------
256  Index Scan using t1_i1 on t1
257    Index Cond: (c1 = 1)
258 (2 rows)
259
260 TRUNCATE hint_plan.hints;
261 ----
262 ---- No. A-6-3 number of constant
263 ----
264 -- No. A-6-3-1
265 INSERT INTO hint_plan.hints VALUES (
266         'EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;',
267         '',
268         'SeqScan(t1)'
269 );
270 EXPLAIN (COSTS false) SELECT c1 FROM s1.t1;
271 LOG:  pg_hint_plan:
272 used hint:
273 SeqScan(t1)
274 not used hint:
275 duplication hint:
276 error hint:
277
278    QUERY PLAN   
279 ----------------
280  Seq Scan on t1
281 (1 row)
282
283 TRUNCATE hint_plan.hints;
284 -- No. A-6-3-2
285 INSERT INTO hint_plan.hints VALUES (
286         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
287         '',
288         'SeqScan(t1)'
289 );
290 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
291 LOG:  pg_hint_plan:
292 used hint:
293 SeqScan(t1)
294 not used hint:
295 duplication hint:
296 error hint:
297
298      QUERY PLAN     
299 --------------------
300  Seq Scan on t1
301    Filter: (c1 = 1)
302 (2 rows)
303
304 TRUNCATE hint_plan.hints;
305 -- No. A-6-3-3
306 INSERT INTO hint_plan.hints VALUES (
307         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ? OR t1.c1 = ?;',
308         '',
309         'SeqScan(t1)'
310 );
311 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 OR t1.c1 = 0;
312 LOG:  pg_hint_plan:
313 used hint:
314 SeqScan(t1)
315 not used hint:
316 duplication hint:
317 error hint:
318
319             QUERY PLAN            
320 ----------------------------------
321  Seq Scan on t1
322    Filter: ((c1 = 1) OR (c1 = 0))
323 (2 rows)
324
325 TRUNCATE hint_plan.hints;
326 SET pg_hint_plan.enable_hint_table TO off;
327 ----
328 ---- No. A-7-2 hint delimiter
329 ----
330 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
331           QUERY PLAN          
332 ------------------------------
333  Index Scan using t1_i1 on t1
334    Index Cond: (c1 = 1)
335 (2 rows)
336
337 -- No. A-7-2-1
338 -- No. A-7-2-2
339 -- No. A-7-2-3
340 -- No. A-7-2-4
341 -- No. A-7-2-5
342 -- No. A-7-2-6
343 -- No. A-7-2-7
344 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
345 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
346 LOG:  pg_hint_plan:
347 used hint:
348 Set(enable_bitmapscan off)
349 Set(enable_indexscan off)
350 not used hint:
351 duplication hint:
352 error hint:
353
354      QUERY PLAN     
355 --------------------
356  Seq Scan on t1
357    Filter: (c1 = 1)
358 (2 rows)
359
360 -- No. A-7-2-8
361 /*+ Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
362 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
363 LOG:  pg_hint_plan:
364 used hint:
365 Set(enable_bitmapscan off)
366 Set(enable_indexscan off)
367 not used hint:
368 duplication hint:
369 error hint:
370
371      QUERY PLAN     
372 --------------------
373  Seq Scan on t1
374    Filter: (c1 = 1)
375 (2 rows)
376
377 -- No. A-7-2-9
378 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off") */
379 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
380 LOG:  pg_hint_plan:
381 used hint:
382 Set(enable_bitmapscan off)
383 Set(enable_indexscan off)
384 not used hint:
385 duplication hint:
386 error hint:
387
388      QUERY PLAN     
389 --------------------
390  Seq Scan on t1
391    Filter: (c1 = 1)
392 (2 rows)
393
394 -- No. A-7-2-10
395 /*+ Set (enable_indexscan"off") Set (enable_bitmapscan"off")*/
396 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
397 LOG:  pg_hint_plan:
398 used hint:
399 Set(enable_bitmapscan off)
400 Set(enable_indexscan off)
401 not used hint:
402 duplication hint:
403 error hint:
404
405      QUERY PLAN     
406 --------------------
407  Seq Scan on t1
408    Filter: (c1 = 1)
409 (2 rows)
410
411 -- No. A-7-2-11
412 /*+Set ( enable_indexscan"off")Set ( enable_bitmapscan"off")*/
413 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
414 LOG:  pg_hint_plan:
415 used hint:
416 Set(enable_bitmapscan off)
417 Set(enable_indexscan off)
418 not used hint:
419 duplication hint:
420 error hint:
421
422      QUERY PLAN     
423 --------------------
424  Seq Scan on t1
425    Filter: (c1 = 1)
426 (2 rows)
427
428 -- No. A-7-2-12
429 /*+Set(enable_indexscan"off" ) Set(enable_bitmapscan"off" ) */
430 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
431 LOG:  pg_hint_plan:
432 used hint:
433 Set(enable_bitmapscan off)
434 Set(enable_indexscan off)
435 not used hint:
436 duplication hint:
437 error hint:
438
439      QUERY PLAN     
440 --------------------
441  Seq Scan on t1
442    Filter: (c1 = 1)
443 (2 rows)
444
445 -- No. A-7-2-13
446 /*+Set( enable_indexscan "off" )Set( enable_bitmapscan "off" )*/
447 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
448 LOG:  pg_hint_plan:
449 used hint:
450 Set(enable_bitmapscan off)
451 Set(enable_indexscan off)
452 not used hint:
453 duplication hint:
454 error hint:
455
456      QUERY PLAN     
457 --------------------
458  Seq Scan on t1
459    Filter: (c1 = 1)
460 (2 rows)
461
462 -- No. A-7-2-14
463 /*+ Set ( enable_indexscan "off" ) Set ( enable_bitmapscan "off" ) */
464 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
465 LOG:  pg_hint_plan:
466 used hint:
467 Set(enable_bitmapscan off)
468 Set(enable_indexscan off)
469 not used hint:
470 duplication hint:
471 error hint:
472
473      QUERY PLAN     
474 --------------------
475  Seq Scan on t1
476    Filter: (c1 = 1)
477 (2 rows)
478
479 -- No. A-7-2-15
480 /*+     Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
481 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
482 LOG:  pg_hint_plan:
483 used hint:
484 Set(enable_bitmapscan off)
485 Set(enable_indexscan off)
486 not used hint:
487 duplication hint:
488 error hint:
489
490      QUERY PLAN     
491 --------------------
492  Seq Scan on t1
493    Filter: (c1 = 1)
494 (2 rows)
495
496 -- No. A-7-2-16
497 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")        */
498 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
499 LOG:  pg_hint_plan:
500 used hint:
501 Set(enable_bitmapscan off)
502 Set(enable_indexscan off)
503 not used hint:
504 duplication hint:
505 error hint:
506
507      QUERY PLAN     
508 --------------------
509  Seq Scan on t1
510    Filter: (c1 = 1)
511 (2 rows)
512
513 -- No. A-7-2-17
514 /*+     Set     (enable_indexscan"off") Set     (enable_bitmapscan"off")*/
515 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
516 LOG:  pg_hint_plan:
517 used hint:
518 Set(enable_bitmapscan off)
519 Set(enable_indexscan off)
520 not used hint:
521 duplication hint:
522 error hint:
523
524      QUERY PLAN     
525 --------------------
526  Seq Scan on t1
527    Filter: (c1 = 1)
528 (2 rows)
529
530 -- No. A-7-2-18
531 /*+Set  (       enable_indexscan"off")Set       (       enable_bitmapscan"off")*/
532 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
533 LOG:  pg_hint_plan:
534 used hint:
535 Set(enable_bitmapscan off)
536 Set(enable_indexscan off)
537 not used hint:
538 duplication hint:
539 error hint:
540
541      QUERY PLAN     
542 --------------------
543  Seq Scan on t1
544    Filter: (c1 = 1)
545 (2 rows)
546
547 -- No. A-7-2-19
548 /*+Set(enable_indexscan"off"    )       Set(enable_bitmapscan"off"      )       */
549 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
550 LOG:  pg_hint_plan:
551 used hint:
552 Set(enable_bitmapscan off)
553 Set(enable_indexscan off)
554 not used hint:
555 duplication hint:
556 error hint:
557
558      QUERY PLAN     
559 --------------------
560  Seq Scan on t1
561    Filter: (c1 = 1)
562 (2 rows)
563
564 -- No. A-7-2-20
565 /*+Set( enable_indexscan        "off"   )Set(   enable_bitmapscan       "off"   )*/
566 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
567 LOG:  pg_hint_plan:
568 used hint:
569 Set(enable_bitmapscan off)
570 Set(enable_indexscan off)
571 not used hint:
572 duplication hint:
573 error hint:
574
575      QUERY PLAN     
576 --------------------
577  Seq Scan on t1
578    Filter: (c1 = 1)
579 (2 rows)
580
581 -- No. A-7-2-21
582 /*+     Set     (       enable_indexscan        "off"   )       Set     (       enable_bitmapscan       "off"   )       */
583 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
584 LOG:  pg_hint_plan:
585 used hint:
586 Set(enable_bitmapscan off)
587 Set(enable_indexscan off)
588 not used hint:
589 duplication hint:
590 error hint:
591
592      QUERY PLAN     
593 --------------------
594  Seq Scan on t1
595    Filter: (c1 = 1)
596 (2 rows)
597
598 -- No. A-7-2-22
599 /*+
600 Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
601 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
602 LOG:  pg_hint_plan:
603 used hint:
604 Set(enable_bitmapscan off)
605 Set(enable_indexscan off)
606 not used hint:
607 duplication hint:
608 error hint:
609
610      QUERY PLAN     
611 --------------------
612  Seq Scan on t1
613    Filter: (c1 = 1)
614 (2 rows)
615
616 -- No. A-7-2-23
617 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")
618 */
619 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
620 LOG:  pg_hint_plan:
621 used hint:
622 Set(enable_bitmapscan off)
623 Set(enable_indexscan off)
624 not used hint:
625 duplication hint:
626 error hint:
627
628      QUERY PLAN     
629 --------------------
630  Seq Scan on t1
631    Filter: (c1 = 1)
632 (2 rows)
633
634 -- No. A-7-2-24
635 /*+
636 Set
637 (enable_indexscan"off")
638 Set
639 (enable_bitmapscan"off")*/
640 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
641 LOG:  pg_hint_plan:
642 used hint:
643 Set(enable_bitmapscan off)
644 Set(enable_indexscan off)
645 not used hint:
646 duplication hint:
647 error hint:
648
649      QUERY PLAN     
650 --------------------
651  Seq Scan on t1
652    Filter: (c1 = 1)
653 (2 rows)
654
655 -- No. A-7-2-25
656 /*+Set
657 (
658 enable_indexscan"off")Set
659 (
660 enable_bitmapscan"off")*/
661 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
662 LOG:  pg_hint_plan:
663 used hint:
664 Set(enable_bitmapscan off)
665 Set(enable_indexscan off)
666 not used hint:
667 duplication hint:
668 error hint:
669
670      QUERY PLAN     
671 --------------------
672  Seq Scan on t1
673    Filter: (c1 = 1)
674 (2 rows)
675
676 -- No. A-7-2-26
677 /*+Set(enable_indexscan"off"
678 )
679 Set(enable_bitmapscan"off"
680 )
681 */
682 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
683 LOG:  pg_hint_plan:
684 used hint:
685 Set(enable_bitmapscan off)
686 Set(enable_indexscan off)
687 not used hint:
688 duplication hint:
689 error hint:
690
691      QUERY PLAN     
692 --------------------
693  Seq Scan on t1
694    Filter: (c1 = 1)
695 (2 rows)
696
697 -- No. A-7-2-27
698 /*+Set(
699 enable_indexscan
700 "off"
701 )Set(
702 enable_bitmapscan
703 "off"
704 )*/
705 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
706 LOG:  pg_hint_plan:
707 used hint:
708 Set(enable_bitmapscan off)
709 Set(enable_indexscan off)
710 not used hint:
711 duplication hint:
712 error hint:
713
714      QUERY PLAN     
715 --------------------
716  Seq Scan on t1
717    Filter: (c1 = 1)
718 (2 rows)
719
720 -- No. A-7-2-28
721 /*+
722 Set
723 (
724 enable_indexscan
725 "off"
726 )
727 Set
728 (
729 enable_bitmapscan
730 "off"
731 )
732 */
733 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
734 LOG:  pg_hint_plan:
735 used hint:
736 Set(enable_bitmapscan off)
737 Set(enable_indexscan off)
738 not used hint:
739 duplication hint:
740 error hint:
741
742      QUERY PLAN     
743 --------------------
744  Seq Scan on t1
745    Filter: (c1 = 1)
746 (2 rows)
747
748 -- No. A-7-2-29
749 /*+     
750          Set(enable_indexscan"off")Set(enable_bitmapscan"off")*/
751 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
752 LOG:  pg_hint_plan:
753 used hint:
754 Set(enable_bitmapscan off)
755 Set(enable_indexscan off)
756 not used hint:
757 duplication hint:
758 error hint:
759
760      QUERY PLAN     
761 --------------------
762  Seq Scan on t1
763    Filter: (c1 = 1)
764 (2 rows)
765
766 -- No. A-7-2-30
767 /*+Set(enable_indexscan"off")Set(enable_bitmapscan"off")        
768          */
769 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
770 LOG:  pg_hint_plan:
771 used hint:
772 Set(enable_bitmapscan off)
773 Set(enable_indexscan off)
774 not used hint:
775 duplication hint:
776 error hint:
777
778      QUERY PLAN     
779 --------------------
780  Seq Scan on t1
781    Filter: (c1 = 1)
782 (2 rows)
783
784 -- No. A-7-2-31
785 /*+     
786          Set    
787          (enable_indexscan"off")        
788          Set    
789          (enable_bitmapscan"off")*/
790 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
791 LOG:  pg_hint_plan:
792 used hint:
793 Set(enable_bitmapscan off)
794 Set(enable_indexscan off)
795 not used hint:
796 duplication hint:
797 error hint:
798
799      QUERY PLAN     
800 --------------------
801  Seq Scan on t1
802    Filter: (c1 = 1)
803 (2 rows)
804
805 -- No. A-7-2-32
806 /*+Set  
807          (      
808          enable_indexscan"off")Set      
809          (      
810          enable_bitmapscan"off")*/
811 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
812 LOG:  pg_hint_plan:
813 used hint:
814 Set(enable_bitmapscan off)
815 Set(enable_indexscan off)
816 not used hint:
817 duplication hint:
818 error hint:
819
820      QUERY PLAN     
821 --------------------
822  Seq Scan on t1
823    Filter: (c1 = 1)
824 (2 rows)
825
826 -- No. A-7-2-33
827 /*+Set(enable_indexscan"off"    
828          )      
829          Set(enable_bitmapscan"off"     
830          )      
831          */
832 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
833 LOG:  pg_hint_plan:
834 used hint:
835 Set(enable_bitmapscan off)
836 Set(enable_indexscan off)
837 not used hint:
838 duplication hint:
839 error hint:
840
841      QUERY PLAN     
842 --------------------
843  Seq Scan on t1
844    Filter: (c1 = 1)
845 (2 rows)
846
847 -- No. A-7-2-34
848 /*+Set(         
849          enable_indexscan       
850          "off"  
851          )Set(  
852          enable_bitmapscan      
853          "off"  
854          )*/
855 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
856 LOG:  pg_hint_plan:
857 used hint:
858 Set(enable_bitmapscan off)
859 Set(enable_indexscan off)
860 not used hint:
861 duplication hint:
862 error hint:
863
864      QUERY PLAN     
865 --------------------
866  Seq Scan on t1
867    Filter: (c1 = 1)
868 (2 rows)
869
870 -- No. A-7-2-35
871 /*+     
872          Set    
873          (      
874          enable_indexscan       
875          "off"  
876          )      
877          Set    
878          (      
879          enable_bitmapscan      
880          "off"  
881          )      
882          */
883 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
884 LOG:  pg_hint_plan:
885 used hint:
886 Set(enable_bitmapscan off)
887 Set(enable_indexscan off)
888 not used hint:
889 duplication hint:
890 error hint:
891
892      QUERY PLAN     
893 --------------------
894  Seq Scan on t1
895    Filter: (c1 = 1)
896 (2 rows)
897
898 ----
899 ---- No. A-7-3 hint object pattern
900 ---- No. A-9-2 message object pattern
901 ----
902 -- No. A-7-3-1
903 -- No. A-9-2-1
904 /*+SeqScan(t)*/
905 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
906 LOG:  pg_hint_plan:
907 used hint:
908 SeqScan(t)
909 not used hint:
910 duplication hint:
911 error hint:
912
913      QUERY PLAN     
914 --------------------
915  Seq Scan on t1 t
916    Filter: (c1 = 1)
917 (2 rows)
918
919 /*+SeqScan(ttt)*/
920 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
921 LOG:  pg_hint_plan:
922 used hint:
923 SeqScan(ttt)
924 not used hint:
925 duplication hint:
926 error hint:
927
928      QUERY PLAN     
929 --------------------
930  Seq Scan on t1 ttt
931    Filter: (c1 = 1)
932 (2 rows)
933
934 /*+SeqScan("t")*/
935 EXPLAIN (COSTS false) SELECT * FROM s1.t1 t WHERE t.c1 = 1;
936 LOG:  pg_hint_plan:
937 used hint:
938 SeqScan(t)
939 not used hint:
940 duplication hint:
941 error hint:
942
943      QUERY PLAN     
944 --------------------
945  Seq Scan on t1 t
946    Filter: (c1 = 1)
947 (2 rows)
948
949 /*+SeqScan("ttt")*/
950 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ttt WHERE ttt.c1 = 1;
951 LOG:  pg_hint_plan:
952 used hint:
953 SeqScan(ttt)
954 not used hint:
955 duplication hint:
956 error hint:
957
958      QUERY PLAN     
959 --------------------
960  Seq Scan on t1 ttt
961    Filter: (c1 = 1)
962 (2 rows)
963
964 -- No. A-7-3-2
965 -- No. A-9-2-2
966 /*+SeqScan(T)*/
967 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
968 LOG:  pg_hint_plan:
969 used hint:
970 SeqScan(T)
971 not used hint:
972 duplication hint:
973 error hint:
974
975      QUERY PLAN     
976 --------------------
977  Seq Scan on t1 "T"
978    Filter: (c1 = 1)
979 (2 rows)
980
981 /*+SeqScan(TTT)*/
982 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
983 LOG:  pg_hint_plan:
984 used hint:
985 SeqScan(TTT)
986 not used hint:
987 duplication hint:
988 error hint:
989
990       QUERY PLAN      
991 ----------------------
992  Seq Scan on t1 "TTT"
993    Filter: (c1 = 1)
994 (2 rows)
995
996 /*+SeqScan("T")*/
997 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "T" WHERE "T".c1 = 1;
998 LOG:  pg_hint_plan:
999 used hint:
1000 SeqScan(T)
1001 not used hint:
1002 duplication hint:
1003 error hint:
1004
1005      QUERY PLAN     
1006 --------------------
1007  Seq Scan on t1 "T"
1008    Filter: (c1 = 1)
1009 (2 rows)
1010
1011 /*+SeqScan("TTT")*/
1012 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "TTT" WHERE "TTT".c1 = 1;
1013 LOG:  pg_hint_plan:
1014 used hint:
1015 SeqScan(TTT)
1016 not used hint:
1017 duplication hint:
1018 error hint:
1019
1020       QUERY PLAN      
1021 ----------------------
1022  Seq Scan on t1 "TTT"
1023    Filter: (c1 = 1)
1024 (2 rows)
1025
1026 -- No. A-7-3-3
1027 -- No. A-9-2-3
1028 /*+SeqScan(()*/
1029 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
1030 INFO:  hint syntax error at or near "()"
1031 DETAIL:  Zero-length delimited string.
1032             QUERY PLAN            
1033 ----------------------------------
1034  Index Scan using t1_i1 on t1 "("
1035    Index Cond: (c1 = 1)
1036 (2 rows)
1037
1038 /*+SeqScan("(")*/
1039 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
1040 LOG:  pg_hint_plan:
1041 used hint:
1042 SeqScan("(")
1043 not used hint:
1044 duplication hint:
1045 error hint:
1046
1047      QUERY PLAN     
1048 --------------------
1049  Seq Scan on t1 "("
1050    Filter: (c1 = 1)
1051 (2 rows)
1052
1053 -- No. A-7-3-4
1054 -- No. A-9-2-4
1055 /*+SeqScan())*/
1056 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
1057 INFO:  hint syntax error at or near ")"
1058 DETAIL:  SeqScan hint requires a relation.
1059 INFO:  hint syntax error at or near ")"
1060 DETAIL:  Unrecognized hint keyword ")".
1061 LOG:  pg_hint_plan:
1062 used hint:
1063 not used hint:
1064 duplication hint:
1065 error hint:
1066 SeqScan()
1067
1068             QUERY PLAN            
1069 ----------------------------------
1070  Index Scan using t1_i1 on t1 ")"
1071    Index Cond: (c1 = 1)
1072 (2 rows)
1073
1074 /*+SeqScan(")")*/
1075 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
1076 LOG:  pg_hint_plan:
1077 used hint:
1078 SeqScan(")")
1079 not used hint:
1080 duplication hint:
1081 error hint:
1082
1083      QUERY PLAN     
1084 --------------------
1085  Seq Scan on t1 ")"
1086    Filter: (c1 = 1)
1087 (2 rows)
1088
1089 /*+SeqScan(")))")*/
1090 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
1091 LOG:  pg_hint_plan:
1092 used hint:
1093 SeqScan(")))")
1094 not used hint:
1095 duplication hint:
1096 error hint:
1097
1098       QUERY PLAN      
1099 ----------------------
1100  Seq Scan on t1 ")))"
1101    Filter: (c1 = 1)
1102 (2 rows)
1103
1104 -- No. A-7-3-5
1105 -- No. A-9-2-5
1106 /*+SeqScan(")*/
1107 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
1108 INFO:  hint syntax error at or near ""
1109 DETAIL:  Unterminated quoted string.
1110             QUERY PLAN             
1111 -----------------------------------
1112  Index Scan using t1_i1 on t1 """"
1113    Index Cond: (c1 = 1)
1114 (2 rows)
1115
1116 /*+SeqScan("""")*/
1117 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
1118 LOG:  pg_hint_plan:
1119 used hint:
1120 SeqScan("""")
1121 not used hint:
1122 duplication hint:
1123 error hint:
1124
1125      QUERY PLAN      
1126 ---------------------
1127  Seq Scan on t1 """"
1128    Filter: (c1 = 1)
1129 (2 rows)
1130
1131 /*+SeqScan("""""""")*/
1132 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
1133 LOG:  pg_hint_plan:
1134 used hint:
1135 SeqScan("""""""")
1136 not used hint:
1137 duplication hint:
1138 error hint:
1139
1140        QUERY PLAN        
1141 -------------------------
1142  Seq Scan on t1 """"""""
1143    Filter: (c1 = 1)
1144 (2 rows)
1145
1146 -- No. A-7-3-6
1147 -- No. A-9-2-6
1148 /*+SeqScan( )*/
1149 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1150 INFO:  hint syntax error at or near ""
1151 DETAIL:  SeqScan hint requires a relation.
1152 LOG:  pg_hint_plan:
1153 used hint:
1154 not used hint:
1155 duplication hint:
1156 error hint:
1157 SeqScan()
1158
1159             QUERY PLAN            
1160 ----------------------------------
1161  Index Scan using t1_i1 on t1 " "
1162    Index Cond: (c1 = 1)
1163 (2 rows)
1164
1165 /*+SeqScan(" ")*/
1166 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
1167 LOG:  pg_hint_plan:
1168 used hint:
1169 SeqScan(" ")
1170 not used hint:
1171 duplication hint:
1172 error hint:
1173
1174      QUERY PLAN     
1175 --------------------
1176  Seq Scan on t1 " "
1177    Filter: (c1 = 1)
1178 (2 rows)
1179
1180 /*+SeqScan("   ")*/
1181 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "   " WHERE "   ".c1 = 1;
1182 LOG:  pg_hint_plan:
1183 used hint:
1184 SeqScan("   ")
1185 not used hint:
1186 duplication hint:
1187 error hint:
1188
1189       QUERY PLAN      
1190 ----------------------
1191  Seq Scan on t1 "   "
1192    Filter: (c1 = 1)
1193 (2 rows)
1194
1195 -- No. A-7-3-7
1196 -- No. A-9-2-7
1197 /*+SeqScan(     )*/
1198 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "     " WHERE "       ".c1 = 1;
1199 INFO:  hint syntax error at or near ""
1200 DETAIL:  SeqScan hint requires a relation.
1201 LOG:  pg_hint_plan:
1202 used hint:
1203 not used hint:
1204 duplication hint:
1205 error hint:
1206 SeqScan()
1207
1208             QUERY PLAN             
1209 -----------------------------------
1210  Index Scan using t1_i1 on t1 "  "
1211    Index Cond: (c1 = 1)
1212 (2 rows)
1213
1214 /*+SeqScan("    ")*/
1215 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "     " WHERE "       ".c1 = 1;
1216 LOG:  pg_hint_plan:
1217 used hint:
1218 SeqScan("       ")
1219 not used hint:
1220 duplication hint:
1221 error hint:
1222
1223         QUERY PLAN         
1224 ---------------------------
1225  Seq Scan on t1 "        "
1226    Filter: (c1 = 1)
1227 (2 rows)
1228
1229 /*+SeqScan("                    ")*/
1230 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "                     " WHERE "                       ".c1 = 1;
1231 LOG:  pg_hint_plan:
1232 used hint:
1233 SeqScan("                       ")
1234 not used hint:
1235 duplication hint:
1236 error hint:
1237
1238                 QUERY PLAN                 
1239 -------------------------------------------
1240  Seq Scan on t1 "                        "
1241    Filter: (c1 = 1)
1242 (2 rows)
1243
1244 -- No. A-7-3-8
1245 -- No. A-9-2-8
1246 /*+SeqScan(
1247 )*/
1248 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1249 " WHERE "
1250 ".c1 = 1;
1251 INFO:  hint syntax error at or near ""
1252 DETAIL:  SeqScan hint requires a relation.
1253 LOG:  pg_hint_plan:
1254 used hint:
1255 not used hint:
1256 duplication hint:
1257 error hint:
1258 SeqScan()
1259
1260            QUERY PLAN           
1261 --------------------------------
1262  Index Scan using t1_i1 on t1 "
1263  "
1264    Index Cond: (c1 = 1)
1265 (3 rows)
1266
1267 /*+SeqScan("
1268 ")*/
1269 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1270 " WHERE "
1271 ".c1 = 1;
1272 LOG:  pg_hint_plan:
1273 used hint:
1274 SeqScan("
1275 ")
1276 not used hint:
1277 duplication hint:
1278 error hint:
1279
1280      QUERY PLAN     
1281 --------------------
1282  Seq Scan on t1 "
1283  "
1284    Filter: (c1 = 1)
1285 (3 rows)
1286
1287 /*+SeqScan("
1288
1289
1290 ")*/
1291 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1292
1293
1294 " WHERE "
1295
1296
1297 ".c1 = 1;
1298 LOG:  pg_hint_plan:
1299 used hint:
1300 SeqScan("
1301
1302
1303 ")
1304 not used hint:
1305 duplication hint:
1306 error hint:
1307
1308      QUERY PLAN     
1309 --------------------
1310  Seq Scan on t1 "
1311  
1312  
1313  "
1314    Filter: (c1 = 1)
1315 (5 rows)
1316
1317 -- No. A-7-3-9
1318 -- No. A-9-2-9
1319 /*+SeqScan(Set)*/
1320 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1321 LOG:  pg_hint_plan:
1322 used hint:
1323 SeqScan(Set)
1324 not used hint:
1325 duplication hint:
1326 error hint:
1327
1328       QUERY PLAN      
1329 ----------------------
1330  Seq Scan on t1 "Set"
1331    Filter: (c1 = 1)
1332 (2 rows)
1333
1334 /*+SeqScan("Set")*/
1335 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1336 LOG:  pg_hint_plan:
1337 used hint:
1338 SeqScan(Set)
1339 not used hint:
1340 duplication hint:
1341 error hint:
1342
1343       QUERY PLAN      
1344 ----------------------
1345  Seq Scan on t1 "Set"
1346    Filter: (c1 = 1)
1347 (2 rows)
1348
1349 /*+SeqScan("Set SeqScan Leading")*/
1350 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
1351 LOG:  pg_hint_plan:
1352 used hint:
1353 SeqScan("Set SeqScan Leading")
1354 not used hint:
1355 duplication hint:
1356 error hint:
1357
1358               QUERY PLAN              
1359 --------------------------------------
1360  Seq Scan on t1 "Set SeqScan Leading"
1361    Filter: (c1 = 1)
1362 (2 rows)
1363
1364 -- No. A-7-3-10
1365 -- No. A-9-2-10
1366 /*+SeqScan(あ)*/
1367 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1368 LOG:  pg_hint_plan:
1369 used hint:
1370 SeqScan(あ)
1371 not used hint:
1372 duplication hint:
1373 error hint:
1374
1375      QUERY PLAN      
1376 ---------------------
1377  Seq Scan on t1 "あ"
1378    Filter: (c1 = 1)
1379 (2 rows)
1380
1381 /*+SeqScan(あいう)*/
1382 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1383 LOG:  pg_hint_plan:
1384 used hint:
1385 SeqScan(あいう)
1386 not used hint:
1387 duplication hint:
1388 error hint:
1389
1390        QUERY PLAN        
1391 -------------------------
1392  Seq Scan on t1 "あいう"
1393    Filter: (c1 = 1)
1394 (2 rows)
1395
1396 /*+SeqScan("あ")*/
1397 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1398 LOG:  pg_hint_plan:
1399 used hint:
1400 SeqScan(あ)
1401 not used hint:
1402 duplication hint:
1403 error hint:
1404
1405      QUERY PLAN      
1406 ---------------------
1407  Seq Scan on t1 "あ"
1408    Filter: (c1 = 1)
1409 (2 rows)
1410
1411 /*+SeqScan("あいう")*/
1412 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1413 LOG:  pg_hint_plan:
1414 used hint:
1415 SeqScan(あいう)
1416 not used hint:
1417 duplication hint:
1418 error hint:
1419
1420        QUERY PLAN        
1421 -------------------------
1422  Seq Scan on t1 "あいう"
1423    Filter: (c1 = 1)
1424 (2 rows)
1425
1426 -- No. A-7-3-11
1427 -- No. A-9-2-11
1428 /*+SeqScan(/**/)*/
1429 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
1430 INFO:  hint syntax error at or near "/**/)*/
1431 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
1432 DETAIL:  Nested block comments are not supported.
1433              QUERY PLAN              
1434 -------------------------------------
1435  Index Scan using t1_i1 on t1 "/**/"
1436    Index Cond: (c1 = 1)
1437 (2 rows)
1438
1439 /*+SeqScan(/**//**//**/)*/
1440 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
1441 INFO:  hint syntax error at or near "/**//**//**/)*/
1442 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
1443 DETAIL:  Nested block comments are not supported.
1444                  QUERY PLAN                  
1445 ---------------------------------------------
1446  Index Scan using t1_i1 on t1 "/**//**//**/"
1447    Index Cond: (c1 = 1)
1448 (2 rows)
1449
1450 -- No. A-7-3-12
1451 -- No. A-9-2-12
1452 /*+SeqScan("tT()""      
1453 Set/**/あ")*/
1454 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1455 Set/**/あ" WHERE "tT()""       
1456 Set/**/あ".c1 = 1;
1457 INFO:  hint syntax error at or near "/**/あ")*/
1458 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1459 Set/**/あ" WHERE "tT()""       
1460 Set/**/あ".c1 = 1;"
1461 DETAIL:  Nested block comments are not supported.
1462                 QUERY PLAN                
1463 ------------------------------------------
1464  Index Scan using t1_i1 on t1 "tT()""    
1465  Set/**/あ"
1466    Index Cond: (c1 = 1)
1467 (3 rows)
1468
1469 --"
1470 /*+SeqScan("tT()""      
1471 Setあ")*/
1472 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1473 Setあ" WHERE "tT()""   
1474 Setあ".c1 = 1;
1475 LOG:  pg_hint_plan:
1476 used hint:
1477 SeqScan("tT()""         
1478 Setあ")
1479 not used hint:
1480 duplication hint:
1481 error hint:
1482
1483         QUERY PLAN        
1484 --------------------------
1485  Seq Scan on t1 "tT()""  
1486  Setあ"
1487    Filter: (c1 = 1)
1488 (3 rows)
1489
1490 ----
1491 ---- No. A-7-4 hint parse error
1492 ----
1493 -- No. A-7-4-1
1494 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1495 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1496 INFO:  hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1497 DETAIL:  Opening parenthesis is necessary.
1498 LOG:  pg_hint_plan:
1499 used hint:
1500 Set(enable_indexscan off)
1501 not used hint:
1502 duplication hint:
1503 error hint:
1504
1505             QUERY PLAN            
1506 ----------------------------------
1507  Bitmap Heap Scan on t1
1508    Recheck Cond: (c1 = 1)
1509    ->  Bitmap Index Scan on t1_i1
1510          Index Cond: (c1 = 1)
1511 (4 rows)
1512
1513 -- No. A-7-4-2
1514 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
1515 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1516 INFO:  hint syntax error at or near "(enable_bitmapscan off)SeqScan(t1)"
1517 DETAIL:  Zero-length delimited string.
1518 LOG:  pg_hint_plan:
1519 used hint:
1520 Set(enable_indexscan off)
1521 not used hint:
1522 duplication hint:
1523 error hint:
1524
1525             QUERY PLAN            
1526 ----------------------------------
1527  Bitmap Heap Scan on t1
1528    Recheck Cond: (c1 = 1)
1529    ->  Bitmap Index Scan on t1_i1
1530          Index Cond: (c1 = 1)
1531 (4 rows)
1532
1533 -- No. A-7-4-3
1534 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
1535 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1536 INFO:  hint syntax error at or near ""
1537 DETAIL:  Unterminated quoted string.
1538 LOG:  pg_hint_plan:
1539 used hint:
1540 Set(enable_indexscan off)
1541 not used hint:
1542 duplication hint:
1543 error hint:
1544
1545             QUERY PLAN            
1546 ----------------------------------
1547  Bitmap Heap Scan on t1
1548    Recheck Cond: (c1 = 1)
1549    ->  Bitmap Index Scan on t1_i1
1550          Index Cond: (c1 = 1)
1551 (4 rows)
1552
1553 -- No. A-7-4-4
1554 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
1555 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1556 INFO:  hint syntax error at or near ")Set(enable_bitmapscan off)"
1557 DETAIL:  Zero-length delimited string.
1558 LOG:  pg_hint_plan:
1559 used hint:
1560 Set(enable_indexscan off)
1561 not used hint:
1562 duplication hint:
1563 error hint:
1564
1565             QUERY PLAN            
1566 ----------------------------------
1567  Bitmap Heap Scan on t1
1568    Recheck Cond: (c1 = 1)
1569    ->  Bitmap Index Scan on t1_i1
1570          Index Cond: (c1 = 1)
1571 (4 rows)
1572
1573 -- No. A-7-4-5
1574 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1575 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1576 INFO:  hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1577 DETAIL:  Unrecognized hint keyword "NoSet".
1578 LOG:  pg_hint_plan:
1579 used hint:
1580 Set(enable_indexscan off)
1581 not used hint:
1582 duplication hint:
1583 error hint:
1584
1585             QUERY PLAN            
1586 ----------------------------------
1587  Bitmap Heap Scan on t1
1588    Recheck Cond: (c1 = 1)
1589    ->  Bitmap Index Scan on t1_i1
1590          Index Cond: (c1 = 1)
1591 (4 rows)
1592
1593 -- No. A-7-4-6
1594 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1595 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1596 INFO:  hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1597 DETAIL:  Unrecognized hint keyword ""Set"".
1598 LOG:  pg_hint_plan:
1599 used hint:
1600 Set(enable_indexscan off)
1601 not used hint:
1602 duplication hint:
1603 error hint:
1604
1605             QUERY PLAN            
1606 ----------------------------------
1607  Bitmap Heap Scan on t1
1608    Recheck Cond: (c1 = 1)
1609    ->  Bitmap Index Scan on t1_i1
1610          Index Cond: (c1 = 1)
1611 (4 rows)
1612
1613 -- No. A-7-4-7
1614 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1615 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1616 INFO:  hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1617 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
1618 DETAIL:  Nested block comments are not supported.
1619           QUERY PLAN          
1620 ------------------------------
1621  Index Scan using t1_i1 on t1
1622    Index Cond: (c1 = 1)
1623 (2 rows)
1624
1625 ----
1626 ---- No. A-8-1 original GUC parameter
1627 ----
1628 -- No. A-8-1-1
1629 SET ROLE super_user;
1630 SET pg_hint_plan.debug_print TO off;
1631 SHOW pg_hint_plan.enable_hint;
1632  pg_hint_plan.enable_hint 
1633 --------------------------
1634  on
1635 (1 row)
1636
1637 SHOW pg_hint_plan.debug_print;
1638  pg_hint_plan.debug_print 
1639 --------------------------
1640  off
1641 (1 row)
1642
1643 SHOW pg_hint_plan.parse_messages;
1644  pg_hint_plan.parse_messages 
1645 -----------------------------
1646  info
1647 (1 row)
1648
1649 SET pg_hint_plan.enable_hint TO off;
1650 SET pg_hint_plan.debug_print TO on;
1651 SET pg_hint_plan.parse_messages TO error;
1652 SHOW pg_hint_plan.enable_hint;
1653  pg_hint_plan.enable_hint 
1654 --------------------------
1655  off
1656 (1 row)
1657
1658 SHOW pg_hint_plan.debug_print;
1659  pg_hint_plan.debug_print 
1660 --------------------------
1661  on
1662 (1 row)
1663
1664 SHOW pg_hint_plan.parse_messages;
1665  pg_hint_plan.parse_messages 
1666 -----------------------------
1667  error
1668 (1 row)
1669
1670 RESET pg_hint_plan.enable_hint;
1671 RESET pg_hint_plan.debug_print;
1672 RESET pg_hint_plan.parse_messages;
1673 SHOW pg_hint_plan.enable_hint;
1674  pg_hint_plan.enable_hint 
1675 --------------------------
1676  on
1677 (1 row)
1678
1679 SHOW pg_hint_plan.debug_print;
1680  pg_hint_plan.debug_print 
1681 --------------------------
1682  off
1683 (1 row)
1684
1685 SHOW pg_hint_plan.parse_messages;
1686  pg_hint_plan.parse_messages 
1687 -----------------------------
1688  info
1689 (1 row)
1690
1691 -- No. A-8-1-2
1692 SET ROLE normal_user;
1693 SHOW pg_hint_plan.enable_hint;
1694  pg_hint_plan.enable_hint 
1695 --------------------------
1696  on
1697 (1 row)
1698
1699 SHOW pg_hint_plan.debug_print;
1700  pg_hint_plan.debug_print 
1701 --------------------------
1702  off
1703 (1 row)
1704
1705 SHOW pg_hint_plan.parse_messages;
1706  pg_hint_plan.parse_messages 
1707 -----------------------------
1708  info
1709 (1 row)
1710
1711 SET pg_hint_plan.enable_hint TO off;
1712 SET pg_hint_plan.debug_print TO on;
1713 SET pg_hint_plan.parse_messages TO error;
1714 SHOW pg_hint_plan.enable_hint;
1715  pg_hint_plan.enable_hint 
1716 --------------------------
1717  off
1718 (1 row)
1719
1720 SHOW pg_hint_plan.debug_print;
1721  pg_hint_plan.debug_print 
1722 --------------------------
1723  on
1724 (1 row)
1725
1726 SHOW pg_hint_plan.parse_messages;
1727  pg_hint_plan.parse_messages 
1728 -----------------------------
1729  error
1730 (1 row)
1731
1732 RESET pg_hint_plan.enable_hint;
1733 RESET pg_hint_plan.debug_print;
1734 RESET pg_hint_plan.parse_messages;
1735 SHOW pg_hint_plan.enable_hint;
1736  pg_hint_plan.enable_hint 
1737 --------------------------
1738  on
1739 (1 row)
1740
1741 SHOW pg_hint_plan.debug_print;
1742  pg_hint_plan.debug_print 
1743 --------------------------
1744  off
1745 (1 row)
1746
1747 SHOW pg_hint_plan.parse_messages;
1748  pg_hint_plan.parse_messages 
1749 -----------------------------
1750  info
1751 (1 row)
1752
1753 RESET ROLE;
1754 ----
1755 ---- No. A-8-2 original GUC parameter pg_hint_plan.enable_hint
1756 ----
1757 -- No. A-8-2-1
1758 SET pg_hint_plan.enable_hint TO on;
1759 SHOW pg_hint_plan.enable_hint;
1760  pg_hint_plan.enable_hint 
1761 --------------------------
1762  on
1763 (1 row)
1764
1765 /*+Set(enable_indexscan off)*/
1766 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1767             QUERY PLAN            
1768 ----------------------------------
1769  Bitmap Heap Scan on t1
1770    Recheck Cond: (c1 = 1)
1771    ->  Bitmap Index Scan on t1_i1
1772          Index Cond: (c1 = 1)
1773 (4 rows)
1774
1775 -- No. A-8-2-2
1776 SET pg_hint_plan.enable_hint TO off;
1777 SHOW pg_hint_plan.enable_hint;
1778  pg_hint_plan.enable_hint 
1779 --------------------------
1780  off
1781 (1 row)
1782
1783 /*+Set(enable_indexscan off)*/
1784 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1785           QUERY PLAN          
1786 ------------------------------
1787  Index Scan using t1_i1 on t1
1788    Index Cond: (c1 = 1)
1789 (2 rows)
1790
1791 -- No. A-8-2-3
1792 SET pg_hint_plan.enable_hint TO DEFAULT;
1793 SHOW pg_hint_plan.enable_hint;
1794  pg_hint_plan.enable_hint 
1795 --------------------------
1796  on
1797 (1 row)
1798
1799 /*+Set(enable_indexscan off)*/
1800 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1801             QUERY PLAN            
1802 ----------------------------------
1803  Bitmap Heap Scan on t1
1804    Recheck Cond: (c1 = 1)
1805    ->  Bitmap Index Scan on t1_i1
1806          Index Cond: (c1 = 1)
1807 (4 rows)
1808
1809 -- No. A-8-2-4
1810 SET pg_hint_plan.enable_hint TO enable;
1811 ERROR:  parameter "pg_hint_plan.enable_hint" requires a Boolean value
1812 SHOW pg_hint_plan.enable_hint;
1813  pg_hint_plan.enable_hint 
1814 --------------------------
1815  on
1816 (1 row)
1817
1818 ----
1819 ---- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
1820 ----
1821 -- No. A-8-3-1
1822 SET pg_hint_plan.debug_print TO on;
1823 SHOW pg_hint_plan.debug_print;
1824  pg_hint_plan.debug_print 
1825 --------------------------
1826  on
1827 (1 row)
1828
1829 /*+Set(enable_indexscan off)*/
1830 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1831 LOG:  pg_hint_plan:
1832 used hint:
1833 Set(enable_indexscan off)
1834 not used hint:
1835 duplication hint:
1836 error hint:
1837
1838             QUERY PLAN            
1839 ----------------------------------
1840  Bitmap Heap Scan on t1
1841    Recheck Cond: (c1 = 1)
1842    ->  Bitmap Index Scan on t1_i1
1843          Index Cond: (c1 = 1)
1844 (4 rows)
1845
1846 -- No. A-8-3-2
1847 SET pg_hint_plan.debug_print TO off;
1848 SHOW pg_hint_plan.debug_print;
1849  pg_hint_plan.debug_print 
1850 --------------------------
1851  off
1852 (1 row)
1853
1854 /*+Set(enable_indexscan off)*/
1855 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1856             QUERY PLAN            
1857 ----------------------------------
1858  Bitmap Heap Scan on t1
1859    Recheck Cond: (c1 = 1)
1860    ->  Bitmap Index Scan on t1_i1
1861          Index Cond: (c1 = 1)
1862 (4 rows)
1863
1864 -- No. A-8-3-3
1865 SET pg_hint_plan.debug_print TO DEFAULT;
1866 SHOW pg_hint_plan.debug_print;
1867  pg_hint_plan.debug_print 
1868 --------------------------
1869  off
1870 (1 row)
1871
1872 /*+Set(enable_indexscan off)*/
1873 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1874             QUERY PLAN            
1875 ----------------------------------
1876  Bitmap Heap Scan on t1
1877    Recheck Cond: (c1 = 1)
1878    ->  Bitmap Index Scan on t1_i1
1879          Index Cond: (c1 = 1)
1880 (4 rows)
1881
1882 -- No. A-8-3-4
1883 SET pg_hint_plan.debug_print TO enable;
1884 ERROR:  parameter "pg_hint_plan.debug_print" requires a Boolean value
1885 SHOW pg_hint_plan.debug_print;
1886  pg_hint_plan.debug_print 
1887 --------------------------
1888  off
1889 (1 row)
1890
1891 ----
1892 ---- No. A-8-4 original GUC parameter pg_hint_plan.parse_messages
1893 ----
1894 SET client_min_messages TO debug5;
1895 DEBUG:  CommitTransactionCommand
1896 DEBUG:  CommitTransaction
1897 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1898 -- No. A-8-4-1
1899 SET pg_hint_plan.parse_messages TO debug5;
1900 DEBUG:  StartTransactionCommand
1901 DEBUG:  StartTransaction
1902 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1903 DEBUG:  ProcessUtility
1904 DEBUG:  CommitTransactionCommand
1905 DEBUG:  CommitTransaction
1906 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1907 SHOW pg_hint_plan.parse_messages;
1908 DEBUG:  StartTransactionCommand
1909 DEBUG:  StartTransaction
1910 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1911 DEBUG:  ProcessUtility
1912 DEBUG:  CommitTransactionCommand
1913 DEBUG:  CommitTransaction
1914 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1915  pg_hint_plan.parse_messages 
1916 -----------------------------
1917  debug5
1918 (1 row)
1919
1920 /*+Set*/SELECT 1;
1921 DEBUG:  StartTransactionCommand
1922 DEBUG:  StartTransaction
1923 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1924 DEBUG:  hint syntax error at or near ""
1925 DETAIL:  Opening parenthesis is necessary.
1926 DEBUG:  CommitTransactionCommand
1927 DEBUG:  CommitTransaction
1928 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1929  ?column? 
1930 ----------
1931         1
1932 (1 row)
1933
1934 SET client_min_messages TO debug4;
1935 DEBUG:  StartTransactionCommand
1936 DEBUG:  StartTransaction
1937 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1938 DEBUG:  ProcessUtility
1939 DEBUG:  CommitTransactionCommand
1940 DEBUG:  CommitTransaction
1941 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1942 /*+Set*/SELECT 1;
1943 DEBUG:  StartTransactionCommand
1944 DEBUG:  StartTransaction
1945 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1946 DEBUG:  CommitTransactionCommand
1947 DEBUG:  CommitTransaction
1948 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1949  ?column? 
1950 ----------
1951         1
1952 (1 row)
1953
1954 -- No. A-8-4-2
1955 SET pg_hint_plan.parse_messages TO debug4;
1956 DEBUG:  StartTransactionCommand
1957 DEBUG:  StartTransaction
1958 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1959 DEBUG:  ProcessUtility
1960 DEBUG:  CommitTransactionCommand
1961 DEBUG:  CommitTransaction
1962 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1963 SHOW pg_hint_plan.parse_messages;
1964 DEBUG:  StartTransactionCommand
1965 DEBUG:  StartTransaction
1966 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1967 DEBUG:  ProcessUtility
1968 DEBUG:  CommitTransactionCommand
1969 DEBUG:  CommitTransaction
1970 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1971  pg_hint_plan.parse_messages 
1972 -----------------------------
1973  debug4
1974 (1 row)
1975
1976 /*+Set*/SELECT 1;
1977 DEBUG:  StartTransactionCommand
1978 DEBUG:  StartTransaction
1979 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1980 DEBUG:  hint syntax error at or near ""
1981 DETAIL:  Opening parenthesis is necessary.
1982 DEBUG:  CommitTransactionCommand
1983 DEBUG:  CommitTransaction
1984 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1985  ?column? 
1986 ----------
1987         1
1988 (1 row)
1989
1990 SET client_min_messages TO debug3;
1991 DEBUG:  StartTransactionCommand
1992 DEBUG:  StartTransaction
1993 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1994 DEBUG:  ProcessUtility
1995 DEBUG:  CommitTransactionCommand
1996 DEBUG:  CommitTransaction
1997 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1998 /*+Set*/SELECT 1;
1999 DEBUG:  StartTransactionCommand
2000 DEBUG:  StartTransaction
2001 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2002 DEBUG:  CommitTransactionCommand
2003 DEBUG:  CommitTransaction
2004 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2005  ?column? 
2006 ----------
2007         1
2008 (1 row)
2009
2010 -- No. A-8-4-3
2011 SET pg_hint_plan.parse_messages TO debug3;
2012 DEBUG:  StartTransactionCommand
2013 DEBUG:  StartTransaction
2014 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2015 DEBUG:  ProcessUtility
2016 DEBUG:  CommitTransactionCommand
2017 DEBUG:  CommitTransaction
2018 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2019 SHOW pg_hint_plan.parse_messages;
2020 DEBUG:  StartTransactionCommand
2021 DEBUG:  StartTransaction
2022 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2023 DEBUG:  ProcessUtility
2024 DEBUG:  CommitTransactionCommand
2025 DEBUG:  CommitTransaction
2026 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2027  pg_hint_plan.parse_messages 
2028 -----------------------------
2029  debug3
2030 (1 row)
2031
2032 /*+Set*/SELECT 1;
2033 DEBUG:  StartTransactionCommand
2034 DEBUG:  StartTransaction
2035 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2036 DEBUG:  hint syntax error at or near ""
2037 DETAIL:  Opening parenthesis is necessary.
2038 DEBUG:  CommitTransactionCommand
2039 DEBUG:  CommitTransaction
2040 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2041  ?column? 
2042 ----------
2043         1
2044 (1 row)
2045
2046 SET client_min_messages TO debug2;
2047 DEBUG:  StartTransactionCommand
2048 DEBUG:  StartTransaction
2049 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2050 DEBUG:  ProcessUtility
2051 /*+Set*/SELECT 1;
2052  ?column? 
2053 ----------
2054         1
2055 (1 row)
2056
2057 -- No. A-8-4-4
2058 SET pg_hint_plan.parse_messages TO debug2;
2059 SHOW pg_hint_plan.parse_messages;
2060  pg_hint_plan.parse_messages 
2061 -----------------------------
2062  debug
2063 (1 row)
2064
2065 /*+Set*/SELECT 1;
2066 DEBUG:  hint syntax error at or near ""
2067 DETAIL:  Opening parenthesis is necessary.
2068  ?column? 
2069 ----------
2070         1
2071 (1 row)
2072
2073 SET client_min_messages TO debug1;
2074 /*+Set*/SELECT 1;
2075  ?column? 
2076 ----------
2077         1
2078 (1 row)
2079
2080 -- No. A-8-4-5
2081 SET pg_hint_plan.parse_messages TO debug1;
2082 SHOW pg_hint_plan.parse_messages;
2083  pg_hint_plan.parse_messages 
2084 -----------------------------
2085  debug1
2086 (1 row)
2087
2088 /*+Set*/SELECT 1;
2089 DEBUG:  hint syntax error at or near ""
2090 DETAIL:  Opening parenthesis is necessary.
2091  ?column? 
2092 ----------
2093         1
2094 (1 row)
2095
2096 SET client_min_messages TO log;
2097 /*+Set*/SELECT 1;
2098  ?column? 
2099 ----------
2100         1
2101 (1 row)
2102
2103 -- No. A-8-4-6
2104 SET pg_hint_plan.parse_messages TO log;
2105 SHOW pg_hint_plan.parse_messages;
2106  pg_hint_plan.parse_messages 
2107 -----------------------------
2108  log
2109 (1 row)
2110
2111 /*+Set*/SELECT 1;
2112 LOG:  hint syntax error at or near ""
2113 DETAIL:  Opening parenthesis is necessary.
2114  ?column? 
2115 ----------
2116         1
2117 (1 row)
2118
2119 SET client_min_messages TO info;
2120 /*+Set*/SELECT 1;
2121  ?column? 
2122 ----------
2123         1
2124 (1 row)
2125
2126 -- No. A-8-4-7
2127 SET pg_hint_plan.parse_messages TO info;
2128 SHOW pg_hint_plan.parse_messages;
2129  pg_hint_plan.parse_messages 
2130 -----------------------------
2131  info
2132 (1 row)
2133
2134 /*+Set*/SELECT 1;
2135 INFO:  hint syntax error at or near ""
2136 DETAIL:  Opening parenthesis is necessary.
2137  ?column? 
2138 ----------
2139         1
2140 (1 row)
2141
2142 SET client_min_messages TO notice;
2143 /*+Set*/SELECT 1;
2144 INFO:  hint syntax error at or near ""
2145 DETAIL:  Opening parenthesis is necessary.
2146  ?column? 
2147 ----------
2148         1
2149 (1 row)
2150
2151 -- No. A-8-4-8
2152 SET pg_hint_plan.parse_messages TO notice;
2153 SHOW pg_hint_plan.parse_messages;
2154  pg_hint_plan.parse_messages 
2155 -----------------------------
2156  notice
2157 (1 row)
2158
2159 /*+Set*/SELECT 1;
2160 NOTICE:  hint syntax error at or near ""
2161 DETAIL:  Opening parenthesis is necessary.
2162  ?column? 
2163 ----------
2164         1
2165 (1 row)
2166
2167 SET client_min_messages TO warning;
2168 /*+Set*/SELECT 1;
2169  ?column? 
2170 ----------
2171         1
2172 (1 row)
2173
2174 -- No. A-8-4-9
2175 SET pg_hint_plan.parse_messages TO warning;
2176 SHOW pg_hint_plan.parse_messages;
2177  pg_hint_plan.parse_messages 
2178 -----------------------------
2179  warning
2180 (1 row)
2181
2182 /*+Set*/SELECT 1;
2183 WARNING:  hint syntax error at or near ""
2184 DETAIL:  Opening parenthesis is necessary.
2185  ?column? 
2186 ----------
2187         1
2188 (1 row)
2189
2190 SET client_min_messages TO error;
2191 /*+Set*/SELECT 1;
2192  ?column? 
2193 ----------
2194         1
2195 (1 row)
2196
2197 -- No. A-8-4-10
2198 SET pg_hint_plan.parse_messages TO error;
2199 SHOW pg_hint_plan.parse_messages;
2200  pg_hint_plan.parse_messages 
2201 -----------------------------
2202  error
2203 (1 row)
2204
2205 /*+Set*/SELECT 1;
2206 ERROR:  hint syntax error at or near ""
2207 DETAIL:  Opening parenthesis is necessary.
2208 SET client_min_messages TO fatal;
2209 /*+Set*/SELECT 1;
2210 -- No. A-8-4-11
2211 RESET client_min_messages;
2212 SET pg_hint_plan.parse_messages TO DEFAULT;
2213 SHOW pg_hint_plan.parse_messages;
2214  pg_hint_plan.parse_messages 
2215 -----------------------------
2216  info
2217 (1 row)
2218
2219 /*+Set*/SELECT 1;
2220 INFO:  hint syntax error at or near ""
2221 DETAIL:  Opening parenthesis is necessary.
2222  ?column? 
2223 ----------
2224         1
2225 (1 row)
2226
2227 -- No. A-8-4-12
2228 SET pg_hint_plan.parse_messages TO fatal;
2229 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2230 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2231 SHOW pg_hint_plan.parse_messages;
2232  pg_hint_plan.parse_messages 
2233 -----------------------------
2234  info
2235 (1 row)
2236
2237 -- No. A-8-4-13
2238 SET pg_hint_plan.parse_messages TO panic;
2239 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2240 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2241 SHOW pg_hint_plan.parse_messages;
2242  pg_hint_plan.parse_messages 
2243 -----------------------------
2244  info
2245 (1 row)
2246
2247 -- No. A-8-4-14
2248 SET pg_hint_plan.parse_messages TO on;
2249 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "on"
2250 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2251 SHOW pg_hint_plan.parse_messages;
2252  pg_hint_plan.parse_messages 
2253 -----------------------------
2254  info
2255 (1 row)
2256
2257 ----
2258 ---- No. A-8-5 original GUC parameter pg_hint_plan.enable_hint_table
2259 ----
2260 INSERT INTO hint_plan.hints VALUES (
2261         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
2262         '',
2263         'SeqScan(t1)');
2264 -- No. A-8-5-1
2265 SET pg_hint_plan.enable_hint_table TO on;
2266 SHOW pg_hint_plan.enable_hint_table;
2267  pg_hint_plan.enable_hint_table 
2268 --------------------------------
2269  on
2270 (1 row)
2271
2272 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2273      QUERY PLAN     
2274 --------------------
2275  Seq Scan on t1
2276    Filter: (c1 = 1)
2277 (2 rows)
2278
2279 -- No. A-8-5-2
2280 SET pg_hint_plan.enable_hint_table TO off;
2281 SHOW pg_hint_plan.enable_hint_table;
2282  pg_hint_plan.enable_hint_table 
2283 --------------------------------
2284  off
2285 (1 row)
2286
2287 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2288           QUERY PLAN          
2289 ------------------------------
2290  Index Scan using t1_i1 on t1
2291    Index Cond: (c1 = 1)
2292 (2 rows)
2293
2294 -- No. A-8-5-3
2295 SET pg_hint_plan.enable_hint_table TO DEFAULT;
2296 SHOW pg_hint_plan.enable_hint_table;
2297  pg_hint_plan.enable_hint_table 
2298 --------------------------------
2299  off
2300 (1 row)
2301
2302 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2303           QUERY PLAN          
2304 ------------------------------
2305  Index Scan using t1_i1 on t1
2306    Index Cond: (c1 = 1)
2307 (2 rows)
2308
2309 -- No. A-8-5-4
2310 SET pg_hint_plan.enable_hint_table TO enable;
2311 ERROR:  parameter "pg_hint_plan.enable_hint_table" requires a Boolean value
2312 SHOW pg_hint_plan.enable_hint_table;
2313  pg_hint_plan.enable_hint_table 
2314 --------------------------------
2315  off
2316 (1 row)
2317
2318 TRUNCATE hint_plan.hints;
2319 ----
2320 ---- No. A-9-1 parse error message output
2321 ----
2322 -- No. A-9-1-1
2323 /*+"Set"(enable_indexscan on)*/SELECT 1;
2324 INFO:  hint syntax error at or near ""Set"(enable_indexscan on)"
2325 DETAIL:  Unrecognized hint keyword ""Set"".
2326  ?column? 
2327 ----------
2328         1
2329 (1 row)
2330
2331 /*+Set()(enable_indexscan on)*/SELECT 1;
2332 INFO:  hint syntax error at or near "Set()(enable_indexscan on)"
2333 DETAIL:  Set hint requires name and value of GUC parameter.
2334 INFO:  hint syntax error at or near "(enable_indexscan on)"
2335 DETAIL:  Unrecognized hint keyword "".
2336  ?column? 
2337 ----------
2338         1
2339 (1 row)
2340
2341 /*+Set(enable_indexscan on*/SELECT 1;
2342 INFO:  hint syntax error at or near ""
2343 DETAIL:  Closing parenthesis is necessary.
2344  ?column? 
2345 ----------
2346         1
2347 (1 row)
2348
2349 ----
2350 ---- No. A-9-3 hint state output
2351 ----
2352 SET pg_hint_plan.debug_print TO on;
2353 SET client_min_messages TO LOG;
2354 -- No. A-9-3-1
2355 /*+SeqScan(t1)*/
2356 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2357 LOG:  pg_hint_plan:
2358 used hint:
2359 SeqScan(t1)
2360 not used hint:
2361 duplication hint:
2362 error hint:
2363
2364      QUERY PLAN     
2365 --------------------
2366  Seq Scan on t1
2367    Filter: (c1 = 1)
2368 (2 rows)
2369
2370 -- No. A-9-3-2
2371 /*+SeqScan(no_table)*/
2372 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2373 LOG:  pg_hint_plan:
2374 used hint:
2375 not used hint:
2376 SeqScan(no_table)
2377 duplication hint:
2378 error hint:
2379
2380           QUERY PLAN          
2381 ------------------------------
2382  Index Scan using t1_i1 on t1
2383    Index Cond: (c1 = 1)
2384 (2 rows)
2385
2386 -- No. A-9-3-3
2387 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2388             QUERY PLAN             
2389 -----------------------------------
2390  Tid Scan on t1
2391    TID Cond: (ctid = '(1,1)'::tid)
2392    Filter: (c1 = 1)
2393 (3 rows)
2394
2395 /*+TidScan(t1)BitmapScan(t1)*/
2396 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2397 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2398 DETAIL:  Conflict scan method hint.
2399 LOG:  pg_hint_plan:
2400 used hint:
2401 BitmapScan(t1)
2402 not used hint:
2403 duplication hint:
2404 TidScan(t1)
2405 error hint:
2406
2407             QUERY PLAN            
2408 ----------------------------------
2409  Bitmap Heap Scan on t1
2410    Recheck Cond: (c1 = 1)
2411    Filter: (ctid = '(1,1)'::tid)
2412    ->  Bitmap Index Scan on t1_i1
2413          Index Cond: (c1 = 1)
2414 (5 rows)
2415
2416 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2417 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2418 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2419 DETAIL:  Conflict scan method hint.
2420 INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2421 DETAIL:  Conflict scan method hint.
2422 LOG:  pg_hint_plan:
2423 used hint:
2424 IndexScan(t1)
2425 not used hint:
2426 duplication hint:
2427 TidScan(t1)
2428 BitmapScan(t1)
2429 error hint:
2430
2431            QUERY PLAN            
2432 ---------------------------------
2433  Index Scan using t1_i1 on t1
2434    Index Cond: (c1 = 1)
2435    Filter: (ctid = '(1,1)'::tid)
2436 (3 rows)
2437
2438 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2439 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2440 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2441 DETAIL:  Conflict scan method hint.
2442 INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2443 DETAIL:  Conflict scan method hint.
2444 INFO:  hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2445 DETAIL:  Conflict scan method hint.
2446 LOG:  pg_hint_plan:
2447 used hint:
2448 SeqScan(t1)
2449 not used hint:
2450 duplication hint:
2451 TidScan(t1)
2452 BitmapScan(t1)
2453 IndexScan(t1)
2454 error hint:
2455
2456                    QUERY PLAN                   
2457 ------------------------------------------------
2458  Seq Scan on t1
2459    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2460 (2 rows)
2461
2462 -- No. A-9-3-4
2463 /*+Set(enable_indexscan enable)*/
2464 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2465 INFO:  parameter "enable_indexscan" requires a Boolean value
2466 LOG:  pg_hint_plan:
2467 used hint:
2468 not used hint:
2469 duplication hint:
2470 error hint:
2471 Set(enable_indexscan enable)
2472
2473           QUERY PLAN          
2474 ------------------------------
2475  Index Scan using t1_i1 on t1
2476    Index Cond: (c1 = 1)
2477 (2 rows)
2478
2479 ----
2480 ---- No. A-10-1 hint state output
2481 ----
2482 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2483 EXPLAIN (COSTS false) EXECUTE p1;
2484           QUERY PLAN          
2485 ------------------------------
2486  Index Scan using t1_i1 on t1
2487    Index Cond: (c1 = 1)
2488 (2 rows)
2489
2490 DEALLOCATE p1;
2491 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2492 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2493       QUERY PLAN       
2494 -----------------------
2495  Seq Scan on t1
2496    Filter: (c1 < 1000)
2497 (2 rows)
2498
2499 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2500       QUERY PLAN       
2501 -----------------------
2502  Seq Scan on t1
2503    Filter: (c1 < 1000)
2504 (2 rows)
2505
2506 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2507       QUERY PLAN       
2508 -----------------------
2509  Seq Scan on t1
2510    Filter: (c1 < 1000)
2511 (2 rows)
2512
2513 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2514       QUERY PLAN       
2515 -----------------------
2516  Seq Scan on t1
2517    Filter: (c1 < 1000)
2518 (2 rows)
2519
2520 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2521       QUERY PLAN       
2522 -----------------------
2523  Seq Scan on t1
2524    Filter: (c1 < 1000)
2525 (2 rows)
2526
2527 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2528      QUERY PLAN      
2529 ---------------------
2530  Seq Scan on t1
2531    Filter: (c1 < $1)
2532 (2 rows)
2533
2534 DEALLOCATE p1;
2535 -- No. A-10-1-1
2536 -- No. A-10-1-2
2537 /*+SeqScan(t1)*/
2538 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2539 /*+BitmapScan(t1)*/
2540 EXPLAIN (COSTS false) EXECUTE p1;
2541 LOG:  pg_hint_plan:
2542 used hint:
2543 SeqScan(t1)
2544 not used hint:
2545 duplication hint:
2546 error hint:
2547
2548      QUERY PLAN     
2549 --------------------
2550  Seq Scan on t1
2551    Filter: (c1 = 1)
2552 (2 rows)
2553
2554 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2555 /*+BitmapScan(t1)*/
2556 EXPLAIN (COSTS false) EXECUTE p1;
2557 LOG:  pg_hint_plan:
2558 used hint:
2559 SeqScan(t1)
2560 not used hint:
2561 duplication hint:
2562 error hint:
2563
2564      QUERY PLAN     
2565 --------------------
2566  Seq Scan on t1
2567    Filter: (c1 = 1)
2568 (2 rows)
2569
2570 DEALLOCATE p1;
2571 /*+BitmapScan(t1)*/
2572 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2573 /*+SeqScan(t1)*/
2574 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2575 LOG:  pg_hint_plan:
2576 used hint:
2577 BitmapScan(t1)
2578 not used hint:
2579 duplication hint:
2580 error hint:
2581
2582             QUERY PLAN            
2583 ----------------------------------
2584  Bitmap Heap Scan on t1
2585    Recheck Cond: (c1 < 1000)
2586    ->  Bitmap Index Scan on t1_i1
2587          Index Cond: (c1 < 1000)
2588 (4 rows)
2589
2590 /*+SeqScan(t1)*/
2591 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2592 LOG:  pg_hint_plan:
2593 used hint:
2594 BitmapScan(t1)
2595 not used hint:
2596 duplication hint:
2597 error hint:
2598
2599             QUERY PLAN            
2600 ----------------------------------
2601  Bitmap Heap Scan on t1
2602    Recheck Cond: (c1 < 1000)
2603    ->  Bitmap Index Scan on t1_i1
2604          Index Cond: (c1 < 1000)
2605 (4 rows)
2606
2607 /*+SeqScan(t1)*/
2608 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2609 LOG:  pg_hint_plan:
2610 used hint:
2611 BitmapScan(t1)
2612 not used hint:
2613 duplication hint:
2614 error hint:
2615
2616             QUERY PLAN            
2617 ----------------------------------
2618  Bitmap Heap Scan on t1
2619    Recheck Cond: (c1 < 1000)
2620    ->  Bitmap Index Scan on t1_i1
2621          Index Cond: (c1 < 1000)
2622 (4 rows)
2623
2624 /*+SeqScan(t1)*/
2625 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2626 LOG:  pg_hint_plan:
2627 used hint:
2628 BitmapScan(t1)
2629 not used hint:
2630 duplication hint:
2631 error hint:
2632
2633             QUERY PLAN            
2634 ----------------------------------
2635  Bitmap Heap Scan on t1
2636    Recheck Cond: (c1 < 1000)
2637    ->  Bitmap Index Scan on t1_i1
2638          Index Cond: (c1 < 1000)
2639 (4 rows)
2640
2641 /*+SeqScan(t1)*/
2642 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2643 LOG:  pg_hint_plan:
2644 used hint:
2645 BitmapScan(t1)
2646 not used hint:
2647 duplication hint:
2648 error hint:
2649
2650             QUERY PLAN            
2651 ----------------------------------
2652  Bitmap Heap Scan on t1
2653    Recheck Cond: (c1 < 1000)
2654    ->  Bitmap Index Scan on t1_i1
2655          Index Cond: (c1 < 1000)
2656 (4 rows)
2657
2658 /*+SeqScan(t1)*/
2659 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2660 LOG:  pg_hint_plan:
2661 used hint:
2662 BitmapScan(t1)
2663 not used hint:
2664 duplication hint:
2665 error hint:
2666
2667             QUERY PLAN            
2668 ----------------------------------
2669  Bitmap Heap Scan on t1
2670    Recheck Cond: (c1 < $1)
2671    ->  Bitmap Index Scan on t1_i1
2672          Index Cond: (c1 < $1)
2673 (4 rows)
2674
2675 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2676 /*+SeqScan(t1)*/
2677 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2678 LOG:  pg_hint_plan:
2679 used hint:
2680 BitmapScan(t1)
2681 not used hint:
2682 duplication hint:
2683 error hint:
2684
2685             QUERY PLAN            
2686 ----------------------------------
2687  Bitmap Heap Scan on t1
2688    Recheck Cond: (c1 < $1)
2689    ->  Bitmap Index Scan on t1_i1
2690          Index Cond: (c1 < $1)
2691 (4 rows)
2692
2693 DEALLOCATE p1;
2694 -- No. A-10-1-3
2695 -- No. A-10-1-4
2696 /*+SeqScan(t1)*/
2697 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2698 EXPLAIN (COSTS false) EXECUTE p1;
2699 LOG:  pg_hint_plan:
2700 used hint:
2701 SeqScan(t1)
2702 not used hint:
2703 duplication hint:
2704 error hint:
2705
2706      QUERY PLAN     
2707 --------------------
2708  Seq Scan on t1
2709    Filter: (c1 = 1)
2710 (2 rows)
2711
2712 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2713 EXPLAIN (COSTS false) EXECUTE p1;
2714 LOG:  pg_hint_plan:
2715 used hint:
2716 SeqScan(t1)
2717 not used hint:
2718 duplication hint:
2719 error hint:
2720
2721      QUERY PLAN     
2722 --------------------
2723  Seq Scan on t1
2724    Filter: (c1 = 1)
2725 (2 rows)
2726
2727 DEALLOCATE p1;
2728 /*+BitmapScan(t1)*/
2729 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2730 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2731 LOG:  pg_hint_plan:
2732 used hint:
2733 BitmapScan(t1)
2734 not used hint:
2735 duplication hint:
2736 error hint:
2737
2738             QUERY PLAN            
2739 ----------------------------------
2740  Bitmap Heap Scan on t1
2741    Recheck Cond: (c1 < 1000)
2742    ->  Bitmap Index Scan on t1_i1
2743          Index Cond: (c1 < 1000)
2744 (4 rows)
2745
2746 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2747 LOG:  pg_hint_plan:
2748 used hint:
2749 BitmapScan(t1)
2750 not used hint:
2751 duplication hint:
2752 error hint:
2753
2754             QUERY PLAN            
2755 ----------------------------------
2756  Bitmap Heap Scan on t1
2757    Recheck Cond: (c1 < 1000)
2758    ->  Bitmap Index Scan on t1_i1
2759          Index Cond: (c1 < 1000)
2760 (4 rows)
2761
2762 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2763 LOG:  pg_hint_plan:
2764 used hint:
2765 BitmapScan(t1)
2766 not used hint:
2767 duplication hint:
2768 error hint:
2769
2770             QUERY PLAN            
2771 ----------------------------------
2772  Bitmap Heap Scan on t1
2773    Recheck Cond: (c1 < 1000)
2774    ->  Bitmap Index Scan on t1_i1
2775          Index Cond: (c1 < 1000)
2776 (4 rows)
2777
2778 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2779 LOG:  pg_hint_plan:
2780 used hint:
2781 BitmapScan(t1)
2782 not used hint:
2783 duplication hint:
2784 error hint:
2785
2786             QUERY PLAN            
2787 ----------------------------------
2788  Bitmap Heap Scan on t1
2789    Recheck Cond: (c1 < 1000)
2790    ->  Bitmap Index Scan on t1_i1
2791          Index Cond: (c1 < 1000)
2792 (4 rows)
2793
2794 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2795 LOG:  pg_hint_plan:
2796 used hint:
2797 BitmapScan(t1)
2798 not used hint:
2799 duplication hint:
2800 error hint:
2801
2802             QUERY PLAN            
2803 ----------------------------------
2804  Bitmap Heap Scan on t1
2805    Recheck Cond: (c1 < 1000)
2806    ->  Bitmap Index Scan on t1_i1
2807          Index Cond: (c1 < 1000)
2808 (4 rows)
2809
2810 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2811 LOG:  pg_hint_plan:
2812 used hint:
2813 BitmapScan(t1)
2814 not used hint:
2815 duplication hint:
2816 error hint:
2817
2818             QUERY PLAN            
2819 ----------------------------------
2820  Bitmap Heap Scan on t1
2821    Recheck Cond: (c1 < $1)
2822    ->  Bitmap Index Scan on t1_i1
2823          Index Cond: (c1 < $1)
2824 (4 rows)
2825
2826 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2827 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2828 LOG:  pg_hint_plan:
2829 used hint:
2830 BitmapScan(t1)
2831 not used hint:
2832 duplication hint:
2833 error hint:
2834
2835             QUERY PLAN            
2836 ----------------------------------
2837  Bitmap Heap Scan on t1
2838    Recheck Cond: (c1 < $1)
2839    ->  Bitmap Index Scan on t1_i1
2840          Index Cond: (c1 < $1)
2841 (4 rows)
2842
2843 DEALLOCATE p1;
2844 -- No. A-10-1-5
2845 -- No. A-10-1-6
2846 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2847 /*+BitmapScan(t1)*/
2848 EXPLAIN (COSTS false) EXECUTE p1;
2849           QUERY PLAN          
2850 ------------------------------
2851  Index Scan using t1_i1 on t1
2852    Index Cond: (c1 = 1)
2853 (2 rows)
2854
2855 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2856 /*+BitmapScan(t1)*/
2857 EXPLAIN (COSTS false) EXECUTE p1;
2858           QUERY PLAN          
2859 ------------------------------
2860  Index Scan using t1_i1 on t1
2861    Index Cond: (c1 = 1)
2862 (2 rows)
2863
2864 DEALLOCATE p1;
2865 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2866 /*+BitmapScan(t1)*/
2867 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2868       QUERY PLAN       
2869 -----------------------
2870  Seq Scan on t1
2871    Filter: (c1 < 1000)
2872 (2 rows)
2873
2874 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2875       QUERY PLAN       
2876 -----------------------
2877  Seq Scan on t1
2878    Filter: (c1 < 1000)
2879 (2 rows)
2880
2881 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2882       QUERY PLAN       
2883 -----------------------
2884  Seq Scan on t1
2885    Filter: (c1 < 1000)
2886 (2 rows)
2887
2888 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2889       QUERY PLAN       
2890 -----------------------
2891  Seq Scan on t1
2892    Filter: (c1 < 1000)
2893 (2 rows)
2894
2895 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2896       QUERY PLAN       
2897 -----------------------
2898  Seq Scan on t1
2899    Filter: (c1 < 1000)
2900 (2 rows)
2901
2902 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2903      QUERY PLAN      
2904 ---------------------
2905  Seq Scan on t1
2906    Filter: (c1 < $1)
2907 (2 rows)
2908
2909 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2910 /*+BitmapScan(t1)*/
2911 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2912      QUERY PLAN      
2913 ---------------------
2914  Seq Scan on t1
2915    Filter: (c1 < $1)
2916 (2 rows)
2917
2918 DEALLOCATE p1;
2919 -- No. A-10-1-9
2920 -- No. A-10-1-10
2921 /*+SeqScan(t1)*/
2922 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2923 /*+BitmapScan(t1)*/
2924 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2925 LOG:  pg_hint_plan:
2926 used hint:
2927 SeqScan(t1)
2928 not used hint:
2929 duplication hint:
2930 error hint:
2931
2932      QUERY PLAN     
2933 --------------------
2934  Seq Scan on t1
2935    Filter: (c1 = 1)
2936 (2 rows)
2937
2938 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2939 /*+BitmapScan(t1)*/
2940 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2941 LOG:  pg_hint_plan:
2942 used hint:
2943 SeqScan(t1)
2944 not used hint:
2945 duplication hint:
2946 error hint:
2947
2948      QUERY PLAN     
2949 --------------------
2950  Seq Scan on t1
2951    Filter: (c1 = 1)
2952 (2 rows)
2953
2954 DEALLOCATE p1;
2955 /*+BitmapScan(t1)*/
2956 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2957 /*+SeqScan(t1)*/
2958 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2959 LOG:  pg_hint_plan:
2960 used hint:
2961 BitmapScan(t1)
2962 not used hint:
2963 duplication hint:
2964 error hint:
2965
2966             QUERY PLAN            
2967 ----------------------------------
2968  Bitmap Heap Scan on t1
2969    Recheck Cond: (c1 < 1000)
2970    ->  Bitmap Index Scan on t1_i1
2971          Index Cond: (c1 < 1000)
2972 (4 rows)
2973
2974 /*+SeqScan(t1)*/
2975 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2976 LOG:  pg_hint_plan:
2977 used hint:
2978 BitmapScan(t1)
2979 not used hint:
2980 duplication hint:
2981 error hint:
2982
2983             QUERY PLAN            
2984 ----------------------------------
2985  Bitmap Heap Scan on t1
2986    Recheck Cond: (c1 < 1000)
2987    ->  Bitmap Index Scan on t1_i1
2988          Index Cond: (c1 < 1000)
2989 (4 rows)
2990
2991 /*+SeqScan(t1)*/
2992 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2993 LOG:  pg_hint_plan:
2994 used hint:
2995 BitmapScan(t1)
2996 not used hint:
2997 duplication hint:
2998 error hint:
2999
3000             QUERY PLAN            
3001 ----------------------------------
3002  Bitmap Heap Scan on t1
3003    Recheck Cond: (c1 < 1000)
3004    ->  Bitmap Index Scan on t1_i1
3005          Index Cond: (c1 < 1000)
3006 (4 rows)
3007
3008 /*+SeqScan(t1)*/
3009 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3010 LOG:  pg_hint_plan:
3011 used hint:
3012 BitmapScan(t1)
3013 not used hint:
3014 duplication hint:
3015 error hint:
3016
3017             QUERY PLAN            
3018 ----------------------------------
3019  Bitmap Heap Scan on t1
3020    Recheck Cond: (c1 < 1000)
3021    ->  Bitmap Index Scan on t1_i1
3022          Index Cond: (c1 < 1000)
3023 (4 rows)
3024
3025 /*+SeqScan(t1)*/
3026 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3027 LOG:  pg_hint_plan:
3028 used hint:
3029 BitmapScan(t1)
3030 not used hint:
3031 duplication hint:
3032 error hint:
3033
3034             QUERY PLAN            
3035 ----------------------------------
3036  Bitmap Heap Scan on t1
3037    Recheck Cond: (c1 < 1000)
3038    ->  Bitmap Index Scan on t1_i1
3039          Index Cond: (c1 < 1000)
3040 (4 rows)
3041
3042 /*+SeqScan(t1)*/
3043 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3044 LOG:  pg_hint_plan:
3045 used hint:
3046 BitmapScan(t1)
3047 not used hint:
3048 duplication hint:
3049 error hint:
3050
3051             QUERY PLAN            
3052 ----------------------------------
3053  Bitmap Heap Scan on t1
3054    Recheck Cond: (c1 < $1)
3055    ->  Bitmap Index Scan on t1_i1
3056          Index Cond: (c1 < $1)
3057 (4 rows)
3058
3059 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3060 /*+SeqScan(t1)*/
3061 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3062 LOG:  pg_hint_plan:
3063 used hint:
3064 BitmapScan(t1)
3065 not used hint:
3066 duplication hint:
3067 error hint:
3068
3069             QUERY PLAN            
3070 ----------------------------------
3071  Bitmap Heap Scan on t1
3072    Recheck Cond: (c1 < $1)
3073    ->  Bitmap Index Scan on t1_i1
3074          Index Cond: (c1 < $1)
3075 (4 rows)
3076
3077 DEALLOCATE p1;
3078 -- No. A-10-1-11
3079 -- No. A-10-1-12
3080 /*+SeqScan(t1)*/
3081 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3082 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3083 LOG:  pg_hint_plan:
3084 used hint:
3085 SeqScan(t1)
3086 not used hint:
3087 duplication hint:
3088 error hint:
3089
3090      QUERY PLAN     
3091 --------------------
3092  Seq Scan on t1
3093    Filter: (c1 = 1)
3094 (2 rows)
3095
3096 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3097 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3098 LOG:  pg_hint_plan:
3099 used hint:
3100 SeqScan(t1)
3101 not used hint:
3102 duplication hint:
3103 error hint:
3104
3105      QUERY PLAN     
3106 --------------------
3107  Seq Scan on t1
3108    Filter: (c1 = 1)
3109 (2 rows)
3110
3111 DEALLOCATE p1;
3112 /*+BitmapScan(t1)*/
3113 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
3114 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3115 LOG:  pg_hint_plan:
3116 used hint:
3117 BitmapScan(t1)
3118 not used hint:
3119 duplication hint:
3120 error hint:
3121
3122             QUERY PLAN            
3123 ----------------------------------
3124  Bitmap Heap Scan on t1
3125    Recheck Cond: (c1 < 1000)
3126    ->  Bitmap Index Scan on t1_i1
3127          Index Cond: (c1 < 1000)
3128 (4 rows)
3129
3130 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3131 LOG:  pg_hint_plan:
3132 used hint:
3133 BitmapScan(t1)
3134 not used hint:
3135 duplication hint:
3136 error hint:
3137
3138             QUERY PLAN            
3139 ----------------------------------
3140  Bitmap Heap Scan on t1
3141    Recheck Cond: (c1 < 1000)
3142    ->  Bitmap Index Scan on t1_i1
3143          Index Cond: (c1 < 1000)
3144 (4 rows)
3145
3146 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3147 LOG:  pg_hint_plan:
3148 used hint:
3149 BitmapScan(t1)
3150 not used hint:
3151 duplication hint:
3152 error hint:
3153
3154             QUERY PLAN            
3155 ----------------------------------
3156  Bitmap Heap Scan on t1
3157    Recheck Cond: (c1 < 1000)
3158    ->  Bitmap Index Scan on t1_i1
3159          Index Cond: (c1 < 1000)
3160 (4 rows)
3161
3162 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3163 LOG:  pg_hint_plan:
3164 used hint:
3165 BitmapScan(t1)
3166 not used hint:
3167 duplication hint:
3168 error hint:
3169
3170             QUERY PLAN            
3171 ----------------------------------
3172  Bitmap Heap Scan on t1
3173    Recheck Cond: (c1 < 1000)
3174    ->  Bitmap Index Scan on t1_i1
3175          Index Cond: (c1 < 1000)
3176 (4 rows)
3177
3178 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3179 LOG:  pg_hint_plan:
3180 used hint:
3181 BitmapScan(t1)
3182 not used hint:
3183 duplication hint:
3184 error hint:
3185
3186             QUERY PLAN            
3187 ----------------------------------
3188  Bitmap Heap Scan on t1
3189    Recheck Cond: (c1 < 1000)
3190    ->  Bitmap Index Scan on t1_i1
3191          Index Cond: (c1 < 1000)
3192 (4 rows)
3193
3194 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3195 LOG:  pg_hint_plan:
3196 used hint:
3197 BitmapScan(t1)
3198 not used hint:
3199 duplication hint:
3200 error hint:
3201
3202             QUERY PLAN            
3203 ----------------------------------
3204  Bitmap Heap Scan on t1
3205    Recheck Cond: (c1 < $1)
3206    ->  Bitmap Index Scan on t1_i1
3207          Index Cond: (c1 < $1)
3208 (4 rows)
3209
3210 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3211 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3212 LOG:  pg_hint_plan:
3213 used hint:
3214 BitmapScan(t1)
3215 not used hint:
3216 duplication hint:
3217 error hint:
3218
3219             QUERY PLAN            
3220 ----------------------------------
3221  Bitmap Heap Scan on t1
3222    Recheck Cond: (c1 < $1)
3223    ->  Bitmap Index Scan on t1_i1
3224          Index Cond: (c1 < $1)
3225 (4 rows)
3226
3227 DEALLOCATE p1;
3228 -- No. A-10-1-13
3229 -- No. A-10-1-14
3230 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3231 /*+BitmapScan(t1)*/
3232 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3233           QUERY PLAN          
3234 ------------------------------
3235  Index Scan using t1_i1 on t1
3236    Index Cond: (c1 = 1)
3237 (2 rows)
3238
3239 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3240 /*+BitmapScan(t1)*/
3241 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3242           QUERY PLAN          
3243 ------------------------------
3244  Index Scan using t1_i1 on t1
3245    Index Cond: (c1 = 1)
3246 (2 rows)
3247
3248 DEALLOCATE p1;
3249 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
3250 /*+BitmapScan(t1)*/
3251 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3252       QUERY PLAN       
3253 -----------------------
3254  Seq Scan on t1
3255    Filter: (c1 < 1000)
3256 (2 rows)
3257
3258 /*+BitmapScan(t1)*/
3259 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3260       QUERY PLAN       
3261 -----------------------
3262  Seq Scan on t1
3263    Filter: (c1 < 1000)
3264 (2 rows)
3265
3266 /*+BitmapScan(t1)*/
3267 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3268       QUERY PLAN       
3269 -----------------------
3270  Seq Scan on t1
3271    Filter: (c1 < 1000)
3272 (2 rows)
3273
3274 /*+BitmapScan(t1)*/
3275 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3276       QUERY PLAN       
3277 -----------------------
3278  Seq Scan on t1
3279    Filter: (c1 < 1000)
3280 (2 rows)
3281
3282 /*+BitmapScan(t1)*/
3283 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3284       QUERY PLAN       
3285 -----------------------
3286  Seq Scan on t1
3287    Filter: (c1 < 1000)
3288 (2 rows)
3289
3290 /*+BitmapScan(t1)*/
3291 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3292      QUERY PLAN      
3293 ---------------------
3294  Seq Scan on t1
3295    Filter: (c1 < $1)
3296 (2 rows)
3297
3298 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3299 /*+BitmapScan(t1)*/
3300 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3301      QUERY PLAN      
3302 ---------------------
3303  Seq Scan on t1
3304    Filter: (c1 < $1)
3305 (2 rows)
3306
3307 DEALLOCATE p1;
3308 ----
3309 ---- No. A-10-4 EXECUTE statement name error
3310 ----
3311 -- No. A-10-4-1
3312 EXECUTE p1;
3313 ERROR:  prepared statement "p1" does not exist
3314 SHOW pg_hint_plan.debug_print;
3315  pg_hint_plan.debug_print 
3316 --------------------------
3317  on
3318 (1 row)
3319
3320 ----
3321 ---- No. A-11-5 EXECUTE statement name error
3322 ----
3323 -- No. A-11-5-1
3324 SELECT pg_stat_statements_reset();
3325  pg_stat_statements_reset 
3326 --------------------------
3327  
3328 (1 row)
3329
3330 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3331  c1 | c2 | c3 | c4 
3332 ----+----+----+----
3333   1 |  1 |  1 | 1
3334 (1 row)
3335
3336 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3337 LOG:  pg_hint_plan:
3338 used hint:
3339 Set(enable_seqscan off)
3340 not used hint:
3341 duplication hint:
3342 error hint:
3343
3344  c1 | c2 | c3 | c4 
3345 ----+----+----+----
3346   1 |  1 |  1 | 1
3347 (1 row)
3348
3349 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3350 LOG:  pg_hint_plan:
3351 used hint:
3352 SeqScan(t1)
3353 not used hint:
3354 duplication hint:
3355 error hint:
3356
3357  c1 | c2 | c3 | c4 
3358 ----+----+----+----
3359   1 |  1 |  1 | 1
3360 (1 row)
3361
3362 SELECT s.query, s.calls
3363   FROM public.pg_stat_statements s
3364   JOIN pg_catalog.pg_database d
3365     ON (s.dbid = d.oid)
3366  ORDER BY 1;
3367                 query                 | calls 
3368 --------------------------------------+-------
3369  SELECT * FROM s1.t1 WHERE t1.c1 = ?; |     3
3370  SELECT pg_stat_statements_reset();   |     1
3371 (2 rows)
3372
3373 ----
3374 ---- No. A-12-1 reset of global variable of core at the error
3375 ---- No. A-12-2 reset of global variable of original at the error
3376 ----
3377 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3378              QUERY PLAN             
3379 ------------------------------------
3380  Merge Join
3381    Merge Cond: (t1.c1 = t2.c1)
3382    ->  Index Scan using t1_i1 on t1
3383    ->  Sort
3384          Sort Key: t2.c1
3385          ->  Seq Scan on t2
3386 (6 rows)
3387
3388 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3389 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3390 EXPLAIN (COSTS false) EXECUTE p1;
3391 INFO:  hint syntax error at or near "NestLoop(t1 t1)"
3392 DETAIL:  Relation name "t1" is duplicated.
3393 LOG:  pg_hint_plan:
3394 used hint:
3395 SeqScan(t1)
3396 MergeJoin(t1 t2)
3397 Set(enable_seqscan off)
3398 Set(geqo_threshold 100)
3399 not used hint:
3400 duplication hint:
3401 error hint:
3402 NestLoop(t1 t1)
3403
3404              QUERY PLAN             
3405 ------------------------------------
3406  Merge Join
3407    Merge Cond: (t1.c1 = t2.c1)
3408    ->  Sort
3409          Sort Key: t1.c1
3410          ->  Seq Scan on t1
3411    ->  Index Scan using t2_i1 on t2
3412 (6 rows)
3413
3414 -- No. A-12-1-1
3415 -- No. A-12-2-1
3416 SELECT name, setting FROM settings;
3417            name            |  setting  
3418 ---------------------------+-----------
3419  geqo                      | on
3420  geqo_effort               | 5
3421  geqo_generations          | 0
3422  geqo_pool_size            | 0
3423  geqo_seed                 | 0
3424  geqo_selection_bias       | 2
3425  geqo_threshold            | 12
3426  constraint_exclusion      | partition
3427  cursor_tuple_fraction     | 0.1
3428  default_statistics_target | 100
3429  from_collapse_limit       | 8
3430  join_collapse_limit       | 8
3431  cpu_index_tuple_cost      | 0.005
3432  cpu_operator_cost         | 0.0025
3433  cpu_tuple_cost            | 0.01
3434  effective_cache_size      | 16384
3435  random_page_cost          | 4
3436  seq_page_cost             | 1
3437  enable_bitmapscan         | on
3438  enable_hashagg            | on
3439  enable_hashjoin           | on
3440  enable_indexonlyscan      | on
3441  enable_indexscan          | on
3442  enable_material           | on
3443  enable_mergejoin          | on
3444  enable_nestloop           | on
3445  enable_seqscan            | on
3446  enable_sort               | on
3447  enable_tidscan            | on
3448  client_min_messages       | log
3449 (30 rows)
3450
3451 SET pg_hint_plan.parse_messages TO error;
3452 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3453 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3454 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3455 DETAIL:  Relation name "t1" is duplicated.
3456 SELECT name, setting FROM settings;
3457            name            |  setting  
3458 ---------------------------+-----------
3459  geqo                      | on
3460  geqo_effort               | 5
3461  geqo_generations          | 0
3462  geqo_pool_size            | 0
3463  geqo_seed                 | 0
3464  geqo_selection_bias       | 2
3465  geqo_threshold            | 12
3466  constraint_exclusion      | partition
3467  cursor_tuple_fraction     | 0.1
3468  default_statistics_target | 100
3469  from_collapse_limit       | 8
3470  join_collapse_limit       | 8
3471  cpu_index_tuple_cost      | 0.005
3472  cpu_operator_cost         | 0.0025
3473  cpu_tuple_cost            | 0.01
3474  effective_cache_size      | 16384
3475  random_page_cost          | 4
3476  seq_page_cost             | 1
3477  enable_bitmapscan         | on
3478  enable_hashagg            | on
3479  enable_hashjoin           | on
3480  enable_indexonlyscan      | on
3481  enable_indexscan          | on
3482  enable_material           | on
3483  enable_mergejoin          | on
3484  enable_nestloop           | on
3485  enable_seqscan            | on
3486  enable_sort               | on
3487  enable_tidscan            | on
3488  client_min_messages       | log
3489 (30 rows)
3490
3491 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3492 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3493 LOG:  pg_hint_plan:
3494 used hint:
3495 SeqScan(t1)
3496 MergeJoin(t1 t2)
3497 Set(enable_seqscan off)
3498 Set(geqo_threshold 100)
3499 not used hint:
3500 duplication hint:
3501 error hint:
3502
3503              QUERY PLAN             
3504 ------------------------------------
3505  Merge Join
3506    Merge Cond: (t1.c1 = t2.c1)
3507    ->  Sort
3508          Sort Key: t1.c1
3509          ->  Seq Scan on t1
3510    ->  Index Scan using t2_i1 on t2
3511 (6 rows)
3512
3513 -- No. A-12-1-2
3514 -- No. A-12-2-2
3515 SELECT name, setting FROM settings;
3516            name            |  setting  
3517 ---------------------------+-----------
3518  geqo                      | on
3519  geqo_effort               | 5
3520  geqo_generations          | 0
3521  geqo_pool_size            | 0
3522  geqo_seed                 | 0
3523  geqo_selection_bias       | 2
3524  geqo_threshold            | 12
3525  constraint_exclusion      | partition
3526  cursor_tuple_fraction     | 0.1
3527  default_statistics_target | 100
3528  from_collapse_limit       | 8
3529  join_collapse_limit       | 8
3530  cpu_index_tuple_cost      | 0.005
3531  cpu_operator_cost         | 0.0025
3532  cpu_tuple_cost            | 0.01
3533  effective_cache_size      | 16384
3534  random_page_cost          | 4
3535  seq_page_cost             | 1
3536  enable_bitmapscan         | on
3537  enable_hashagg            | on
3538  enable_hashjoin           | on
3539  enable_indexonlyscan      | on
3540  enable_indexscan          | on
3541  enable_material           | on
3542  enable_mergejoin          | on
3543  enable_nestloop           | on
3544  enable_seqscan            | on
3545  enable_sort               | on
3546  enable_tidscan            | on
3547  client_min_messages       | log
3548 (30 rows)
3549
3550 SET pg_hint_plan.parse_messages TO error;
3551 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3552 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3553 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3554 DETAIL:  Relation name "t1" is duplicated.
3555 SELECT name, setting FROM settings;
3556            name            |  setting  
3557 ---------------------------+-----------
3558  geqo                      | on
3559  geqo_effort               | 5
3560  geqo_generations          | 0
3561  geqo_pool_size            | 0
3562  geqo_seed                 | 0
3563  geqo_selection_bias       | 2
3564  geqo_threshold            | 12
3565  constraint_exclusion      | partition
3566  cursor_tuple_fraction     | 0.1
3567  default_statistics_target | 100
3568  from_collapse_limit       | 8
3569  join_collapse_limit       | 8
3570  cpu_index_tuple_cost      | 0.005
3571  cpu_operator_cost         | 0.0025
3572  cpu_tuple_cost            | 0.01
3573  effective_cache_size      | 16384
3574  random_page_cost          | 4
3575  seq_page_cost             | 1
3576  enable_bitmapscan         | on
3577  enable_hashagg            | on
3578  enable_hashjoin           | on
3579  enable_indexonlyscan      | on
3580  enable_indexscan          | on
3581  enable_material           | on
3582  enable_mergejoin          | on
3583  enable_nestloop           | on
3584  enable_seqscan            | on
3585  enable_sort               | on
3586  enable_tidscan            | on
3587  client_min_messages       | log
3588 (30 rows)
3589
3590 EXPLAIN (COSTS false) EXECUTE p1;
3591              QUERY PLAN             
3592 ------------------------------------
3593  Merge Join
3594    Merge Cond: (t1.c1 = t2.c1)
3595    ->  Sort
3596          Sort Key: t1.c1
3597          ->  Seq Scan on t1
3598    ->  Index Scan using t2_i1 on t2
3599 (6 rows)
3600
3601 -- No. A-12-1-3
3602 -- No. A-12-2-3
3603 SELECT name, setting FROM settings;
3604            name            |  setting  
3605 ---------------------------+-----------
3606  geqo                      | on
3607  geqo_effort               | 5
3608  geqo_generations          | 0
3609  geqo_pool_size            | 0
3610  geqo_seed                 | 0
3611  geqo_selection_bias       | 2
3612  geqo_threshold            | 12
3613  constraint_exclusion      | partition
3614  cursor_tuple_fraction     | 0.1
3615  default_statistics_target | 100
3616  from_collapse_limit       | 8
3617  join_collapse_limit       | 8
3618  cpu_index_tuple_cost      | 0.005
3619  cpu_operator_cost         | 0.0025
3620  cpu_tuple_cost            | 0.01
3621  effective_cache_size      | 16384
3622  random_page_cost          | 4
3623  seq_page_cost             | 1
3624  enable_bitmapscan         | on
3625  enable_hashagg            | on
3626  enable_hashjoin           | on
3627  enable_indexonlyscan      | on
3628  enable_indexscan          | on
3629  enable_material           | on
3630  enable_mergejoin          | on
3631  enable_nestloop           | on
3632  enable_seqscan            | on
3633  enable_sort               | on
3634  enable_tidscan            | on
3635  client_min_messages       | log
3636 (30 rows)
3637
3638 SET pg_hint_plan.parse_messages TO error;
3639 EXPLAIN (COSTS false) EXECUTE p2;
3640 ERROR:  prepared statement "p2" does not exist
3641 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3642 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3643 LOG:  pg_hint_plan:
3644 used hint:
3645 SeqScan(t1)
3646 MergeJoin(t1 t2)
3647 Set(enable_seqscan off)
3648 Set(geqo_threshold 100)
3649 not used hint:
3650 duplication hint:
3651 error hint:
3652
3653              QUERY PLAN             
3654 ------------------------------------
3655  Merge Join
3656    Merge Cond: (t1.c1 = t2.c1)
3657    ->  Sort
3658          Sort Key: t1.c1
3659          ->  Seq Scan on t1
3660    ->  Index Scan using t2_i1 on t2
3661 (6 rows)
3662
3663 EXPLAIN (COSTS false) EXECUTE p1;
3664              QUERY PLAN             
3665 ------------------------------------
3666  Merge Join
3667    Merge Cond: (t1.c1 = t2.c1)
3668    ->  Sort
3669          Sort Key: t1.c1
3670          ->  Seq Scan on t1
3671    ->  Index Scan using t2_i1 on t2
3672 (6 rows)
3673
3674 SELECT name, setting FROM settings;
3675            name            |  setting  
3676 ---------------------------+-----------
3677  geqo                      | on
3678  geqo_effort               | 5
3679  geqo_generations          | 0
3680  geqo_pool_size            | 0
3681  geqo_seed                 | 0
3682  geqo_selection_bias       | 2
3683  geqo_threshold            | 12
3684  constraint_exclusion      | partition
3685  cursor_tuple_fraction     | 0.1
3686  default_statistics_target | 100
3687  from_collapse_limit       | 8
3688  join_collapse_limit       | 8
3689  cpu_index_tuple_cost      | 0.005
3690  cpu_operator_cost         | 0.0025
3691  cpu_tuple_cost            | 0.01
3692  effective_cache_size      | 16384
3693  random_page_cost          | 4
3694  seq_page_cost             | 1
3695  enable_bitmapscan         | on
3696  enable_hashagg            | on
3697  enable_hashjoin           | on
3698  enable_indexonlyscan      | on
3699  enable_indexscan          | on
3700  enable_material           | on
3701  enable_mergejoin          | on
3702  enable_nestloop           | on
3703  enable_seqscan            | on
3704  enable_sort               | on
3705  enable_tidscan            | on
3706  client_min_messages       | log
3707 (30 rows)
3708
3709 -- No. A-12-1-4
3710 -- No. A-12-2-4
3711 SELECT name, setting FROM settings;
3712            name            |  setting  
3713 ---------------------------+-----------
3714  geqo                      | on
3715  geqo_effort               | 5
3716  geqo_generations          | 0
3717  geqo_pool_size            | 0
3718  geqo_seed                 | 0
3719  geqo_selection_bias       | 2
3720  geqo_threshold            | 12
3721  constraint_exclusion      | partition
3722  cursor_tuple_fraction     | 0.1
3723  default_statistics_target | 100
3724  from_collapse_limit       | 8
3725  join_collapse_limit       | 8
3726  cpu_index_tuple_cost      | 0.005
3727  cpu_operator_cost         | 0.0025
3728  cpu_tuple_cost            | 0.01
3729  effective_cache_size      | 16384
3730  random_page_cost          | 4
3731  seq_page_cost             | 1
3732  enable_bitmapscan         | on
3733  enable_hashagg            | on
3734  enable_hashjoin           | on
3735  enable_indexonlyscan      | on
3736  enable_indexscan          | on
3737  enable_material           | on
3738  enable_mergejoin          | on
3739  enable_nestloop           | on
3740  enable_seqscan            | on
3741  enable_sort               | on
3742  enable_tidscan            | on
3743  client_min_messages       | log
3744 (30 rows)
3745
3746 SET pg_hint_plan.parse_messages TO error;
3747 EXPLAIN (COSTS false) EXECUTE p2;
3748 ERROR:  prepared statement "p2" does not exist
3749 EXPLAIN (COSTS false) EXECUTE p1;
3750              QUERY PLAN             
3751 ------------------------------------
3752  Merge Join
3753    Merge Cond: (t1.c1 = t2.c1)
3754    ->  Sort
3755          Sort Key: t1.c1
3756          ->  Seq Scan on t1
3757    ->  Index Scan using t2_i1 on t2
3758 (6 rows)
3759
3760 SELECT name, setting FROM settings;
3761            name            |  setting  
3762 ---------------------------+-----------
3763  geqo                      | on
3764  geqo_effort               | 5
3765  geqo_generations          | 0
3766  geqo_pool_size            | 0
3767  geqo_seed                 | 0
3768  geqo_selection_bias       | 2
3769  geqo_threshold            | 12
3770  constraint_exclusion      | partition
3771  cursor_tuple_fraction     | 0.1
3772  default_statistics_target | 100
3773  from_collapse_limit       | 8
3774  join_collapse_limit       | 8
3775  cpu_index_tuple_cost      | 0.005
3776  cpu_operator_cost         | 0.0025
3777  cpu_tuple_cost            | 0.01
3778  effective_cache_size      | 16384
3779  random_page_cost          | 4
3780  seq_page_cost             | 1
3781  enable_bitmapscan         | on
3782  enable_hashagg            | on
3783  enable_hashjoin           | on
3784  enable_indexonlyscan      | on
3785  enable_indexscan          | on
3786  enable_material           | on
3787  enable_mergejoin          | on
3788  enable_nestloop           | on
3789  enable_seqscan            | on
3790  enable_sort               | on
3791  enable_tidscan            | on
3792  client_min_messages       | log
3793 (30 rows)
3794
3795 DEALLOCATE p1;
3796 SET pg_hint_plan.parse_messages TO LOG;
3797 ----
3798 ---- No. A-12-3 effective range of the hint
3799 ----
3800 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3801              QUERY PLAN             
3802 ------------------------------------
3803  Merge Join
3804    Merge Cond: (t1.c1 = t2.c1)
3805    ->  Index Scan using t1_i1 on t1
3806    ->  Sort
3807          Sort Key: t2.c1
3808          ->  Seq Scan on t2
3809 (6 rows)
3810
3811 -- No. A-12-3-1
3812 SET enable_indexscan TO off;
3813 SET enable_mergejoin TO off;
3814 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3815           QUERY PLAN          
3816 ------------------------------
3817  Hash Join
3818    Hash Cond: (t1.c1 = t2.c1)
3819    ->  Seq Scan on t1
3820    ->  Hash
3821          ->  Seq Scan on t2
3822 (5 rows)
3823
3824 SELECT name, setting FROM settings;
3825            name            |  setting  
3826 ---------------------------+-----------
3827  geqo                      | on
3828  geqo_effort               | 5
3829  geqo_generations          | 0
3830  geqo_pool_size            | 0
3831  geqo_seed                 | 0
3832  geqo_selection_bias       | 2
3833  geqo_threshold            | 12
3834  constraint_exclusion      | partition
3835  cursor_tuple_fraction     | 0.1
3836  default_statistics_target | 100
3837  from_collapse_limit       | 8
3838  join_collapse_limit       | 8
3839  cpu_index_tuple_cost      | 0.005
3840  cpu_operator_cost         | 0.0025
3841  cpu_tuple_cost            | 0.01
3842  effective_cache_size      | 16384
3843  random_page_cost          | 4
3844  seq_page_cost             | 1
3845  enable_bitmapscan         | on
3846  enable_hashagg            | on
3847  enable_hashjoin           | on
3848  enable_indexonlyscan      | on
3849  enable_indexscan          | off
3850  enable_material           | on
3851  enable_mergejoin          | off
3852  enable_nestloop           | on
3853  enable_seqscan            | on
3854  enable_sort               | on
3855  enable_tidscan            | on
3856  client_min_messages       | log
3857 (30 rows)
3858
3859 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3860 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3861 LOG:  pg_hint_plan:
3862 used hint:
3863 IndexScan(t2)
3864 MergeJoin(t1 t2)
3865 Leading(t2 t1)
3866 Set(enable_indexscan on)
3867 Set(geqo_threshold 100)
3868 not used hint:
3869 duplication hint:
3870 error hint:
3871
3872              QUERY PLAN             
3873 ------------------------------------
3874  Merge Join
3875    Merge Cond: (t1.c1 = t2.c1)
3876    ->  Index Scan using t1_i1 on t1
3877    ->  Index Scan using t2_i1 on t2
3878 (4 rows)
3879
3880 SELECT name, setting FROM settings;
3881            name            |  setting  
3882 ---------------------------+-----------
3883  geqo                      | on
3884  geqo_effort               | 5
3885  geqo_generations          | 0
3886  geqo_pool_size            | 0
3887  geqo_seed                 | 0
3888  geqo_selection_bias       | 2
3889  geqo_threshold            | 12
3890  constraint_exclusion      | partition
3891  cursor_tuple_fraction     | 0.1
3892  default_statistics_target | 100
3893  from_collapse_limit       | 8
3894  join_collapse_limit       | 8
3895  cpu_index_tuple_cost      | 0.005
3896  cpu_operator_cost         | 0.0025
3897  cpu_tuple_cost            | 0.01
3898  effective_cache_size      | 16384
3899  random_page_cost          | 4
3900  seq_page_cost             | 1
3901  enable_bitmapscan         | on
3902  enable_hashagg            | on
3903  enable_hashjoin           | on
3904  enable_indexonlyscan      | on
3905  enable_indexscan          | off
3906  enable_material           | on
3907  enable_mergejoin          | off
3908  enable_nestloop           | on
3909  enable_seqscan            | on
3910  enable_sort               | on
3911  enable_tidscan            | on
3912  client_min_messages       | log
3913 (30 rows)
3914
3915 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3916           QUERY PLAN          
3917 ------------------------------
3918  Hash Join
3919    Hash Cond: (t1.c1 = t2.c1)
3920    ->  Seq Scan on t1
3921    ->  Hash
3922          ->  Seq Scan on t2
3923 (5 rows)
3924
3925 -- No. A-12-3-2
3926 SET enable_indexscan TO off;
3927 SET enable_mergejoin TO off;
3928 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3929           QUERY PLAN          
3930 ------------------------------
3931  Hash Join
3932    Hash Cond: (t1.c1 = t2.c1)
3933    ->  Seq Scan on t1
3934    ->  Hash
3935          ->  Seq Scan on t2
3936 (5 rows)
3937
3938 SELECT name, setting FROM settings;
3939            name            |  setting  
3940 ---------------------------+-----------
3941  geqo                      | on
3942  geqo_effort               | 5
3943  geqo_generations          | 0
3944  geqo_pool_size            | 0
3945  geqo_seed                 | 0
3946  geqo_selection_bias       | 2
3947  geqo_threshold            | 12
3948  constraint_exclusion      | partition
3949  cursor_tuple_fraction     | 0.1
3950  default_statistics_target | 100
3951  from_collapse_limit       | 8
3952  join_collapse_limit       | 8
3953  cpu_index_tuple_cost      | 0.005
3954  cpu_operator_cost         | 0.0025
3955  cpu_tuple_cost            | 0.01
3956  effective_cache_size      | 16384
3957  random_page_cost          | 4
3958  seq_page_cost             | 1
3959  enable_bitmapscan         | on
3960  enable_hashagg            | on
3961  enable_hashjoin           | on
3962  enable_indexonlyscan      | on
3963  enable_indexscan          | off
3964  enable_material           | on
3965  enable_mergejoin          | off
3966  enable_nestloop           | on
3967  enable_seqscan            | on
3968  enable_sort               | on
3969  enable_tidscan            | on
3970  client_min_messages       | log
3971 (30 rows)
3972
3973 BEGIN;
3974 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3975 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3976 LOG:  pg_hint_plan:
3977 used hint:
3978 IndexScan(t2)
3979 MergeJoin(t1 t2)
3980 Leading(t2 t1)
3981 Set(enable_indexscan on)
3982 Set(geqo_threshold 100)
3983 not used hint:
3984 duplication hint:
3985 error hint:
3986
3987              QUERY PLAN             
3988 ------------------------------------
3989  Merge Join
3990    Merge Cond: (t1.c1 = t2.c1)
3991    ->  Index Scan using t1_i1 on t1
3992    ->  Index Scan using t2_i1 on t2
3993 (4 rows)
3994
3995 COMMIT;
3996 BEGIN;
3997 SELECT name, setting FROM settings;
3998            name            |  setting  
3999 ---------------------------+-----------
4000  geqo                      | on
4001  geqo_effort               | 5
4002  geqo_generations          | 0
4003  geqo_pool_size            | 0
4004  geqo_seed                 | 0
4005  geqo_selection_bias       | 2
4006  geqo_threshold            | 12
4007  constraint_exclusion      | partition
4008  cursor_tuple_fraction     | 0.1
4009  default_statistics_target | 100
4010  from_collapse_limit       | 8
4011  join_collapse_limit       | 8
4012  cpu_index_tuple_cost      | 0.005
4013  cpu_operator_cost         | 0.0025
4014  cpu_tuple_cost            | 0.01
4015  effective_cache_size      | 16384
4016  random_page_cost          | 4
4017  seq_page_cost             | 1
4018  enable_bitmapscan         | on
4019  enable_hashagg            | on
4020  enable_hashjoin           | on
4021  enable_indexonlyscan      | on
4022  enable_indexscan          | off
4023  enable_material           | on
4024  enable_mergejoin          | off
4025  enable_nestloop           | on
4026  enable_seqscan            | on
4027  enable_sort               | on
4028  enable_tidscan            | on
4029  client_min_messages       | log
4030 (30 rows)
4031
4032 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4033           QUERY PLAN          
4034 ------------------------------
4035  Hash Join
4036    Hash Cond: (t1.c1 = t2.c1)
4037    ->  Seq Scan on t1
4038    ->  Hash
4039          ->  Seq Scan on t2
4040 (5 rows)
4041
4042 COMMIT;
4043 -- No. A-12-3-3
4044 SET enable_indexscan TO off;
4045 SET enable_mergejoin TO off;
4046 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4047           QUERY PLAN          
4048 ------------------------------
4049  Hash Join
4050    Hash Cond: (t1.c1 = t2.c1)
4051    ->  Seq Scan on t1
4052    ->  Hash
4053          ->  Seq Scan on t2
4054 (5 rows)
4055
4056 SELECT name, setting FROM settings;
4057            name            |  setting  
4058 ---------------------------+-----------
4059  geqo                      | on
4060  geqo_effort               | 5
4061  geqo_generations          | 0
4062  geqo_pool_size            | 0
4063  geqo_seed                 | 0
4064  geqo_selection_bias       | 2
4065  geqo_threshold            | 12
4066  constraint_exclusion      | partition
4067  cursor_tuple_fraction     | 0.1
4068  default_statistics_target | 100
4069  from_collapse_limit       | 8
4070  join_collapse_limit       | 8
4071  cpu_index_tuple_cost      | 0.005
4072  cpu_operator_cost         | 0.0025
4073  cpu_tuple_cost            | 0.01
4074  effective_cache_size      | 16384
4075  random_page_cost          | 4
4076  seq_page_cost             | 1
4077  enable_bitmapscan         | on
4078  enable_hashagg            | on
4079  enable_hashjoin           | on
4080  enable_indexonlyscan      | on
4081  enable_indexscan          | off
4082  enable_material           | on
4083  enable_mergejoin          | off
4084  enable_nestloop           | on
4085  enable_seqscan            | on
4086  enable_sort               | on
4087  enable_tidscan            | on
4088  client_min_messages       | log
4089 (30 rows)
4090
4091 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4092 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4093 LOG:  pg_hint_plan:
4094 used hint:
4095 IndexScan(t2)
4096 MergeJoin(t1 t2)
4097 Leading(t2 t1)
4098 Set(enable_indexscan on)
4099 Set(geqo_threshold 100)
4100 not used hint:
4101 duplication hint:
4102 error hint:
4103
4104              QUERY PLAN             
4105 ------------------------------------
4106  Merge Join
4107    Merge Cond: (t1.c1 = t2.c1)
4108    ->  Index Scan using t1_i1 on t1
4109    ->  Index Scan using t2_i1 on t2
4110 (4 rows)
4111
4112 \connect
4113 SET enable_indexscan TO off;
4114 SET enable_mergejoin TO off;
4115 LOAD 'pg_hint_plan';
4116 SELECT name, setting FROM settings;
4117            name            |  setting  
4118 ---------------------------+-----------
4119  geqo                      | on
4120  geqo_effort               | 5
4121  geqo_generations          | 0
4122  geqo_pool_size            | 0
4123  geqo_seed                 | 0
4124  geqo_selection_bias       | 2
4125  geqo_threshold            | 12
4126  constraint_exclusion      | partition
4127  cursor_tuple_fraction     | 0.1
4128  default_statistics_target | 100
4129  from_collapse_limit       | 8
4130  join_collapse_limit       | 8
4131  cpu_index_tuple_cost      | 0.005
4132  cpu_operator_cost         | 0.0025
4133  cpu_tuple_cost            | 0.01
4134  effective_cache_size      | 16384
4135  random_page_cost          | 4
4136  seq_page_cost             | 1
4137  enable_bitmapscan         | on
4138  enable_hashagg            | on
4139  enable_hashjoin           | on
4140  enable_indexonlyscan      | on
4141  enable_indexscan          | off
4142  enable_material           | on
4143  enable_mergejoin          | off
4144  enable_nestloop           | on
4145  enable_seqscan            | on
4146  enable_sort               | on
4147  enable_tidscan            | on
4148  client_min_messages       | notice
4149 (30 rows)
4150
4151 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4152           QUERY PLAN          
4153 ------------------------------
4154  Hash Join
4155    Hash Cond: (t1.c1 = t2.c1)
4156    ->  Seq Scan on t1
4157    ->  Hash
4158          ->  Seq Scan on t2
4159 (5 rows)
4160
4161 SET pg_hint_plan.enable_hint TO on;
4162 SET pg_hint_plan.debug_print TO on;
4163 SET client_min_messages TO LOG;
4164 SET search_path TO public;
4165 RESET enable_indexscan;
4166 RESET enable_mergejoin;
4167 ----
4168 ---- No. A-13 call planner recursively
4169 ----
4170 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4171 DECLARE
4172     new_cnt int;
4173 BEGIN
4174     RAISE NOTICE 'nested_planner(%)', cnt;
4175
4176     /* 再帰終了の判断 */
4177     IF cnt <= 1 THEN
4178         RETURN 0;
4179     END IF;
4180
4181     EXECUTE '/*+ IndexScan(t_1) */'
4182             ' SELECT nested_planner($1) FROM s1.t1 t_1'
4183             ' JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)'
4184             ' ORDER BY t_1.c1 LIMIT 1'
4185         INTO new_cnt USING cnt - 1;
4186
4187     RETURN new_cnt;
4188 END;
4189 $$ LANGUAGE plpgsql IMMUTABLE;
4190 ----
4191 ---- No. A-13-2 use hint of main query
4192 ----
4193 --No.13-2-1
4194 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4195 NOTICE:  nested_planner(1)
4196               QUERY PLAN               
4197 ---------------------------------------
4198  Index Only Scan using t1_i1 on t1 t_1
4199 (1 row)
4200
4201 /*+SeqScan(t_1)*/
4202 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4203 NOTICE:  nested_planner(1)
4204 LOG:  pg_hint_plan:
4205 used hint:
4206 SeqScan(t_1)
4207 not used hint:
4208 duplication hint:
4209 error hint:
4210
4211         QUERY PLAN        
4212 --------------------------
4213  Sort
4214    Sort Key: c1
4215    ->  Seq Scan on t1 t_1
4216 (3 rows)
4217
4218 ----
4219 ---- No. A-13-3 output number of times of debugging log
4220 ----
4221 --No.13-3-1
4222 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4223 NOTICE:  nested_planner(1)
4224               QUERY PLAN               
4225 ---------------------------------------
4226  Index Only Scan using t1_i1 on t1 t_1
4227 (1 row)
4228
4229 /*+SeqScan(t_2)*/
4230 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4231 NOTICE:  nested_planner(1)
4232 LOG:  pg_hint_plan:
4233 used hint:
4234 not used hint:
4235 SeqScan(t_2)
4236 duplication hint:
4237 error hint:
4238
4239               QUERY PLAN               
4240 ---------------------------------------
4241  Index Only Scan using t1_i1 on t1 t_1
4242 (1 row)
4243
4244 --No.13-3-2
4245 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4246 NOTICE:  nested_planner(2)
4247 NOTICE:  nested_planner(1)
4248 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4249 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4250               QUERY PLAN               
4251 ---------------------------------------
4252  Index Only Scan using t1_i1 on t1 t_1
4253 (1 row)
4254
4255 /*+SeqScan(t_2)*/
4256 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4257 NOTICE:  nested_planner(2)
4258 NOTICE:  nested_planner(1)
4259 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4260 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4261 LOG:  pg_hint_plan:
4262 used hint:
4263 SeqScan(t_2)
4264 not used hint:
4265 duplication hint:
4266 error hint:
4267
4268 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4269 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4270 LOG:  pg_hint_plan:
4271 used hint:
4272 not used hint:
4273 SeqScan(t_2)
4274 duplication hint:
4275 error hint:
4276
4277               QUERY PLAN               
4278 ---------------------------------------
4279  Index Only Scan using t1_i1 on t1 t_1
4280 (1 row)
4281
4282 --No.13-3-3
4283 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4284 NOTICE:  nested_planner(5)
4285 NOTICE:  nested_planner(4)
4286 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4287 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4288 NOTICE:  nested_planner(3)
4289 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4290 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4291 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4292 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4293 NOTICE:  nested_planner(2)
4294 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4295 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4296 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4297 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4298 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4299 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4300 NOTICE:  nested_planner(1)
4301 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4302 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4303 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4304 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4305 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4306 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4307 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4308 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4309               QUERY PLAN               
4310 ---------------------------------------
4311  Index Only Scan using t1_i1 on t1 t_1
4312 (1 row)
4313
4314 /*+SeqScan(t_2)*/
4315 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4316 NOTICE:  nested_planner(5)
4317 NOTICE:  nested_planner(4)
4318 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4319 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4320 NOTICE:  nested_planner(3)
4321 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4322 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4323 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4324 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4325 NOTICE:  nested_planner(2)
4326 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4327 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4328 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4329 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4330 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4331 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4332 NOTICE:  nested_planner(1)
4333 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4334 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4335 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4336 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4337 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4338 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4339 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4340 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4341 LOG:  pg_hint_plan:
4342 used hint:
4343 SeqScan(t_2)
4344 not used hint:
4345 duplication hint:
4346 error hint:
4347
4348 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4349 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4350 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4351 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4352 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4353 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4354 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4355 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4356 LOG:  pg_hint_plan:
4357 used hint:
4358 SeqScan(t_2)
4359 not used hint:
4360 duplication hint:
4361 error hint:
4362
4363 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4364 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4365 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4366 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4367 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4368 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4369 LOG:  pg_hint_plan:
4370 used hint:
4371 SeqScan(t_2)
4372 not used hint:
4373 duplication hint:
4374 error hint:
4375
4376 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4377 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4378 SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4379 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4380 LOG:  pg_hint_plan:
4381 used hint:
4382 SeqScan(t_2)
4383 not used hint:
4384 duplication hint:
4385 error hint:
4386
4387 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4388 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4389 LOG:  pg_hint_plan:
4390 used hint:
4391 not used hint:
4392 SeqScan(t_2)
4393 duplication hint:
4394 error hint:
4395
4396               QUERY PLAN               
4397 ---------------------------------------
4398  Index Only Scan using t1_i1 on t1 t_1
4399 (1 row)
4400
4401 ----
4402 ---- No. A-13-4 output of debugging log on hint status
4403 ----
4404 --No.13-4-1
4405 /*+HashJoin(t_1 t_2)*/
4406 EXPLAIN (COSTS false)
4407  SELECT nested_planner(2) FROM s1.t1 t_1
4408    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4409   ORDER BY t_1.c1;
4410 NOTICE:  nested_planner(2)
4411 NOTICE:  nested_planner(1)
4412 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4413 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4414 LOG:  pg_hint_plan:
4415 used hint:
4416 HashJoin(t_1 t_2)
4417 not used hint:
4418 duplication hint:
4419 error hint:
4420
4421 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4422 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4423 LOG:  pg_hint_plan:
4424 used hint:
4425 HashJoin(t_1 t_2)
4426 not used hint:
4427 duplication hint:
4428 error hint:
4429
4430               QUERY PLAN              
4431 --------------------------------------
4432  Sort
4433    Sort Key: t_1.c1
4434    ->  Hash Join
4435          Hash Cond: (t_1.c1 = t_2.c1)
4436          ->  Seq Scan on t1 t_1
4437          ->  Hash
4438                ->  Seq Scan on t2 t_2
4439 (7 rows)
4440
4441 --No.13-4-2
4442 /*+HashJoin(st_1 st_2)*/
4443 EXPLAIN (COSTS false)
4444  SELECT nested_planner(2) FROM s1.t1 st_1
4445    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4446   ORDER BY st_1.c1;
4447 NOTICE:  nested_planner(2)
4448 NOTICE:  nested_planner(1)
4449 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4450 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4451 LOG:  pg_hint_plan:
4452 used hint:
4453 not used hint:
4454 HashJoin(st_1 st_2)
4455 duplication hint:
4456 error hint:
4457
4458 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4459 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4460 LOG:  pg_hint_plan:
4461 used hint:
4462 HashJoin(st_1 st_2)
4463 not used hint:
4464 duplication hint:
4465 error hint:
4466
4467                QUERY PLAN               
4468 ----------------------------------------
4469  Sort
4470    Sort Key: st_1.c1
4471    ->  Hash Join
4472          Hash Cond: (st_1.c1 = st_2.c1)
4473          ->  Seq Scan on t1 st_1
4474          ->  Hash
4475                ->  Seq Scan on t2 st_2
4476 (7 rows)
4477
4478 --No.13-4-3
4479 /*+HashJoin(t_1 t_2)*/
4480 EXPLAIN (COSTS false)
4481  SELECT nested_planner(2) FROM s1.t1 st_1
4482    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4483   ORDER BY st_1.c1;
4484 NOTICE:  nested_planner(2)
4485 NOTICE:  nested_planner(1)
4486 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4487 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4488 LOG:  pg_hint_plan:
4489 used hint:
4490 HashJoin(t_1 t_2)
4491 not used hint:
4492 duplication hint:
4493 error hint:
4494
4495 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4496 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4497 LOG:  pg_hint_plan:
4498 used hint:
4499 not used hint:
4500 HashJoin(t_1 t_2)
4501 duplication hint:
4502 error hint:
4503
4504                   QUERY PLAN                  
4505 ----------------------------------------------
4506  Merge Join
4507    Merge Cond: (st_1.c1 = st_2.c1)
4508    ->  Index Only Scan using t1_i1 on t1 st_1
4509    ->  Sort
4510          Sort Key: st_2.c1
4511          ->  Seq Scan on t2 st_2
4512 (6 rows)
4513
4514 --No.13-4-4
4515 /*+HashJoin(st_1 st_2)*/
4516 EXPLAIN (COSTS false)
4517  SELECT nested_planner(2) FROM s1.t1 t_1
4518    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4519   ORDER BY t_1.c1;
4520 NOTICE:  nested_planner(2)
4521 NOTICE:  nested_planner(1)
4522 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4523 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4524 LOG:  pg_hint_plan:
4525 used hint:
4526 not used hint:
4527 HashJoin(st_1 st_2)
4528 duplication hint:
4529 error hint:
4530
4531 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4532 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4533 LOG:  pg_hint_plan:
4534 used hint:
4535 not used hint:
4536 HashJoin(st_1 st_2)
4537 duplication hint:
4538 error hint:
4539
4540                  QUERY PLAN                  
4541 ---------------------------------------------
4542  Merge Join
4543    Merge Cond: (t_1.c1 = t_2.c1)
4544    ->  Index Only Scan using t1_i1 on t1 t_1
4545    ->  Sort
4546          Sort Key: t_2.c1
4547          ->  Seq Scan on t2 t_2
4548 (6 rows)
4549
4550 --No.13-4-5
4551 /*+HashJoin(t_1 t_1)*/
4552 EXPLAIN (COSTS false)
4553  SELECT nested_planner(2) FROM s1.t1 t_1
4554   ORDER BY t_1.c1;
4555 NOTICE:  nested_planner(2)
4556 NOTICE:  nested_planner(1)
4557 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4558 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4559 INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
4560 DETAIL:  Relation name "t_1" is duplicated.
4561 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4562 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4563 LOG:  pg_hint_plan:
4564 used hint:
4565 not used hint:
4566 duplication hint:
4567 error hint:
4568 HashJoin(t_1 t_1)
4569
4570 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4571 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4572 LOG:  pg_hint_plan:
4573 used hint:
4574 not used hint:
4575 HashJoin(t_1 t_1)
4576 duplication hint:
4577 error hint:
4578
4579               QUERY PLAN               
4580 ---------------------------------------
4581  Index Only Scan using t1_i1 on t1 t_1
4582 (1 row)
4583
4584 --No.13-4-6
4585 CREATE OR REPLACE FUNCTION nested_planner_one_t(cnt int) RETURNS int AS $$
4586 DECLARE
4587     new_cnt int;
4588 BEGIN
4589     RAISE NOTICE 'nested_planner_one_t(%)', cnt;
4590
4591     IF cnt <= 1 THEN
4592         RETURN 0;
4593     END IF;
4594
4595     EXECUTE '/*+ IndexScan(t_1) */'
4596             ' SELECT nested_planner_one_t($1) FROM s1.t1 t_1'
4597             ' ORDER BY t_1.c1 LIMIT 1'
4598         INTO new_cnt USING cnt - 1;
4599
4600     RETURN new_cnt;
4601 END;
4602 $$ LANGUAGE plpgsql IMMUTABLE;
4603 EXPLAIN (COSTS false)
4604  SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4605    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4606   ORDER BY t_1.c1;
4607 NOTICE:  nested_planner_one_t(2)
4608 NOTICE:  nested_planner_one_t(1)
4609 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1"
4610 PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement
4611                  QUERY PLAN                  
4612 ---------------------------------------------
4613  Merge Join
4614    Merge Cond: (t_1.c1 = t_2.c1)
4615    ->  Index Only Scan using t1_i1 on t1 t_1
4616    ->  Sort
4617          Sort Key: t_2.c1
4618          ->  Seq Scan on t2 t_2
4619 (6 rows)
4620
4621 /*+HashJoin(t_1 t_1)*/
4622 EXPLAIN (COSTS false)
4623  SELECT nested_planner_one_t(2) FROM s1.t1 t_1
4624    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4625   ORDER BY t_1.c1;
4626 NOTICE:  nested_planner_one_t(2)
4627 NOTICE:  nested_planner_one_t(1)
4628 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1"
4629 PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement
4630 LOG:  pg_hint_plan:
4631 used hint:
4632 not used hint:
4633 HashJoin(t_1 t_1)
4634 duplication hint:
4635 error hint:
4636
4637 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner_one_t($1) FROM s1.t1 t_1 ORDER BY t_1.c1 LIMIT 1"
4638 PL/pgSQL function nested_planner_one_t(integer) line 11 at EXECUTE statement
4639 INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
4640 DETAIL:  Relation name "t_1" is duplicated.
4641 LOG:  pg_hint_plan:
4642 used hint:
4643 not used hint:
4644 duplication hint:
4645 error hint:
4646 HashJoin(t_1 t_1)
4647
4648                  QUERY PLAN                  
4649 ---------------------------------------------
4650  Merge Join
4651    Merge Cond: (t_1.c1 = t_2.c1)
4652    ->  Index Only Scan using t1_i1 on t1 t_1
4653    ->  Sort
4654          Sort Key: t_2.c1
4655          ->  Seq Scan on t2 t_2
4656 (6 rows)
4657
4658 DROP FUNCTION nested_planner_one_t(int);
4659 --No.13-4-7
4660 /*+HashJoin(t_1 t_1)*/
4661 EXPLAIN (COSTS false)
4662  SELECT nested_planner(2) FROM s1.t1 t_1
4663    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4664   ORDER BY t_1.c1;
4665 NOTICE:  nested_planner(2)
4666 NOTICE:  nested_planner(1)
4667 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4668 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4669 INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
4670 DETAIL:  Relation name "t_1" is duplicated.
4671 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4672 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4673 LOG:  pg_hint_plan:
4674 used hint:
4675 not used hint:
4676 duplication hint:
4677 error hint:
4678 HashJoin(t_1 t_1)
4679
4680 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4681 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4682 INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
4683 DETAIL:  Relation name "t_1" is duplicated.
4684 LOG:  pg_hint_plan:
4685 used hint:
4686 not used hint:
4687 duplication hint:
4688 error hint:
4689 HashJoin(t_1 t_1)
4690
4691                  QUERY PLAN                  
4692 ---------------------------------------------
4693  Merge Join
4694    Merge Cond: (t_1.c1 = t_2.c1)
4695    ->  Index Only Scan using t1_i1 on t1 t_1
4696    ->  Sort
4697          Sort Key: t_2.c1
4698          ->  Seq Scan on t2 t_2
4699 (6 rows)
4700
4701 --No.13-4-8
4702 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
4703 EXPLAIN (COSTS false)
4704  SELECT nested_planner(2) FROM s1.t1 t_1
4705    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4706   ORDER BY t_1.c1;
4707 INFO:  hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4708 DETAIL:  Conflict join method hint.
4709 NOTICE:  nested_planner(2)
4710 INFO:  hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4711 DETAIL:  Conflict join method hint.
4712 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4713 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4714 NOTICE:  nested_planner(1)
4715 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4716 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4717 LOG:  pg_hint_plan:
4718 used hint:
4719 HashJoin(t_1 t_2)
4720 not used hint:
4721 duplication hint:
4722 MergeJoin(t_1 t_2)
4723 error hint:
4724
4725 CONTEXT:  SQL statement "/*+ IndexScan(t_1) */ SELECT nested_planner($1) FROM s1.t1 t_1 JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1) ORDER BY t_1.c1 LIMIT 1"
4726 PL/pgSQL function nested_planner(integer) line 12 at EXECUTE statement
4727 LOG:  pg_hint_plan:
4728 used hint:
4729 HashJoin(t_1 t_2)
4730 not used hint:
4731 duplication hint:
4732 MergeJoin(t_1 t_2)
4733 error hint:
4734
4735               QUERY PLAN              
4736 --------------------------------------
4737  Sort
4738    Sort Key: t_1.c1
4739    ->  Hash Join
4740          Hash Cond: (t_1.c1 = t_2.c1)
4741          ->  Seq Scan on t1 t_1
4742          ->  Hash
4743                ->  Seq Scan on t2 t_2
4744 (7 rows)
4745