OSDN Git Service

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