OSDN Git Service

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