OSDN Git Service

PREPARE/EXECUTEの試験で、ジェネリックプランを使うように修正した。
[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:  Relation name is necessary.
904             QUERY PLAN            
905 ----------------------------------
906  Index Scan using t1_i1 on t1 ")"
907    Index Cond: (c1 = 1)
908 (2 rows)
909
910 /*+SeqScan(")")*/
911 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
912 LOG:  pg_hint_plan:
913 used hint:
914 SeqScan(")")
915 not used hint:
916 duplication hint:
917 error hint:
918
919      QUERY PLAN     
920 --------------------
921  Seq Scan on t1 ")"
922    Filter: (c1 = 1)
923 (2 rows)
924
925 /*+SeqScan(")))")*/
926 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")))" WHERE ")))".c1 = 1;
927 LOG:  pg_hint_plan:
928 used hint:
929 SeqScan(")))")
930 not used hint:
931 duplication hint:
932 error hint:
933
934       QUERY PLAN      
935 ----------------------
936  Seq Scan on t1 ")))"
937    Filter: (c1 = 1)
938 (2 rows)
939
940 -- No. A-5-5-5
941 -- No. A-7-2-5
942 /*+SeqScan(")*/
943 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
944 INFO:  hint syntax error at or near ""
945 DETAIL:  Unterminated quoted relation name.
946             QUERY PLAN             
947 -----------------------------------
948  Index Scan using t1_i1 on t1 """"
949    Index Cond: (c1 = 1)
950 (2 rows)
951
952 /*+SeqScan("""")*/
953 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
954 LOG:  pg_hint_plan:
955 used hint:
956 SeqScan("""")
957 not used hint:
958 duplication hint:
959 error hint:
960
961      QUERY PLAN      
962 ---------------------
963  Seq Scan on t1 """"
964    Filter: (c1 = 1)
965 (2 rows)
966
967 /*+SeqScan("""""""")*/
968 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """""""" WHERE """""""".c1 = 1;
969 LOG:  pg_hint_plan:
970 used hint:
971 SeqScan("""""""")
972 not used hint:
973 duplication hint:
974 error hint:
975
976        QUERY PLAN        
977 -------------------------
978  Seq Scan on t1 """"""""
979    Filter: (c1 = 1)
980 (2 rows)
981
982 -- No. A-5-5-6
983 -- No. A-7-2-6
984 /*+SeqScan( )*/
985 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
986 INFO:  hint syntax error at or near ")"
987 DETAIL:  Relation name is necessary.
988             QUERY PLAN            
989 ----------------------------------
990  Index Scan using t1_i1 on t1 " "
991    Index Cond: (c1 = 1)
992 (2 rows)
993
994 /*+SeqScan(" ")*/
995 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
996 LOG:  pg_hint_plan:
997 used hint:
998 SeqScan(" ")
999 not used hint:
1000 duplication hint:
1001 error hint:
1002
1003      QUERY PLAN     
1004 --------------------
1005  Seq Scan on t1 " "
1006    Filter: (c1 = 1)
1007 (2 rows)
1008
1009 /*+SeqScan("   ")*/
1010 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "   " WHERE "   ".c1 = 1;
1011 LOG:  pg_hint_plan:
1012 used hint:
1013 SeqScan("   ")
1014 not used hint:
1015 duplication hint:
1016 error hint:
1017
1018       QUERY PLAN      
1019 ----------------------
1020  Seq Scan on t1 "   "
1021    Filter: (c1 = 1)
1022 (2 rows)
1023
1024 -- No. A-5-5-7
1025 -- No. A-7-2-7
1026 /*+SeqScan(     )*/
1027 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "     " WHERE "       ".c1 = 1;
1028 INFO:  hint syntax error at or near ")"
1029 DETAIL:  Relation name is necessary.
1030             QUERY PLAN             
1031 -----------------------------------
1032  Index Scan using t1_i1 on t1 "  "
1033    Index Cond: (c1 = 1)
1034 (2 rows)
1035
1036 /*+SeqScan("    ")*/
1037 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "     " WHERE "       ".c1 = 1;
1038 LOG:  pg_hint_plan:
1039 used hint:
1040 SeqScan("       ")
1041 not used hint:
1042 duplication hint:
1043 error hint:
1044
1045         QUERY PLAN         
1046 ---------------------------
1047  Seq Scan on t1 "        "
1048    Filter: (c1 = 1)
1049 (2 rows)
1050
1051 /*+SeqScan("                    ")*/
1052 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "                     " WHERE "                       ".c1 = 1;
1053 LOG:  pg_hint_plan:
1054 used hint:
1055 SeqScan("                       ")
1056 not used hint:
1057 duplication hint:
1058 error hint:
1059
1060                 QUERY PLAN                 
1061 -------------------------------------------
1062  Seq Scan on t1 "                        "
1063    Filter: (c1 = 1)
1064 (2 rows)
1065
1066 -- No. A-5-5-8
1067 -- No. A-7-2-8
1068 /*+SeqScan(
1069 )*/
1070 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1071 " WHERE "
1072 ".c1 = 1;
1073 INFO:  hint syntax error at or near ")"
1074 DETAIL:  Relation name is necessary.
1075            QUERY PLAN           
1076 --------------------------------
1077  Index Scan using t1_i1 on t1 "
1078  "
1079    Index Cond: (c1 = 1)
1080 (3 rows)
1081
1082 /*+SeqScan("
1083 ")*/
1084 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1085 " WHERE "
1086 ".c1 = 1;
1087 LOG:  pg_hint_plan:
1088 used hint:
1089 SeqScan("
1090 ")
1091 not used hint:
1092 duplication hint:
1093 error hint:
1094
1095      QUERY PLAN     
1096 --------------------
1097  Seq Scan on t1 "
1098  "
1099    Filter: (c1 = 1)
1100 (3 rows)
1101
1102 /*+SeqScan("
1103
1104
1105 ")*/
1106 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
1107
1108
1109 " WHERE "
1110
1111
1112 ".c1 = 1;
1113 LOG:  pg_hint_plan:
1114 used hint:
1115 SeqScan("
1116
1117
1118 ")
1119 not used hint:
1120 duplication hint:
1121 error hint:
1122
1123      QUERY PLAN     
1124 --------------------
1125  Seq Scan on t1 "
1126  
1127  
1128  "
1129    Filter: (c1 = 1)
1130 (5 rows)
1131
1132 -- No. A-5-5-9
1133 -- No. A-7-2-9
1134 /*+SeqScan(Set)*/
1135 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1136 LOG:  pg_hint_plan:
1137 used hint:
1138 SeqScan(Set)
1139 not used hint:
1140 duplication hint:
1141 error hint:
1142
1143       QUERY PLAN      
1144 ----------------------
1145  Seq Scan on t1 "Set"
1146    Filter: (c1 = 1)
1147 (2 rows)
1148
1149 /*+SeqScan("Set")*/
1150 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set" WHERE "Set".c1 = 1;
1151 LOG:  pg_hint_plan:
1152 used hint:
1153 SeqScan(Set)
1154 not used hint:
1155 duplication hint:
1156 error hint:
1157
1158       QUERY PLAN      
1159 ----------------------
1160  Seq Scan on t1 "Set"
1161    Filter: (c1 = 1)
1162 (2 rows)
1163
1164 /*+SeqScan("Set SeqScan Leading")*/
1165 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "Set SeqScan Leading" WHERE "Set SeqScan Leading".c1 = 1;
1166 LOG:  pg_hint_plan:
1167 used hint:
1168 SeqScan("Set SeqScan Leading")
1169 not used hint:
1170 duplication hint:
1171 error hint:
1172
1173               QUERY PLAN              
1174 --------------------------------------
1175  Seq Scan on t1 "Set SeqScan Leading"
1176    Filter: (c1 = 1)
1177 (2 rows)
1178
1179 -- No. A-5-5-10
1180 -- No. A-7-2-10
1181 /*+SeqScan(あ)*/
1182 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あ WHERE あ.c1 = 1;
1183 LOG:  pg_hint_plan:
1184 used hint:
1185 SeqScan(あ)
1186 not used hint:
1187 duplication hint:
1188 error hint:
1189
1190      QUERY PLAN      
1191 ---------------------
1192  Seq Scan on t1 "あ"
1193    Filter: (c1 = 1)
1194 (2 rows)
1195
1196 /*+SeqScan(あいう)*/
1197 EXPLAIN (COSTS false) SELECT * FROM s1.t1 あいう WHERE あいう.c1 = 1;
1198 LOG:  pg_hint_plan:
1199 used hint:
1200 SeqScan(あいう)
1201 not used hint:
1202 duplication hint:
1203 error hint:
1204
1205        QUERY PLAN        
1206 -------------------------
1207  Seq Scan on t1 "あいう"
1208    Filter: (c1 = 1)
1209 (2 rows)
1210
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 -- No. A-5-5-11
1242 -- No. A-7-2-11
1243 /*+SeqScan(/**/)*/
1244 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
1245 INFO:  hint syntax error at or near "/**/)*/
1246 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
1247 DETAIL:  Nested block comments are not supported.
1248              QUERY PLAN              
1249 -------------------------------------
1250  Index Scan using t1_i1 on t1 "/**/"
1251    Index Cond: (c1 = 1)
1252 (2 rows)
1253
1254 /*+SeqScan(/**//**//**/)*/
1255 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
1256 INFO:  hint syntax error at or near "/**//**//**/)*/
1257 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
1258 DETAIL:  Nested block comments are not supported.
1259                  QUERY PLAN                  
1260 ---------------------------------------------
1261  Index Scan using t1_i1 on t1 "/**//**//**/"
1262    Index Cond: (c1 = 1)
1263 (2 rows)
1264
1265 -- No. A-5-5-12
1266 -- No. A-7-2-12
1267 /*+SeqScan("tT()""      
1268 Set/**/あ")*/
1269 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1270 Set/**/あ" WHERE "tT()""       
1271 Set/**/あ".c1 = 1;
1272 INFO:  hint syntax error at or near "/**/あ")*/
1273 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1274 Set/**/あ" WHERE "tT()""       
1275 Set/**/あ".c1 = 1;"
1276 DETAIL:  Nested block comments are not supported.
1277                 QUERY PLAN                
1278 ------------------------------------------
1279  Index Scan using t1_i1 on t1 "tT()""    
1280  Set/**/あ"
1281    Index Cond: (c1 = 1)
1282 (3 rows)
1283
1284 --"
1285 /*+SeqScan("tT()""      
1286 Setあ")*/
1287 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""       
1288 Setあ" WHERE "tT()""   
1289 Setあ".c1 = 1;
1290 LOG:  pg_hint_plan:
1291 used hint:
1292 SeqScan("tT()""         
1293 Setあ")
1294 not used hint:
1295 duplication hint:
1296 error hint:
1297
1298         QUERY PLAN        
1299 --------------------------
1300  Seq Scan on t1 "tT()""  
1301  Setあ"
1302    Filter: (c1 = 1)
1303 (3 rows)
1304
1305 ----
1306 ---- No. A-5-6 hint parse error
1307 ----
1308 -- No. A-5-6-1
1309 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1310 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1311 INFO:  hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1312 DETAIL:  Opening parenthesis is necessary.
1313 LOG:  pg_hint_plan:
1314 used hint:
1315 Set(enable_indexscan off)
1316 not used hint:
1317 duplication hint:
1318 error hint:
1319
1320             QUERY PLAN            
1321 ----------------------------------
1322  Bitmap Heap Scan on t1
1323    Recheck Cond: (c1 = 1)
1324    ->  Bitmap Index Scan on t1_i1
1325          Index Cond: (c1 = 1)
1326 (4 rows)
1327
1328 -- No. A-5-6-2
1329 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
1330 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1331 INFO:  hint syntax error at or near "Set(enable_bitmapscan off)SeqScan(t1)"
1332 DETAIL:  Closing parenthesis is necessary.
1333 LOG:  pg_hint_plan:
1334 used hint:
1335 Set(enable_indexscan off)
1336 not used hint:
1337 duplication hint:
1338 error hint:
1339
1340             QUERY PLAN            
1341 ----------------------------------
1342  Bitmap Heap Scan on t1
1343    Recheck Cond: (c1 = 1)
1344    ->  Bitmap Index Scan on t1_i1
1345          Index Cond: (c1 = 1)
1346 (4 rows)
1347
1348 -- No. A-5-6-3
1349 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
1350 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1351 INFO:  hint syntax error at or near ""
1352 DETAIL:  Unterminated quoted parameter value.
1353 LOG:  pg_hint_plan:
1354 used hint:
1355 Set(enable_indexscan off)
1356 not used hint:
1357 duplication hint:
1358 error hint:
1359
1360             QUERY PLAN            
1361 ----------------------------------
1362  Bitmap Heap Scan on t1
1363    Recheck Cond: (c1 = 1)
1364    ->  Bitmap Index Scan on t1_i1
1365          Index Cond: (c1 = 1)
1366 (4 rows)
1367
1368 -- No. A-5-6-4
1369 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
1370 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1371 INFO:  hint syntax error at or near ")Set(enable_bitmapscan off)"
1372 DETAIL:  Relation name is necessary.
1373 LOG:  pg_hint_plan:
1374 used hint:
1375 Set(enable_indexscan off)
1376 not used hint:
1377 duplication hint:
1378 error hint:
1379
1380             QUERY PLAN            
1381 ----------------------------------
1382  Bitmap Heap Scan on t1
1383    Recheck Cond: (c1 = 1)
1384    ->  Bitmap Index Scan on t1_i1
1385          Index Cond: (c1 = 1)
1386 (4 rows)
1387
1388 -- No. A-5-6-5
1389 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1390 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1391 INFO:  hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1392 DETAIL:  Unrecognized hint keyword "NoSet".
1393 LOG:  pg_hint_plan:
1394 used hint:
1395 Set(enable_indexscan off)
1396 not used hint:
1397 duplication hint:
1398 error hint:
1399
1400             QUERY PLAN            
1401 ----------------------------------
1402  Bitmap Heap Scan on t1
1403    Recheck Cond: (c1 = 1)
1404    ->  Bitmap Index Scan on t1_i1
1405          Index Cond: (c1 = 1)
1406 (4 rows)
1407
1408 -- No. A-5-6-6
1409 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
1410 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1411 INFO:  hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
1412 DETAIL:  Unrecognized hint keyword ""Set"".
1413 LOG:  pg_hint_plan:
1414 used hint:
1415 Set(enable_indexscan off)
1416 not used hint:
1417 duplication hint:
1418 error hint:
1419
1420             QUERY PLAN            
1421 ----------------------------------
1422  Bitmap Heap Scan on t1
1423    Recheck Cond: (c1 = 1)
1424    ->  Bitmap Index Scan on t1_i1
1425          Index Cond: (c1 = 1)
1426 (4 rows)
1427
1428 -- No. A-5-6-7
1429 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1430 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1431 INFO:  hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
1432 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
1433 DETAIL:  Nested block comments are not supported.
1434           QUERY PLAN          
1435 ------------------------------
1436  Index Scan using t1_i1 on t1
1437    Index Cond: (c1 = 1)
1438 (2 rows)
1439
1440 ----
1441 ---- No. A-6-1 original GUC parameter
1442 ----
1443 -- No. A-6-1-1
1444 SET ROLE super_user;
1445 SET pg_hint_plan.debug_print TO off;
1446 SHOW pg_hint_plan.enable_hint;
1447  pg_hint_plan.enable_hint 
1448 --------------------------
1449  on
1450 (1 row)
1451
1452 SHOW pg_hint_plan.debug_print;
1453  pg_hint_plan.debug_print 
1454 --------------------------
1455  off
1456 (1 row)
1457
1458 SHOW pg_hint_plan.parse_messages;
1459  pg_hint_plan.parse_messages 
1460 -----------------------------
1461  info
1462 (1 row)
1463
1464 SET pg_hint_plan.enable_hint TO off;
1465 SET pg_hint_plan.debug_print TO on;
1466 SET pg_hint_plan.parse_messages TO error;
1467 SHOW pg_hint_plan.enable_hint;
1468  pg_hint_plan.enable_hint 
1469 --------------------------
1470  off
1471 (1 row)
1472
1473 SHOW pg_hint_plan.debug_print;
1474  pg_hint_plan.debug_print 
1475 --------------------------
1476  on
1477 (1 row)
1478
1479 SHOW pg_hint_plan.parse_messages;
1480  pg_hint_plan.parse_messages 
1481 -----------------------------
1482  error
1483 (1 row)
1484
1485 RESET pg_hint_plan.enable_hint;
1486 RESET pg_hint_plan.debug_print;
1487 RESET pg_hint_plan.parse_messages;
1488 SHOW pg_hint_plan.enable_hint;
1489  pg_hint_plan.enable_hint 
1490 --------------------------
1491  on
1492 (1 row)
1493
1494 SHOW pg_hint_plan.debug_print;
1495  pg_hint_plan.debug_print 
1496 --------------------------
1497  off
1498 (1 row)
1499
1500 SHOW pg_hint_plan.parse_messages;
1501  pg_hint_plan.parse_messages 
1502 -----------------------------
1503  info
1504 (1 row)
1505
1506 -- No. A-6-1-2
1507 SET ROLE normal_user;
1508 SHOW pg_hint_plan.enable_hint;
1509  pg_hint_plan.enable_hint 
1510 --------------------------
1511  on
1512 (1 row)
1513
1514 SHOW pg_hint_plan.debug_print;
1515  pg_hint_plan.debug_print 
1516 --------------------------
1517  off
1518 (1 row)
1519
1520 SHOW pg_hint_plan.parse_messages;
1521  pg_hint_plan.parse_messages 
1522 -----------------------------
1523  info
1524 (1 row)
1525
1526 SET pg_hint_plan.enable_hint TO off;
1527 SET pg_hint_plan.debug_print TO on;
1528 SET pg_hint_plan.parse_messages TO error;
1529 SHOW pg_hint_plan.enable_hint;
1530  pg_hint_plan.enable_hint 
1531 --------------------------
1532  off
1533 (1 row)
1534
1535 SHOW pg_hint_plan.debug_print;
1536  pg_hint_plan.debug_print 
1537 --------------------------
1538  on
1539 (1 row)
1540
1541 SHOW pg_hint_plan.parse_messages;
1542  pg_hint_plan.parse_messages 
1543 -----------------------------
1544  error
1545 (1 row)
1546
1547 RESET pg_hint_plan.enable_hint;
1548 RESET pg_hint_plan.debug_print;
1549 RESET pg_hint_plan.parse_messages;
1550 SHOW pg_hint_plan.enable_hint;
1551  pg_hint_plan.enable_hint 
1552 --------------------------
1553  on
1554 (1 row)
1555
1556 SHOW pg_hint_plan.debug_print;
1557  pg_hint_plan.debug_print 
1558 --------------------------
1559  off
1560 (1 row)
1561
1562 SHOW pg_hint_plan.parse_messages;
1563  pg_hint_plan.parse_messages 
1564 -----------------------------
1565  info
1566 (1 row)
1567
1568 RESET ROLE;
1569 ----
1570 ---- No. A-6-2 original GUC parameter pg_hint_plan.enable_hint
1571 ----
1572 -- No. A-6-2-1
1573 SET pg_hint_plan.enable_hint TO on;
1574 SHOW pg_hint_plan.enable_hint;
1575  pg_hint_plan.enable_hint 
1576 --------------------------
1577  on
1578 (1 row)
1579
1580 /*+Set(enable_indexscan off)*/
1581 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1582             QUERY PLAN            
1583 ----------------------------------
1584  Bitmap Heap Scan on t1
1585    Recheck Cond: (c1 = 1)
1586    ->  Bitmap Index Scan on t1_i1
1587          Index Cond: (c1 = 1)
1588 (4 rows)
1589
1590 -- No. A-6-2-2
1591 SET pg_hint_plan.enable_hint TO off;
1592 SHOW pg_hint_plan.enable_hint;
1593  pg_hint_plan.enable_hint 
1594 --------------------------
1595  off
1596 (1 row)
1597
1598 /*+Set(enable_indexscan off)*/
1599 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1600           QUERY PLAN          
1601 ------------------------------
1602  Index Scan using t1_i1 on t1
1603    Index Cond: (c1 = 1)
1604 (2 rows)
1605
1606 -- No. A-6-2-3
1607 SET pg_hint_plan.enable_hint TO DEFAULT;
1608 SHOW pg_hint_plan.enable_hint;
1609  pg_hint_plan.enable_hint 
1610 --------------------------
1611  on
1612 (1 row)
1613
1614 /*+Set(enable_indexscan off)*/
1615 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1616             QUERY PLAN            
1617 ----------------------------------
1618  Bitmap Heap Scan on t1
1619    Recheck Cond: (c1 = 1)
1620    ->  Bitmap Index Scan on t1_i1
1621          Index Cond: (c1 = 1)
1622 (4 rows)
1623
1624 -- No. A-6-2-4
1625 SET pg_hint_plan.enable_hint TO enable;
1626 ERROR:  parameter "pg_hint_plan.enable_hint" requires a Boolean value
1627 SHOW pg_hint_plan.enable_hint;
1628  pg_hint_plan.enable_hint 
1629 --------------------------
1630  on
1631 (1 row)
1632
1633 ----
1634 ---- No. A-6-3 original GUC parameter pg_hint_plan.debug_print
1635 ----
1636 -- No. A-6-3-1
1637 SET pg_hint_plan.debug_print TO on;
1638 SHOW pg_hint_plan.debug_print;
1639  pg_hint_plan.debug_print 
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 LOG:  pg_hint_plan:
1647 used hint:
1648 Set(enable_indexscan off)
1649 not used hint:
1650 duplication hint:
1651 error hint:
1652
1653             QUERY PLAN            
1654 ----------------------------------
1655  Bitmap Heap Scan on t1
1656    Recheck Cond: (c1 = 1)
1657    ->  Bitmap Index Scan on t1_i1
1658          Index Cond: (c1 = 1)
1659 (4 rows)
1660
1661 -- No. A-6-3-2
1662 SET pg_hint_plan.debug_print TO off;
1663 SHOW pg_hint_plan.debug_print;
1664  pg_hint_plan.debug_print 
1665 --------------------------
1666  off
1667 (1 row)
1668
1669 /*+Set(enable_indexscan off)*/
1670 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1671             QUERY PLAN            
1672 ----------------------------------
1673  Bitmap Heap Scan on t1
1674    Recheck Cond: (c1 = 1)
1675    ->  Bitmap Index Scan on t1_i1
1676          Index Cond: (c1 = 1)
1677 (4 rows)
1678
1679 -- No. A-6-3-3
1680 SET pg_hint_plan.debug_print TO DEFAULT;
1681 SHOW pg_hint_plan.debug_print;
1682  pg_hint_plan.debug_print 
1683 --------------------------
1684  off
1685 (1 row)
1686
1687 /*+Set(enable_indexscan off)*/
1688 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
1689             QUERY PLAN            
1690 ----------------------------------
1691  Bitmap Heap Scan on t1
1692    Recheck Cond: (c1 = 1)
1693    ->  Bitmap Index Scan on t1_i1
1694          Index Cond: (c1 = 1)
1695 (4 rows)
1696
1697 -- No. A-6-3-4
1698 SET pg_hint_plan.debug_print TO enable;
1699 ERROR:  parameter "pg_hint_plan.debug_print" requires a Boolean value
1700 SHOW pg_hint_plan.debug_print;
1701  pg_hint_plan.debug_print 
1702 --------------------------
1703  off
1704 (1 row)
1705
1706 ----
1707 ---- No. A-6-4 original GUC parameter pg_hint_plan.parse_messages
1708 ----
1709 SET client_min_messages TO debug5;
1710 DEBUG:  CommitTransactionCommand
1711 DEBUG:  CommitTransaction
1712 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1713 -- No. A-6-4-1
1714 SET pg_hint_plan.parse_messages TO debug5;
1715 DEBUG:  StartTransactionCommand
1716 DEBUG:  StartTransaction
1717 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1718 DEBUG:  ProcessUtility
1719 DEBUG:  CommitTransactionCommand
1720 DEBUG:  CommitTransaction
1721 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1722 SHOW pg_hint_plan.parse_messages;
1723 DEBUG:  StartTransactionCommand
1724 DEBUG:  StartTransaction
1725 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1726 DEBUG:  ProcessUtility
1727 DEBUG:  CommitTransactionCommand
1728 DEBUG:  CommitTransaction
1729 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1730  pg_hint_plan.parse_messages 
1731 -----------------------------
1732  debug5
1733 (1 row)
1734
1735 /*+Set*/SELECT 1;
1736 DEBUG:  StartTransactionCommand
1737 DEBUG:  StartTransaction
1738 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1739 DEBUG:  hint syntax error at or near ""
1740 DETAIL:  Opening parenthesis is necessary.
1741 DEBUG:  CommitTransactionCommand
1742 DEBUG:  CommitTransaction
1743 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1744  ?column? 
1745 ----------
1746         1
1747 (1 row)
1748
1749 SET client_min_messages TO debug4;
1750 DEBUG:  StartTransactionCommand
1751 DEBUG:  StartTransaction
1752 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1753 DEBUG:  ProcessUtility
1754 DEBUG:  CommitTransactionCommand
1755 DEBUG:  CommitTransaction
1756 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1757 /*+Set*/SELECT 1;
1758 DEBUG:  StartTransactionCommand
1759 DEBUG:  StartTransaction
1760 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1761 DEBUG:  CommitTransactionCommand
1762 DEBUG:  CommitTransaction
1763 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1764  ?column? 
1765 ----------
1766         1
1767 (1 row)
1768
1769 -- No. A-6-4-2
1770 SET pg_hint_plan.parse_messages TO debug4;
1771 DEBUG:  StartTransactionCommand
1772 DEBUG:  StartTransaction
1773 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1774 DEBUG:  ProcessUtility
1775 DEBUG:  CommitTransactionCommand
1776 DEBUG:  CommitTransaction
1777 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1778 SHOW pg_hint_plan.parse_messages;
1779 DEBUG:  StartTransactionCommand
1780 DEBUG:  StartTransaction
1781 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1782 DEBUG:  ProcessUtility
1783 DEBUG:  CommitTransactionCommand
1784 DEBUG:  CommitTransaction
1785 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1786  pg_hint_plan.parse_messages 
1787 -----------------------------
1788  debug4
1789 (1 row)
1790
1791 /*+Set*/SELECT 1;
1792 DEBUG:  StartTransactionCommand
1793 DEBUG:  StartTransaction
1794 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1795 DEBUG:  hint syntax error at or near ""
1796 DETAIL:  Opening parenthesis is necessary.
1797 DEBUG:  CommitTransactionCommand
1798 DEBUG:  CommitTransaction
1799 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1800  ?column? 
1801 ----------
1802         1
1803 (1 row)
1804
1805 SET client_min_messages TO debug3;
1806 DEBUG:  StartTransactionCommand
1807 DEBUG:  StartTransaction
1808 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1809 DEBUG:  ProcessUtility
1810 DEBUG:  CommitTransactionCommand
1811 DEBUG:  CommitTransaction
1812 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1813 /*+Set*/SELECT 1;
1814 DEBUG:  StartTransactionCommand
1815 DEBUG:  StartTransaction
1816 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1817 DEBUG:  CommitTransactionCommand
1818 DEBUG:  CommitTransaction
1819 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1820  ?column? 
1821 ----------
1822         1
1823 (1 row)
1824
1825 -- No. A-6-4-3
1826 SET pg_hint_plan.parse_messages TO debug3;
1827 DEBUG:  StartTransactionCommand
1828 DEBUG:  StartTransaction
1829 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1830 DEBUG:  ProcessUtility
1831 DEBUG:  CommitTransactionCommand
1832 DEBUG:  CommitTransaction
1833 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1834 SHOW pg_hint_plan.parse_messages;
1835 DEBUG:  StartTransactionCommand
1836 DEBUG:  StartTransaction
1837 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1838 DEBUG:  ProcessUtility
1839 DEBUG:  CommitTransactionCommand
1840 DEBUG:  CommitTransaction
1841 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1842  pg_hint_plan.parse_messages 
1843 -----------------------------
1844  debug3
1845 (1 row)
1846
1847 /*+Set*/SELECT 1;
1848 DEBUG:  StartTransactionCommand
1849 DEBUG:  StartTransaction
1850 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1851 DEBUG:  hint syntax error at or near ""
1852 DETAIL:  Opening parenthesis is necessary.
1853 DEBUG:  CommitTransactionCommand
1854 DEBUG:  CommitTransaction
1855 DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1856  ?column? 
1857 ----------
1858         1
1859 (1 row)
1860
1861 SET client_min_messages TO debug2;
1862 DEBUG:  StartTransactionCommand
1863 DEBUG:  StartTransaction
1864 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
1865 DEBUG:  ProcessUtility
1866 /*+Set*/SELECT 1;
1867  ?column? 
1868 ----------
1869         1
1870 (1 row)
1871
1872 -- No. A-6-4-4
1873 SET pg_hint_plan.parse_messages TO debug2;
1874 SHOW pg_hint_plan.parse_messages;
1875  pg_hint_plan.parse_messages 
1876 -----------------------------
1877  debug
1878 (1 row)
1879
1880 /*+Set*/SELECT 1;
1881 DEBUG:  hint syntax error at or near ""
1882 DETAIL:  Opening parenthesis is necessary.
1883  ?column? 
1884 ----------
1885         1
1886 (1 row)
1887
1888 SET client_min_messages TO debug1;
1889 /*+Set*/SELECT 1;
1890  ?column? 
1891 ----------
1892         1
1893 (1 row)
1894
1895 -- No. A-6-4-5
1896 SET pg_hint_plan.parse_messages TO debug1;
1897 SHOW pg_hint_plan.parse_messages;
1898  pg_hint_plan.parse_messages 
1899 -----------------------------
1900  debug1
1901 (1 row)
1902
1903 /*+Set*/SELECT 1;
1904 DEBUG:  hint syntax error at or near ""
1905 DETAIL:  Opening parenthesis is necessary.
1906  ?column? 
1907 ----------
1908         1
1909 (1 row)
1910
1911 SET client_min_messages TO log;
1912 /*+Set*/SELECT 1;
1913  ?column? 
1914 ----------
1915         1
1916 (1 row)
1917
1918 -- No. A-6-4-6
1919 SET pg_hint_plan.parse_messages TO log;
1920 SHOW pg_hint_plan.parse_messages;
1921  pg_hint_plan.parse_messages 
1922 -----------------------------
1923  log
1924 (1 row)
1925
1926 /*+Set*/SELECT 1;
1927 LOG:  hint syntax error at or near ""
1928 DETAIL:  Opening parenthesis is necessary.
1929  ?column? 
1930 ----------
1931         1
1932 (1 row)
1933
1934 SET client_min_messages TO info;
1935 /*+Set*/SELECT 1;
1936  ?column? 
1937 ----------
1938         1
1939 (1 row)
1940
1941 -- No. A-6-4-7
1942 SET pg_hint_plan.parse_messages TO info;
1943 SHOW pg_hint_plan.parse_messages;
1944  pg_hint_plan.parse_messages 
1945 -----------------------------
1946  info
1947 (1 row)
1948
1949 /*+Set*/SELECT 1;
1950 INFO:  hint syntax error at or near ""
1951 DETAIL:  Opening parenthesis is necessary.
1952  ?column? 
1953 ----------
1954         1
1955 (1 row)
1956
1957 SET client_min_messages TO notice;
1958 /*+Set*/SELECT 1;
1959 INFO:  hint syntax error at or near ""
1960 DETAIL:  Opening parenthesis is necessary.
1961  ?column? 
1962 ----------
1963         1
1964 (1 row)
1965
1966 -- No. A-6-4-8
1967 SET pg_hint_plan.parse_messages TO notice;
1968 SHOW pg_hint_plan.parse_messages;
1969  pg_hint_plan.parse_messages 
1970 -----------------------------
1971  notice
1972 (1 row)
1973
1974 /*+Set*/SELECT 1;
1975 NOTICE:  hint syntax error at or near ""
1976 DETAIL:  Opening parenthesis is necessary.
1977  ?column? 
1978 ----------
1979         1
1980 (1 row)
1981
1982 SET client_min_messages TO warning;
1983 /*+Set*/SELECT 1;
1984  ?column? 
1985 ----------
1986         1
1987 (1 row)
1988
1989 -- No. A-6-4-9
1990 SET pg_hint_plan.parse_messages TO warning;
1991 SHOW pg_hint_plan.parse_messages;
1992  pg_hint_plan.parse_messages 
1993 -----------------------------
1994  warning
1995 (1 row)
1996
1997 /*+Set*/SELECT 1;
1998 WARNING:  hint syntax error at or near ""
1999 DETAIL:  Opening parenthesis is necessary.
2000  ?column? 
2001 ----------
2002         1
2003 (1 row)
2004
2005 SET client_min_messages TO error;
2006 /*+Set*/SELECT 1;
2007  ?column? 
2008 ----------
2009         1
2010 (1 row)
2011
2012 -- No. A-6-4-10
2013 SET pg_hint_plan.parse_messages TO error;
2014 SHOW pg_hint_plan.parse_messages;
2015  pg_hint_plan.parse_messages 
2016 -----------------------------
2017  error
2018 (1 row)
2019
2020 /*+Set*/SELECT 1;
2021 ERROR:  hint syntax error at or near ""
2022 DETAIL:  Opening parenthesis is necessary.
2023 SET client_min_messages TO fatal;
2024 /*+Set*/SELECT 1;
2025 -- No. A-6-4-11
2026 RESET client_min_messages;
2027 SET pg_hint_plan.parse_messages TO DEFAULT;
2028 SHOW pg_hint_plan.parse_messages;
2029  pg_hint_plan.parse_messages 
2030 -----------------------------
2031  info
2032 (1 row)
2033
2034 /*+Set*/SELECT 1;
2035 INFO:  hint syntax error at or near ""
2036 DETAIL:  Opening parenthesis is necessary.
2037  ?column? 
2038 ----------
2039         1
2040 (1 row)
2041
2042 -- No. A-6-4-12
2043 SET pg_hint_plan.parse_messages TO fatal;
2044 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2045 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2046 SHOW pg_hint_plan.parse_messages;
2047  pg_hint_plan.parse_messages 
2048 -----------------------------
2049  info
2050 (1 row)
2051
2052 -- No. A-6-4-13
2053 SET pg_hint_plan.parse_messages TO panic;
2054 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2055 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2056 SHOW pg_hint_plan.parse_messages;
2057  pg_hint_plan.parse_messages 
2058 -----------------------------
2059  info
2060 (1 row)
2061
2062 -- No. A-6-4-14
2063 SET pg_hint_plan.parse_messages TO on;
2064 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "on"
2065 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2066 SHOW pg_hint_plan.parse_messages;
2067  pg_hint_plan.parse_messages 
2068 -----------------------------
2069  info
2070 (1 row)
2071
2072 ----
2073 ---- No. A-7-1 parse error message output
2074 ----
2075 -- No. A-7-1-1
2076 /*+"Set"(enable_indexscan on)*/SELECT 1;
2077 INFO:  hint syntax error at or near ""Set"(enable_indexscan on)"
2078 DETAIL:  Unrecognized hint keyword ""Set"".
2079  ?column? 
2080 ----------
2081         1
2082 (1 row)
2083
2084 /*+Set()(enable_indexscan on)*/SELECT 1;
2085 INFO:  hint syntax error at or near ")(enable_indexscan on)"
2086 DETAIL:  Parameter name is necessary.
2087  ?column? 
2088 ----------
2089         1
2090 (1 row)
2091
2092 /*+Set(enable_indexscan on*/SELECT 1;
2093 INFO:  hint syntax error at or near ""
2094 DETAIL:  Closing parenthesis is necessary.
2095  ?column? 
2096 ----------
2097         1
2098 (1 row)
2099
2100 ----
2101 ---- No. A-7-3 hint state output
2102 ----
2103 SET pg_hint_plan.debug_print TO on;
2104 SET client_min_messages TO LOG;
2105 -- No. A-7-3-1
2106 /*+SeqScan(t1)*/
2107 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2108 LOG:  pg_hint_plan:
2109 used hint:
2110 SeqScan(t1)
2111 not used hint:
2112 duplication hint:
2113 error hint:
2114
2115      QUERY PLAN     
2116 --------------------
2117  Seq Scan on t1
2118    Filter: (c1 = 1)
2119 (2 rows)
2120
2121 -- No. A-7-3-2
2122 /*+SeqScan(no_table)*/
2123 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2124 LOG:  pg_hint_plan:
2125 used hint:
2126 not used hint:
2127 SeqScan(no_table)
2128 duplication hint:
2129 error hint:
2130
2131           QUERY PLAN          
2132 ------------------------------
2133  Index Scan using t1_i1 on t1
2134    Index Cond: (c1 = 1)
2135 (2 rows)
2136
2137 -- No. A-7-3-3
2138 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2139             QUERY PLAN             
2140 -----------------------------------
2141  Tid Scan on t1
2142    TID Cond: (ctid = '(1,1)'::tid)
2143    Filter: (c1 = 1)
2144 (3 rows)
2145
2146 /*+TidScan(t1)BitmapScan(t1)*/
2147 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2148 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2149 DETAIL:  Conflict scan method hint.
2150 LOG:  pg_hint_plan:
2151 used hint:
2152 BitmapScan(t1)
2153 not used hint:
2154 duplication hint:
2155 TidScan(t1)
2156 error hint:
2157
2158             QUERY PLAN            
2159 ----------------------------------
2160  Bitmap Heap Scan on t1
2161    Recheck Cond: (c1 = 1)
2162    Filter: (ctid = '(1,1)'::tid)
2163    ->  Bitmap Index Scan on t1_i1
2164          Index Cond: (c1 = 1)
2165 (5 rows)
2166
2167 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2168 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2169 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2170 DETAIL:  Conflict scan method hint.
2171 INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2172 DETAIL:  Conflict scan method hint.
2173 LOG:  pg_hint_plan:
2174 used hint:
2175 IndexScan(t1)
2176 not used hint:
2177 duplication hint:
2178 TidScan(t1)
2179 BitmapScan(t1)
2180 error hint:
2181
2182            QUERY PLAN            
2183 ---------------------------------
2184  Index Scan using t1_i1 on t1
2185    Index Cond: (c1 = 1)
2186    Filter: (ctid = '(1,1)'::tid)
2187 (3 rows)
2188
2189 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2190 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2191 INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2192 DETAIL:  Conflict scan method hint.
2193 INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2194 DETAIL:  Conflict scan method hint.
2195 INFO:  hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2196 DETAIL:  Conflict scan method hint.
2197 LOG:  pg_hint_plan:
2198 used hint:
2199 SeqScan(t1)
2200 not used hint:
2201 duplication hint:
2202 TidScan(t1)
2203 BitmapScan(t1)
2204 IndexScan(t1)
2205 error hint:
2206
2207                    QUERY PLAN                   
2208 ------------------------------------------------
2209  Seq Scan on t1
2210    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2211 (2 rows)
2212
2213 -- No. A-7-3-4
2214 /*+Set(enable_indexscan enable)*/
2215 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2216 INFO:  parameter "enable_indexscan" requires a Boolean value
2217 LOG:  pg_hint_plan:
2218 used hint:
2219 not used hint:
2220 duplication hint:
2221 error hint:
2222 Set(enable_indexscan enable)
2223
2224           QUERY PLAN          
2225 ------------------------------
2226  Index Scan using t1_i1 on t1
2227    Index Cond: (c1 = 1)
2228 (2 rows)
2229
2230 ----
2231 ---- No. A-8-1 hint state output
2232 ----
2233 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2234 EXPLAIN (COSTS false) EXECUTE p1;
2235           QUERY PLAN          
2236 ------------------------------
2237  Index Scan using t1_i1 on t1
2238    Index Cond: (c1 = 1)
2239 (2 rows)
2240
2241 DEALLOCATE p1;
2242 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2243 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2244      QUERY PLAN      
2245 ---------------------
2246  Seq Scan on t1
2247    Filter: (c1 < $1)
2248 (2 rows)
2249
2250 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2251      QUERY PLAN      
2252 ---------------------
2253  Seq Scan on t1
2254    Filter: (c1 < $1)
2255 (2 rows)
2256
2257 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2258      QUERY PLAN      
2259 ---------------------
2260  Seq Scan on t1
2261    Filter: (c1 < $1)
2262 (2 rows)
2263
2264 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2265      QUERY PLAN      
2266 ---------------------
2267  Seq Scan on t1
2268    Filter: (c1 < $1)
2269 (2 rows)
2270
2271 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2272      QUERY PLAN      
2273 ---------------------
2274  Seq Scan on t1
2275    Filter: (c1 < $1)
2276 (2 rows)
2277
2278 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2279      QUERY PLAN      
2280 ---------------------
2281  Seq Scan on t1
2282    Filter: (c1 < $1)
2283 (2 rows)
2284
2285 DEALLOCATE p1;
2286 -- No. A-8-1-1
2287 -- No. A-8-1-2
2288 /*+SeqScan(t1)*/
2289 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2290 LOG:  pg_hint_plan:
2291 used hint:
2292 SeqScan(t1)
2293 not used hint:
2294 duplication hint:
2295 error hint:
2296
2297 /*+BitmapScan(t1)*/
2298 EXPLAIN (COSTS false) EXECUTE p1;
2299      QUERY PLAN     
2300 --------------------
2301  Seq Scan on t1
2302    Filter: (c1 = 1)
2303 (2 rows)
2304
2305 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2306 /*+BitmapScan(t1)*/
2307 EXPLAIN (COSTS false) EXECUTE p1;
2308 LOG:  pg_hint_plan:
2309 used hint:
2310 SeqScan(t1)
2311 not used hint:
2312 duplication hint:
2313 error hint:
2314
2315      QUERY PLAN     
2316 --------------------
2317  Seq Scan on t1
2318    Filter: (c1 = 1)
2319 (2 rows)
2320
2321 DEALLOCATE p1;
2322 /*+BitmapScan(t1)*/
2323 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2324 LOG:  pg_hint_plan:
2325 used hint:
2326 BitmapScan(t1)
2327 not used hint:
2328 duplication hint:
2329 error hint:
2330
2331 /*+SeqScan(t1)*/
2332 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2333             QUERY PLAN            
2334 ----------------------------------
2335  Bitmap Heap Scan on t1
2336    Recheck Cond: (c1 < $1)
2337    ->  Bitmap Index Scan on t1_i1
2338          Index Cond: (c1 < $1)
2339 (4 rows)
2340
2341 /*+SeqScan(t1)*/
2342 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2343             QUERY PLAN            
2344 ----------------------------------
2345  Bitmap Heap Scan on t1
2346    Recheck Cond: (c1 < $1)
2347    ->  Bitmap Index Scan on t1_i1
2348          Index Cond: (c1 < $1)
2349 (4 rows)
2350
2351 /*+SeqScan(t1)*/
2352 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2353             QUERY PLAN            
2354 ----------------------------------
2355  Bitmap Heap Scan on t1
2356    Recheck Cond: (c1 < $1)
2357    ->  Bitmap Index Scan on t1_i1
2358          Index Cond: (c1 < $1)
2359 (4 rows)
2360
2361 /*+SeqScan(t1)*/
2362 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2363             QUERY PLAN            
2364 ----------------------------------
2365  Bitmap Heap Scan on t1
2366    Recheck Cond: (c1 < $1)
2367    ->  Bitmap Index Scan on t1_i1
2368          Index Cond: (c1 < $1)
2369 (4 rows)
2370
2371 /*+SeqScan(t1)*/
2372 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2373             QUERY PLAN            
2374 ----------------------------------
2375  Bitmap Heap Scan on t1
2376    Recheck Cond: (c1 < $1)
2377    ->  Bitmap Index Scan on t1_i1
2378          Index Cond: (c1 < $1)
2379 (4 rows)
2380
2381 /*+SeqScan(t1)*/
2382 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2383             QUERY PLAN            
2384 ----------------------------------
2385  Bitmap Heap Scan on t1
2386    Recheck Cond: (c1 < $1)
2387    ->  Bitmap Index Scan on t1_i1
2388          Index Cond: (c1 < $1)
2389 (4 rows)
2390
2391 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2392 /*+SeqScan(t1)*/
2393 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2394 LOG:  pg_hint_plan:
2395 used hint:
2396 BitmapScan(t1)
2397 not used hint:
2398 duplication hint:
2399 error hint:
2400
2401             QUERY PLAN            
2402 ----------------------------------
2403  Bitmap Heap Scan on t1
2404    Recheck Cond: (c1 < $1)
2405    ->  Bitmap Index Scan on t1_i1
2406          Index Cond: (c1 < $1)
2407 (4 rows)
2408
2409 DEALLOCATE p1;
2410 -- No. A-8-1-3
2411 -- No. A-8-1-4
2412 /*+SeqScan(t1)*/
2413 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2414 LOG:  pg_hint_plan:
2415 used hint:
2416 SeqScan(t1)
2417 not used hint:
2418 duplication hint:
2419 error hint:
2420
2421 EXPLAIN (COSTS false) EXECUTE p1;
2422      QUERY PLAN     
2423 --------------------
2424  Seq Scan on t1
2425    Filter: (c1 = 1)
2426 (2 rows)
2427
2428 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2429 EXPLAIN (COSTS false) EXECUTE p1;
2430 LOG:  pg_hint_plan:
2431 used hint:
2432 SeqScan(t1)
2433 not used hint:
2434 duplication hint:
2435 error hint:
2436
2437      QUERY PLAN     
2438 --------------------
2439  Seq Scan on t1
2440    Filter: (c1 = 1)
2441 (2 rows)
2442
2443 DEALLOCATE p1;
2444 /*+BitmapScan(t1)*/
2445 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2446 LOG:  pg_hint_plan:
2447 used hint:
2448 BitmapScan(t1)
2449 not used hint:
2450 duplication hint:
2451 error hint:
2452
2453 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2454             QUERY PLAN            
2455 ----------------------------------
2456  Bitmap Heap Scan on t1
2457    Recheck Cond: (c1 < $1)
2458    ->  Bitmap Index Scan on t1_i1
2459          Index Cond: (c1 < $1)
2460 (4 rows)
2461
2462 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2463             QUERY PLAN            
2464 ----------------------------------
2465  Bitmap Heap Scan on t1
2466    Recheck Cond: (c1 < $1)
2467    ->  Bitmap Index Scan on t1_i1
2468          Index Cond: (c1 < $1)
2469 (4 rows)
2470
2471 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2472             QUERY PLAN            
2473 ----------------------------------
2474  Bitmap Heap Scan on t1
2475    Recheck Cond: (c1 < $1)
2476    ->  Bitmap Index Scan on t1_i1
2477          Index Cond: (c1 < $1)
2478 (4 rows)
2479
2480 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2481             QUERY PLAN            
2482 ----------------------------------
2483  Bitmap Heap Scan on t1
2484    Recheck Cond: (c1 < $1)
2485    ->  Bitmap Index Scan on t1_i1
2486          Index Cond: (c1 < $1)
2487 (4 rows)
2488
2489 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2490             QUERY PLAN            
2491 ----------------------------------
2492  Bitmap Heap Scan on t1
2493    Recheck Cond: (c1 < $1)
2494    ->  Bitmap Index Scan on t1_i1
2495          Index Cond: (c1 < $1)
2496 (4 rows)
2497
2498 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2499             QUERY PLAN            
2500 ----------------------------------
2501  Bitmap Heap Scan on t1
2502    Recheck Cond: (c1 < $1)
2503    ->  Bitmap Index Scan on t1_i1
2504          Index Cond: (c1 < $1)
2505 (4 rows)
2506
2507 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2508 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2509 LOG:  pg_hint_plan:
2510 used hint:
2511 BitmapScan(t1)
2512 not used hint:
2513 duplication hint:
2514 error hint:
2515
2516             QUERY PLAN            
2517 ----------------------------------
2518  Bitmap Heap Scan on t1
2519    Recheck Cond: (c1 < $1)
2520    ->  Bitmap Index Scan on t1_i1
2521          Index Cond: (c1 < $1)
2522 (4 rows)
2523
2524 DEALLOCATE p1;
2525 -- No. A-8-1-5
2526 -- No. A-8-1-6
2527 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2528 /*+BitmapScan(t1)*/
2529 EXPLAIN (COSTS false) EXECUTE p1;
2530           QUERY PLAN          
2531 ------------------------------
2532  Index Scan using t1_i1 on t1
2533    Index Cond: (c1 = 1)
2534 (2 rows)
2535
2536 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2537 /*+BitmapScan(t1)*/
2538 EXPLAIN (COSTS false) EXECUTE p1;
2539           QUERY PLAN          
2540 ------------------------------
2541  Index Scan using t1_i1 on t1
2542    Index Cond: (c1 = 1)
2543 (2 rows)
2544
2545 DEALLOCATE p1;
2546 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2547 /*+BitmapScan(t1)*/
2548 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2549      QUERY PLAN      
2550 ---------------------
2551  Seq Scan on t1
2552    Filter: (c1 < $1)
2553 (2 rows)
2554
2555 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2556      QUERY PLAN      
2557 ---------------------
2558  Seq Scan on t1
2559    Filter: (c1 < $1)
2560 (2 rows)
2561
2562 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2563      QUERY PLAN      
2564 ---------------------
2565  Seq Scan on t1
2566    Filter: (c1 < $1)
2567 (2 rows)
2568
2569 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2570      QUERY PLAN      
2571 ---------------------
2572  Seq Scan on t1
2573    Filter: (c1 < $1)
2574 (2 rows)
2575
2576 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2577      QUERY PLAN      
2578 ---------------------
2579  Seq Scan on t1
2580    Filter: (c1 < $1)
2581 (2 rows)
2582
2583 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2584      QUERY PLAN      
2585 ---------------------
2586  Seq Scan on t1
2587    Filter: (c1 < $1)
2588 (2 rows)
2589
2590 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2591 /*+BitmapScan(t1)*/
2592 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2593      QUERY PLAN      
2594 ---------------------
2595  Seq Scan on t1
2596    Filter: (c1 < $1)
2597 (2 rows)
2598
2599 DEALLOCATE p1;
2600 ----
2601 ---- No. A-8-4 EXECUTE statement name error
2602 ----
2603 -- No. A-8-4-1
2604 EXECUTE p1;
2605 ERROR:  prepared statement "p1" does not exist
2606 SHOW pg_hint_plan.debug_print;
2607  pg_hint_plan.debug_print 
2608 --------------------------
2609  on
2610 (1 row)
2611
2612 ----
2613 ---- No. A-9-5 EXECUTE statement name error
2614 ----
2615 -- No. A-9-5-1
2616 SELECT pg_stat_statements_reset();
2617  pg_stat_statements_reset 
2618 --------------------------
2619  
2620 (1 row)
2621
2622 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2623  c1 | c2 | c3 | c4 
2624 ----+----+----+----
2625   1 |  1 |  1 | 1
2626 (1 row)
2627
2628 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2629 LOG:  pg_hint_plan:
2630 used hint:
2631 Set(enable_seqscan off)
2632 not used hint:
2633 duplication hint:
2634 error hint:
2635
2636  c1 | c2 | c3 | c4 
2637 ----+----+----+----
2638   1 |  1 |  1 | 1
2639 (1 row)
2640
2641 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2642 LOG:  pg_hint_plan:
2643 used hint:
2644 SeqScan(t1)
2645 not used hint:
2646 duplication hint:
2647 error hint:
2648
2649  c1 | c2 | c3 | c4 
2650 ----+----+----+----
2651   1 |  1 |  1 | 1
2652 (1 row)
2653
2654 SELECT s.query, s.calls
2655   FROM public.pg_stat_statements s
2656   JOIN pg_catalog.pg_database d
2657     ON (s.dbid = d.oid)
2658  ORDER BY 1;
2659                                query                               | calls 
2660 -------------------------------------------------------------------+-------
2661  /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;             |     1
2662  /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; |     1
2663  SELECT * FROM s1.t1 WHERE t1.c1 = 1;                              |     1
2664  SELECT pg_stat_statements_reset();                                |     1
2665 (4 rows)
2666
2667 ----
2668 ---- No. A-10-1 duplicate hint
2669 ----
2670 -- No. A-10-1-1
2671 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2672                      QUERY PLAN                      
2673 -----------------------------------------------------
2674  Nested Loop
2675    Join Filter: (t1.c1 = t4.c1)
2676    ->  Nested Loop
2677          Join Filter: (t1.c1 = t3.c1)
2678          ->  Nested Loop
2679                Join Filter: (t1.c1 = t2.c1)
2680                ->  Tid Scan on t1
2681                      TID Cond: (ctid = '(1,1)'::tid)
2682                ->  Seq Scan on t2
2683                      Filter: (ctid = '(1,1)'::tid)
2684          ->  Tid Scan on t3
2685                TID Cond: (ctid = '(1,1)'::tid)
2686    ->  Tid Scan on t4
2687          TID Cond: (ctid = '(1,1)'::tid)
2688 (14 rows)
2689
2690 /*+
2691 Set(enable_tidscan aaa)
2692 Set(enable_tidscan on)
2693 Set(enable_tidscan off)
2694 SeqScan(t4)
2695 IndexScan(t4)
2696 BitmapScan(t4)
2697 TidScan(t4)
2698 NestLoop(t4 t3)
2699 MergeJoin(t4 t3)
2700 HashJoin(t4 t3)
2701 Leading(t2 t1 t4 t3)
2702 Leading(t1 t4 t3 t2)
2703 Leading(t4 t3 t2 t1)
2704 */
2705 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2706 INFO:  hint syntax error at or near "SeqScan(t4)
2707 IndexScan(t4)
2708 BitmapScan(t4)
2709 TidScan(t4)
2710 NestLoop(t4 t3)
2711 MergeJoin(t4 t3)
2712 HashJoin(t4 t3)
2713 Leading(t2 t1 t4 t3)
2714 Leading(t1 t4 t3 t2)
2715 Leading(t4 t3 t2 t1)
2716 "
2717 DETAIL:  Conflict scan method hint.
2718 INFO:  hint syntax error at or near "IndexScan(t4)
2719 BitmapScan(t4)
2720 TidScan(t4)
2721 NestLoop(t4 t3)
2722 MergeJoin(t4 t3)
2723 HashJoin(t4 t3)
2724 Leading(t2 t1 t4 t3)
2725 Leading(t1 t4 t3 t2)
2726 Leading(t4 t3 t2 t1)
2727 "
2728 DETAIL:  Conflict scan method hint.
2729 INFO:  hint syntax error at or near "BitmapScan(t4)
2730 TidScan(t4)
2731 NestLoop(t4 t3)
2732 MergeJoin(t4 t3)
2733 HashJoin(t4 t3)
2734 Leading(t2 t1 t4 t3)
2735 Leading(t1 t4 t3 t2)
2736 Leading(t4 t3 t2 t1)
2737 "
2738 DETAIL:  Conflict scan method hint.
2739 INFO:  hint syntax error at or near "NestLoop(t4 t3)
2740 MergeJoin(t4 t3)
2741 HashJoin(t4 t3)
2742 Leading(t2 t1 t4 t3)
2743 Leading(t1 t4 t3 t2)
2744 Leading(t4 t3 t2 t1)
2745 "
2746 DETAIL:  Conflict join method hint.
2747 INFO:  hint syntax error at or near "MergeJoin(t4 t3)
2748 HashJoin(t4 t3)
2749 Leading(t2 t1 t4 t3)
2750 Leading(t1 t4 t3 t2)
2751 Leading(t4 t3 t2 t1)
2752 "
2753 DETAIL:  Conflict join method hint.
2754 INFO:  hint syntax error at or near "Leading(t2 t1 t4 t3)
2755 Leading(t1 t4 t3 t2)
2756 Leading(t4 t3 t2 t1)
2757 "
2758 DETAIL:  Conflict leading hint.
2759 INFO:  hint syntax error at or near "Leading(t1 t4 t3 t2)
2760 Leading(t4 t3 t2 t1)
2761 "
2762 DETAIL:  Conflict leading hint.
2763 INFO:  hint syntax error at or near "Set(enable_tidscan aaa)
2764 Set(enable_tidscan on)
2765 Set(enable_tidscan off)
2766 SeqScan(t4)
2767 IndexScan(t4)
2768 BitmapScan(t4)
2769 TidScan(t4)
2770 NestLoop(t4 t3)
2771 MergeJoin(t4 t3)
2772 HashJoin(t4 t3)
2773 Leading(t2 t1 t4 t3)
2774 Leading(t1 t4 t3 t2)
2775 Leading(t4 t3 t2 t1)
2776 "
2777 DETAIL:  Conflict set hint.
2778 INFO:  hint syntax error at or near "Set(enable_tidscan on)
2779 Set(enable_tidscan off)
2780 SeqScan(t4)
2781 IndexScan(t4)
2782 BitmapScan(t4)
2783 TidScan(t4)
2784 NestLoop(t4 t3)
2785 MergeJoin(t4 t3)
2786 HashJoin(t4 t3)
2787 Leading(t2 t1 t4 t3)
2788 Leading(t1 t4 t3 t2)
2789 Leading(t4 t3 t2 t1)
2790 "
2791 DETAIL:  Conflict set hint.
2792 LOG:  pg_hint_plan:
2793 used hint:
2794 TidScan(t4)
2795 HashJoin(t3 t4)
2796 Leading(t4 t3 t2 t1)
2797 Set(enable_tidscan off)
2798 not used hint:
2799 duplication hint:
2800 SeqScan(t4)
2801 IndexScan(t4)
2802 BitmapScan(t4)
2803 NestLoop(t3 t4)
2804 MergeJoin(t3 t4)
2805 Leading(t2 t1 t4 t3)
2806 Leading(t1 t4 t3 t2)
2807 Set(enable_tidscan aaa)
2808 Set(enable_tidscan on)
2809 error hint:
2810
2811                         QUERY PLAN                         
2812 -----------------------------------------------------------
2813  Nested Loop
2814    ->  Nested Loop
2815          Join Filter: (t3.c1 = t2.c1)
2816          ->  Hash Join
2817                Hash Cond: (t3.c1 = t4.c1)
2818                ->  Seq Scan on t3
2819                      Filter: (ctid = '(1,1)'::tid)
2820                ->  Hash
2821                      ->  Tid Scan on t4
2822                            TID Cond: (ctid = '(1,1)'::tid)
2823          ->  Seq Scan on t2
2824                Filter: (ctid = '(1,1)'::tid)
2825    ->  Index Scan using t1_i1 on t1
2826          Index Cond: (c1 = t2.c1)
2827          Filter: (ctid = '(1,1)'::tid)
2828 (15 rows)
2829
2830 -- No. A-10-1-2
2831 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2832                      QUERY PLAN                      
2833 -----------------------------------------------------
2834  Nested Loop
2835    Join Filter: (t1.c1 = t4.c1)
2836    ->  Nested Loop
2837          Join Filter: (t1.c1 = t3.c1)
2838          ->  Nested Loop
2839                Join Filter: (t1.c1 = t2.c1)
2840                ->  Tid Scan on t1
2841                      TID Cond: (ctid = '(1,1)'::tid)
2842                ->  Seq Scan on t2
2843                      Filter: (ctid = '(1,1)'::tid)
2844          ->  Tid Scan on t3
2845                TID Cond: (ctid = '(1,1)'::tid)
2846    ->  Tid Scan on t4
2847          TID Cond: (ctid = '(1,1)'::tid)
2848 (14 rows)
2849
2850 /*+
2851 SeqScan(t4)
2852 Set(enable_tidscan aaa)
2853 IndexScan(t4)
2854 NestLoop(t4 t3)
2855 Leading(t2 t1 t4 t3)
2856 Set(enable_tidscan on)
2857 BitmapScan(t4)
2858 MergeJoin(t4 t3)
2859 Leading(t1 t4 t3 t2)
2860 Set(enable_tidscan off)
2861 TidScan(t4)
2862 HashJoin(t4 t3)
2863 Leading(t4 t3 t2 t1)
2864 */
2865 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
2866 INFO:  hint syntax error at or near "SeqScan(t4)
2867 Set(enable_tidscan aaa)
2868 IndexScan(t4)
2869 NestLoop(t4 t3)
2870 Leading(t2 t1 t4 t3)
2871 Set(enable_tidscan on)
2872 BitmapScan(t4)
2873 MergeJoin(t4 t3)
2874 Leading(t1 t4 t3 t2)
2875 Set(enable_tidscan off)
2876 TidScan(t4)
2877 HashJoin(t4 t3)
2878 Leading(t4 t3 t2 t1)
2879 "
2880 DETAIL:  Conflict scan method hint.
2881 INFO:  hint syntax error at or near "IndexScan(t4)
2882 NestLoop(t4 t3)
2883 Leading(t2 t1 t4 t3)
2884 Set(enable_tidscan on)
2885 BitmapScan(t4)
2886 MergeJoin(t4 t3)
2887 Leading(t1 t4 t3 t2)
2888 Set(enable_tidscan off)
2889 TidScan(t4)
2890 HashJoin(t4 t3)
2891 Leading(t4 t3 t2 t1)
2892 "
2893 DETAIL:  Conflict scan method hint.
2894 INFO:  hint syntax error at or near "BitmapScan(t4)
2895 MergeJoin(t4 t3)
2896 Leading(t1 t4 t3 t2)
2897 Set(enable_tidscan off)
2898 TidScan(t4)
2899 HashJoin(t4 t3)
2900 Leading(t4 t3 t2 t1)
2901 "
2902 DETAIL:  Conflict scan method hint.
2903 INFO:  hint syntax error at or near "NestLoop(t4 t3)
2904 Leading(t2 t1 t4 t3)
2905 Set(enable_tidscan on)
2906 BitmapScan(t4)
2907 MergeJoin(t4 t3)
2908 Leading(t1 t4 t3 t2)
2909 Set(enable_tidscan off)
2910 TidScan(t4)
2911 HashJoin(t4 t3)
2912 Leading(t4 t3 t2 t1)
2913 "
2914 DETAIL:  Conflict join method hint.
2915 INFO:  hint syntax error at or near "MergeJoin(t4 t3)
2916 Leading(t1 t4 t3 t2)
2917 Set(enable_tidscan off)
2918 TidScan(t4)
2919 HashJoin(t4 t3)
2920 Leading(t4 t3 t2 t1)
2921 "
2922 DETAIL:  Conflict join method hint.
2923 INFO:  hint syntax error at or near "Leading(t2 t1 t4 t3)
2924 Set(enable_tidscan on)
2925 BitmapScan(t4)
2926 MergeJoin(t4 t3)
2927 Leading(t1 t4 t3 t2)
2928 Set(enable_tidscan off)
2929 TidScan(t4)
2930 HashJoin(t4 t3)
2931 Leading(t4 t3 t2 t1)
2932 "
2933 DETAIL:  Conflict leading hint.
2934 INFO:  hint syntax error at or near "Leading(t1 t4 t3 t2)
2935 Set(enable_tidscan off)
2936 TidScan(t4)
2937 HashJoin(t4 t3)
2938 Leading(t4 t3 t2 t1)
2939 "
2940 DETAIL:  Conflict leading hint.
2941 INFO:  hint syntax error at or near "Set(enable_tidscan aaa)
2942 IndexScan(t4)
2943 NestLoop(t4 t3)
2944 Leading(t2 t1 t4 t3)
2945 Set(enable_tidscan on)
2946 BitmapScan(t4)
2947 MergeJoin(t4 t3)
2948 Leading(t1 t4 t3 t2)
2949 Set(enable_tidscan off)
2950 TidScan(t4)
2951 HashJoin(t4 t3)
2952 Leading(t4 t3 t2 t1)
2953 "
2954 DETAIL:  Conflict set hint.
2955 INFO:  hint syntax error at or near "Set(enable_tidscan on)
2956 BitmapScan(t4)
2957 MergeJoin(t4 t3)
2958 Leading(t1 t4 t3 t2)
2959 Set(enable_tidscan off)
2960 TidScan(t4)
2961 HashJoin(t4 t3)
2962 Leading(t4 t3 t2 t1)
2963 "
2964 DETAIL:  Conflict set hint.
2965 LOG:  pg_hint_plan:
2966 used hint:
2967 TidScan(t4)
2968 HashJoin(t3 t4)
2969 Leading(t4 t3 t2 t1)
2970 Set(enable_tidscan off)
2971 not used hint:
2972 duplication hint:
2973 SeqScan(t4)
2974 IndexScan(t4)
2975 BitmapScan(t4)
2976 NestLoop(t3 t4)
2977 MergeJoin(t3 t4)
2978 Leading(t2 t1 t4 t3)
2979 Leading(t1 t4 t3 t2)
2980 Set(enable_tidscan aaa)
2981 Set(enable_tidscan on)
2982 error hint:
2983
2984                         QUERY PLAN                         
2985 -----------------------------------------------------------
2986  Nested Loop
2987    ->  Nested Loop
2988          Join Filter: (t3.c1 = t2.c1)
2989          ->  Hash Join
2990                Hash Cond: (t3.c1 = t4.c1)
2991                ->  Seq Scan on t3
2992                      Filter: (ctid = '(1,1)'::tid)
2993                ->  Hash
2994                      ->  Tid Scan on t4
2995                            TID Cond: (ctid = '(1,1)'::tid)
2996          ->  Seq Scan on t2
2997                Filter: (ctid = '(1,1)'::tid)
2998    ->  Index Scan using t1_i1 on t1
2999          Index Cond: (c1 = t2.c1)
3000          Filter: (ctid = '(1,1)'::tid)
3001 (15 rows)
3002
3003 ----
3004 ---- No. A-10-2 restrict query type
3005 ----
3006 -- No. A-10-2-1
3007 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3008           QUERY PLAN          
3009 ------------------------------
3010  Hash Full Join
3011    Hash Cond: (t1.c1 = t2.c1)
3012    ->  Seq Scan on t1
3013    ->  Hash
3014          ->  Seq Scan on t2
3015 (5 rows)
3016
3017 /*+HashJoin(t1 t2)*/
3018 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3019 LOG:  pg_hint_plan:
3020 used hint:
3021 HashJoin(t1 t2)
3022 not used hint:
3023 duplication hint:
3024 error hint:
3025
3026           QUERY PLAN          
3027 ------------------------------
3028  Hash Full Join
3029    Hash Cond: (t1.c1 = t2.c1)
3030    ->  Seq Scan on t1
3031    ->  Hash
3032          ->  Seq Scan on t2
3033 (5 rows)
3034
3035 /*+MergeJoin(t1 t2)*/
3036 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3037 LOG:  pg_hint_plan:
3038 used hint:
3039 MergeJoin(t1 t2)
3040 not used hint:
3041 duplication hint:
3042 error hint:
3043
3044              QUERY PLAN             
3045 ------------------------------------
3046  Merge Full Join
3047    Merge Cond: (t1.c1 = t2.c1)
3048    ->  Index Scan using t1_i1 on t1
3049    ->  Sort
3050          Sort Key: t2.c1
3051          ->  Seq Scan on t2
3052 (6 rows)
3053
3054 /*+NestLoop(t1 t2)*/
3055 EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
3056 LOG:  pg_hint_plan:
3057 used hint:
3058 NestLoop(t1 t2)
3059 not used hint:
3060 duplication hint:
3061 error hint:
3062
3063                                 QUERY PLAN                                
3064 --------------------------------------------------------------------------
3065  Hash Full Join  (cost=10000000003.25..10000000024.00 rows=1000 width=29)
3066    Hash Cond: (t1.c1 = t2.c1)
3067    ->  Seq Scan on t1  (cost=0.00..16.00 rows=1000 width=15)
3068    ->  Hash  (cost=2.00..2.00 rows=100 width=14)
3069          ->  Seq Scan on t2  (cost=0.00..2.00 rows=100 width=14)
3070 (5 rows)
3071
3072 -- No. A-10-2-2
3073 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3074             QUERY PLAN             
3075 -----------------------------------
3076  Tid Scan on t1
3077    TID Cond: (ctid = '(1,1)'::tid)
3078    Filter: (c3 = 1)
3079 (3 rows)
3080
3081 /*+IndexScan(t1)*/
3082 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3083 LOG:  pg_hint_plan:
3084 used hint:
3085 IndexScan(t1)
3086 not used hint:
3087 duplication hint:
3088 error hint:
3089
3090            QUERY PLAN            
3091 ---------------------------------
3092  Index Scan using t1_i on t1
3093    Index Cond: (c3 = 1)
3094    Filter: (ctid = '(1,1)'::tid)
3095 (3 rows)
3096
3097 /*+IndexScan(t1 t1_i)*/
3098 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3099 LOG:  pg_hint_plan:
3100 used hint:
3101 IndexScan(t1 t1_i)
3102 not used hint:
3103 duplication hint:
3104 error hint:
3105
3106            QUERY PLAN            
3107 ---------------------------------
3108  Index Scan using t1_i on t1
3109    Index Cond: (c3 = 1)
3110    Filter: (ctid = '(1,1)'::tid)
3111 (3 rows)
3112
3113 /*+IndexScan(t1 t1_i1)*/
3114 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
3115 LOG:  pg_hint_plan:
3116 used hint:
3117 IndexScan(t1 t1_i1)
3118 not used hint:
3119 duplication hint:
3120 error hint:
3121
3122                               QUERY PLAN                               
3123 -----------------------------------------------------------------------
3124  Tid Scan on t1  (cost=10000000000.00..10000000004.02 rows=1 width=15)
3125    TID Cond: (ctid = '(1,1)'::tid)
3126    Filter: (c3 = 1)
3127 (3 rows)
3128
3129 -- No. A-10-2-3
3130 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3131           QUERY PLAN          
3132 ------------------------------
3133  Index Scan using t1_i1 on t1
3134    Index Cond: (c1 = 1)
3135 (2 rows)
3136
3137 /*+TidScan(t1)*/
3138 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3139 LOG:  pg_hint_plan:
3140 used hint:
3141 TidScan(t1)
3142 not used hint:
3143 duplication hint:
3144 error hint:
3145
3146                               QUERY PLAN                               
3147 -----------------------------------------------------------------------
3148  Seq Scan on t1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
3149    Filter: (c1 = 1)
3150 (2 rows)
3151
3152 /*+TidScan(t1)*/
3153 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
3154 LOG:  pg_hint_plan:
3155 used hint:
3156 TidScan(t1)
3157 not used hint:
3158 duplication hint:
3159 error hint:
3160
3161             QUERY PLAN             
3162 -----------------------------------
3163  Tid Scan on t1
3164    TID Cond: (ctid = '(1,1)'::tid)
3165    Filter: (c1 = 1)
3166 (3 rows)
3167
3168 ----
3169 ---- No. A-10-3 VIEW, RULE multi specified
3170 ----
3171 -- No. A-10-3-1
3172 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3173             QUERY PLAN            
3174 ----------------------------------
3175  Hash Join
3176    Hash Cond: (v1t1.c1 = v1t1.c1)
3177    ->  Seq Scan on t1 v1t1
3178    ->  Hash
3179          ->  Seq Scan on t1 v1t1
3180 (5 rows)
3181
3182 /*+Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)*/
3183 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3184 INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3185 DETAIL:  Relation name "v1t1" is ambiguous.
3186 INFO:  hint syntax error at or near "Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3187 DETAIL:  Relation name "v1t1" is ambiguous.
3188 LOG:  pg_hint_plan:
3189 used hint:
3190 BitmapScan(v1t1)
3191 not used hint:
3192 Leading(v1t1 v1t1)
3193 duplication hint:
3194 error hint:
3195 HashJoin(v1t1 v1t1)
3196
3197                 QUERY PLAN                
3198 ------------------------------------------
3199  Nested Loop
3200    ->  Index Scan using t1_i1 on t1 v1t1
3201    ->  Bitmap Heap Scan on t1 v1t1
3202          Recheck Cond: (c1 = v1t1.c1)
3203          ->  Bitmap Index Scan on t1_i1
3204                Index Cond: (c1 = v1t1.c1)
3205 (6 rows)
3206
3207 -- No. A-10-3-2
3208 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3209             QUERY PLAN             
3210 -----------------------------------
3211  Hash Join
3212    Hash Cond: (v1t1.c1 = v1t1_.c1)
3213    ->  Seq Scan on t1 v1t1
3214    ->  Hash
3215          ->  Seq Scan on t1 v1t1_
3216 (5 rows)
3217
3218 /*+Leading(v1t1 v1t1_)NestLoop(v1t1 v1t1_)SeqScan(v1t1)BitmapScan(v1t1_)*/
3219 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3220 LOG:  pg_hint_plan:
3221 used hint:
3222 SeqScan(v1t1)
3223 BitmapScan(v1t1_)
3224 NestLoop(v1t1 v1t1_)
3225 Leading(v1t1 v1t1_)
3226 not used hint:
3227 duplication hint:
3228 error hint:
3229
3230                 QUERY PLAN                
3231 ------------------------------------------
3232  Nested Loop
3233    ->  Seq Scan on t1 v1t1
3234    ->  Bitmap Heap Scan on t1 v1t1_
3235          Recheck Cond: (c1 = v1t1.c1)
3236          ->  Bitmap Index Scan on t1_i1
3237                Index Cond: (c1 = v1t1.c1)
3238 (6 rows)
3239
3240 -- No. A-10-3-3
3241 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3242             QUERY PLAN            
3243 ----------------------------------
3244  Hash Join
3245    Hash Cond: (r4t1.c1 = r4t1.c1)
3246    ->  Seq Scan on t1 r4t1
3247    ->  Hash
3248          ->  Seq Scan on t1 r4t1
3249 (5 rows)
3250
3251 /*+Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)*/
3252 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3253 INFO:  hint syntax error at or near "HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3254 DETAIL:  Relation name "r4t1" is ambiguous.
3255 INFO:  hint syntax error at or near "Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3256 DETAIL:  Relation name "r4t1" is ambiguous.
3257 LOG:  pg_hint_plan:
3258 used hint:
3259 BitmapScan(r4t1)
3260 not used hint:
3261 Leading(r4t1 r4t1)
3262 duplication hint:
3263 error hint:
3264 HashJoin(r4t1 r4t1)
3265
3266                 QUERY PLAN                
3267 ------------------------------------------
3268  Nested Loop
3269    ->  Index Scan using t1_i1 on t1 r4t1
3270    ->  Bitmap Heap Scan on t1 r4t1
3271          Recheck Cond: (c1 = r4t1.c1)
3272          ->  Bitmap Index Scan on t1_i1
3273                Index Cond: (c1 = r4t1.c1)
3274 (6 rows)
3275
3276 -- No. A-10-3-4
3277 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3278             QUERY PLAN            
3279 ----------------------------------
3280  Hash Join
3281    Hash Cond: (r4t1.c1 = r5t1.c1)
3282    ->  Seq Scan on t1 r4t1
3283    ->  Hash
3284          ->  Seq Scan on t1 r5t1
3285 (5 rows)
3286
3287 /*+Leading(r4t1 r5t1)NestLoop(r4t1 r5t1)SeqScan(r4t1)BitmapScan(r5t1)*/
3288 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3289 LOG:  pg_hint_plan:
3290 used hint:
3291 SeqScan(r4t1)
3292 BitmapScan(r5t1)
3293 NestLoop(r4t1 r5t1)
3294 Leading(r4t1 r5t1)
3295 not used hint:
3296 duplication hint:
3297 error hint:
3298
3299                 QUERY PLAN                
3300 ------------------------------------------
3301  Nested Loop
3302    ->  Seq Scan on t1 r4t1
3303    ->  Bitmap Heap Scan on t1 r5t1
3304          Recheck Cond: (c1 = r4t1.c1)
3305          ->  Bitmap Index Scan on t1_i1
3306                Index Cond: (c1 = r4t1.c1)
3307 (6 rows)
3308
3309 ----
3310 ---- No. A-11-1 psql command
3311 ----
3312 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3313  count 
3314 -------
3315      1
3316 (1 row)
3317
3318 /*+SeqScan(t1)*/
3319 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3320 LOG:  pg_hint_plan:
3321 used hint:
3322 SeqScan(t1)
3323 not used hint:
3324 duplication hint:
3325 error hint:
3326
3327  count 
3328 -------
3329      1
3330 (1 row)
3331
3332 -- No. A-11-1-4
3333 \set FETCH_COUNT 0
3334 /*+SeqScan(t1)*/
3335 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3336 LOG:  pg_hint_plan:
3337 used hint:
3338 SeqScan(t1)
3339 not used hint:
3340 duplication hint:
3341 error hint:
3342
3343  count 
3344 -------
3345      1
3346 (1 row)
3347
3348 -- No. A-11-1-5
3349 \set FETCH_COUNT 1
3350 /*+SeqScan(t1)*/
3351 SELECT count(*) FROM s1.t1 WHERE t1.c1 = 1;
3352  count 
3353 -------
3354      1
3355 (1 row)
3356
3357 \unset FETCH_COUNT
3358 ----
3359 ---- No. A-12-4 PL/pgSQL function
3360 ----
3361 -- No. A-12-4-1
3362 CREATE OR REPLACE FUNCTION f1() RETURNS SETOF text LANGUAGE plpgsql AS $$
3363 DECLARE
3364     r text;
3365 BEGIN
3366     FOR r IN EXPLAIN SELECT c4 FROM s1.t1 WHERE t1.c1 = 1
3367     LOOP
3368         RETURN NEXT r; -- return current row of SELECT
3369     END LOOP;
3370     RETURN;
3371 END
3372 $$;
3373 SELECT f1();
3374                                f1                               
3375 ----------------------------------------------------------------
3376  Index Scan using t1_i1 on t1  (cost=0.00..8.27 rows=1 width=3)
3377    Index Cond: (c1 = 1)
3378 (2 rows)
3379
3380 /*+SeqScan(t1)*/
3381 SELECT f1();
3382 LOG:  pg_hint_plan:
3383 used hint:
3384 not used hint:
3385 SeqScan(t1)
3386 duplication hint:
3387 error hint:
3388
3389 LOG:  pg_hint_plan:
3390 used hint:
3391 SeqScan(t1)
3392 not used hint:
3393 duplication hint:
3394 error hint:
3395
3396 CONTEXT:  PL/pgSQL function "f1" line 5 at FOR over SELECT rows
3397                         f1                         
3398 ---------------------------------------------------
3399  Seq Scan on t1  (cost=0.00..18.50 rows=1 width=3)
3400    Filter: (c1 = 1)
3401 (2 rows)
3402
3403 -- No. A-12-4-2
3404 /*+SeqScan(t1)*/CREATE OR REPLACE FUNCTION f1() RETURNS SETOF text LANGUAGE plpgsql AS $$
3405 DECLARE
3406     r text;
3407 BEGIN
3408     /*+SeqScan(t1)*/FOR r IN EXPLAIN /*+SeqScan(t1)*/SELECT c4 FROM s1.t1 WHERE t1.c1 = 1
3409     LOOP
3410         /*+SeqScan(t1)*/RETURN NEXT r; -- return current row of SELECT
3411     END LOOP;
3412     /*+SeqScan(t1)*/RETURN;
3413 END
3414 $$;
3415 SELECT f1();
3416                                f1                               
3417 ----------------------------------------------------------------
3418  Index Scan using t1_i1 on t1  (cost=0.00..8.27 rows=1 width=3)
3419    Index Cond: (c1 = 1)
3420 (2 rows)
3421
3422 ----
3423 ---- No. A-12-1 reset of global variable of core at the error
3424 ---- No. A-12-2 reset of global variable of original at the error
3425 ----
3426 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3427              QUERY PLAN             
3428 ------------------------------------
3429  Merge Join
3430    Merge Cond: (t1.c1 = t2.c1)
3431    ->  Index Scan using t1_i1 on t1
3432    ->  Sort
3433          Sort Key: t2.c1
3434          ->  Seq Scan on t2
3435 (6 rows)
3436
3437 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3438 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3439 INFO:  hint syntax error at or near "NestLoop(t1 t1)"
3440 DETAIL:  Relation name "t1" is duplicated.
3441 LOG:  pg_hint_plan:
3442 used hint:
3443 SeqScan(t1)
3444 MergeJoin(t1 t2)
3445 Set(enable_seqscan off)
3446 Set(geqo_threshold 100)
3447 not used hint:
3448 duplication hint:
3449 error hint:
3450 NestLoop(t1 t1)
3451
3452 EXPLAIN (COSTS false) EXECUTE p1;
3453              QUERY PLAN             
3454 ------------------------------------
3455  Merge Join
3456    Merge Cond: (t1.c1 = t2.c1)
3457    ->  Sort
3458          Sort Key: t1.c1
3459          ->  Seq Scan on t1
3460    ->  Index Scan using t2_i1 on t2
3461 (6 rows)
3462
3463 -- No. A-12-1-1
3464 -- No. A-12-2-1
3465 SELECT name, setting FROM settings;
3466            name            |  setting  
3467 ---------------------------+-----------
3468  geqo                      | on
3469  geqo_effort               | 5
3470  geqo_generations          | 0
3471  geqo_pool_size            | 0
3472  geqo_seed                 | 0
3473  geqo_selection_bias       | 2
3474  geqo_threshold            | 12
3475  constraint_exclusion      | partition
3476  cursor_tuple_fraction     | 0.1
3477  default_statistics_target | 100
3478  from_collapse_limit       | 8
3479  join_collapse_limit       | 8
3480  cpu_index_tuple_cost      | 0.005
3481  cpu_operator_cost         | 0.0025
3482  cpu_tuple_cost            | 0.01
3483  effective_cache_size      | 16384
3484  random_page_cost          | 4
3485  seq_page_cost             | 1
3486  enable_bitmapscan         | on
3487  enable_hashagg            | on
3488  enable_hashjoin           | on
3489  enable_indexscan          | on
3490  enable_material           | on
3491  enable_mergejoin          | on
3492  enable_nestloop           | on
3493  enable_seqscan            | on
3494  enable_sort               | on
3495  enable_tidscan            | on
3496  client_min_messages       | log
3497 (29 rows)
3498
3499 SET pg_hint_plan.parse_messages TO error;
3500 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3501 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3502 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3503 DETAIL:  Relation name "t1" is duplicated.
3504 SELECT name, setting FROM settings;
3505            name            |  setting  
3506 ---------------------------+-----------
3507  geqo                      | on
3508  geqo_effort               | 5
3509  geqo_generations          | 0
3510  geqo_pool_size            | 0
3511  geqo_seed                 | 0
3512  geqo_selection_bias       | 2
3513  geqo_threshold            | 12
3514  constraint_exclusion      | partition
3515  cursor_tuple_fraction     | 0.1
3516  default_statistics_target | 100
3517  from_collapse_limit       | 8
3518  join_collapse_limit       | 8
3519  cpu_index_tuple_cost      | 0.005
3520  cpu_operator_cost         | 0.0025
3521  cpu_tuple_cost            | 0.01
3522  effective_cache_size      | 16384
3523  random_page_cost          | 4
3524  seq_page_cost             | 1
3525  enable_bitmapscan         | on
3526  enable_hashagg            | on
3527  enable_hashjoin           | on
3528  enable_indexscan          | on
3529  enable_material           | on
3530  enable_mergejoin          | on
3531  enable_nestloop           | on
3532  enable_seqscan            | on
3533  enable_sort               | on
3534  enable_tidscan            | on
3535  client_min_messages       | log
3536 (29 rows)
3537
3538 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3539 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3540 LOG:  pg_hint_plan:
3541 used hint:
3542 SeqScan(t1)
3543 MergeJoin(t1 t2)
3544 Set(enable_seqscan off)
3545 Set(geqo_threshold 100)
3546 not used hint:
3547 duplication hint:
3548 error hint:
3549
3550              QUERY PLAN             
3551 ------------------------------------
3552  Merge Join
3553    Merge Cond: (t1.c1 = t2.c1)
3554    ->  Sort
3555          Sort Key: t1.c1
3556          ->  Seq Scan on t1
3557    ->  Index Scan using t2_i1 on t2
3558 (6 rows)
3559
3560 -- No. A-12-1-2
3561 -- No. A-12-2-2
3562 SELECT name, setting FROM settings;
3563            name            |  setting  
3564 ---------------------------+-----------
3565  geqo                      | on
3566  geqo_effort               | 5
3567  geqo_generations          | 0
3568  geqo_pool_size            | 0
3569  geqo_seed                 | 0
3570  geqo_selection_bias       | 2
3571  geqo_threshold            | 12
3572  constraint_exclusion      | partition
3573  cursor_tuple_fraction     | 0.1
3574  default_statistics_target | 100
3575  from_collapse_limit       | 8
3576  join_collapse_limit       | 8
3577  cpu_index_tuple_cost      | 0.005
3578  cpu_operator_cost         | 0.0025
3579  cpu_tuple_cost            | 0.01
3580  effective_cache_size      | 16384
3581  random_page_cost          | 4
3582  seq_page_cost             | 1
3583  enable_bitmapscan         | on
3584  enable_hashagg            | on
3585  enable_hashjoin           | on
3586  enable_indexscan          | on
3587  enable_material           | on
3588  enable_mergejoin          | on
3589  enable_nestloop           | on
3590  enable_seqscan            | on
3591  enable_sort               | on
3592  enable_tidscan            | on
3593  client_min_messages       | log
3594 (29 rows)
3595
3596 SET pg_hint_plan.parse_messages TO error;
3597 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3598 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3599 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3600 DETAIL:  Relation name "t1" is duplicated.
3601 SELECT name, setting FROM settings;
3602            name            |  setting  
3603 ---------------------------+-----------
3604  geqo                      | on
3605  geqo_effort               | 5
3606  geqo_generations          | 0
3607  geqo_pool_size            | 0
3608  geqo_seed                 | 0
3609  geqo_selection_bias       | 2
3610  geqo_threshold            | 12
3611  constraint_exclusion      | partition
3612  cursor_tuple_fraction     | 0.1
3613  default_statistics_target | 100
3614  from_collapse_limit       | 8
3615  join_collapse_limit       | 8
3616  cpu_index_tuple_cost      | 0.005
3617  cpu_operator_cost         | 0.0025
3618  cpu_tuple_cost            | 0.01
3619  effective_cache_size      | 16384
3620  random_page_cost          | 4
3621  seq_page_cost             | 1
3622  enable_bitmapscan         | on
3623  enable_hashagg            | on
3624  enable_hashjoin           | on
3625  enable_indexscan          | on
3626  enable_material           | on
3627  enable_mergejoin          | on
3628  enable_nestloop           | on
3629  enable_seqscan            | on
3630  enable_sort               | on
3631  enable_tidscan            | on
3632  client_min_messages       | log
3633 (29 rows)
3634
3635 EXPLAIN (COSTS false) EXECUTE p1;
3636              QUERY PLAN             
3637 ------------------------------------
3638  Merge Join
3639    Merge Cond: (t1.c1 = t2.c1)
3640    ->  Sort
3641          Sort Key: t1.c1
3642          ->  Seq Scan on t1
3643    ->  Index Scan using t2_i1 on t2
3644 (6 rows)
3645
3646 -- No. A-12-1-3
3647 -- No. A-12-2-3
3648 SELECT name, setting FROM settings;
3649            name            |  setting  
3650 ---------------------------+-----------
3651  geqo                      | on
3652  geqo_effort               | 5
3653  geqo_generations          | 0
3654  geqo_pool_size            | 0
3655  geqo_seed                 | 0
3656  geqo_selection_bias       | 2
3657  geqo_threshold            | 12
3658  constraint_exclusion      | partition
3659  cursor_tuple_fraction     | 0.1
3660  default_statistics_target | 100
3661  from_collapse_limit       | 8
3662  join_collapse_limit       | 8
3663  cpu_index_tuple_cost      | 0.005
3664  cpu_operator_cost         | 0.0025
3665  cpu_tuple_cost            | 0.01
3666  effective_cache_size      | 16384
3667  random_page_cost          | 4
3668  seq_page_cost             | 1
3669  enable_bitmapscan         | on
3670  enable_hashagg            | on
3671  enable_hashjoin           | on
3672  enable_indexscan          | on
3673  enable_material           | on
3674  enable_mergejoin          | on
3675  enable_nestloop           | on
3676  enable_seqscan            | on
3677  enable_sort               | on
3678  enable_tidscan            | on
3679  client_min_messages       | log
3680 (29 rows)
3681
3682 SET pg_hint_plan.parse_messages TO error;
3683 EXPLAIN (COSTS false) EXECUTE p2;
3684 ERROR:  prepared statement "p2" does not exist
3685 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3686 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3687 LOG:  pg_hint_plan:
3688 used hint:
3689 SeqScan(t1)
3690 MergeJoin(t1 t2)
3691 Set(enable_seqscan off)
3692 Set(geqo_threshold 100)
3693 not used hint:
3694 duplication hint:
3695 error hint:
3696
3697              QUERY PLAN             
3698 ------------------------------------
3699  Merge Join
3700    Merge Cond: (t1.c1 = t2.c1)
3701    ->  Sort
3702          Sort Key: t1.c1
3703          ->  Seq Scan on t1
3704    ->  Index Scan using t2_i1 on t2
3705 (6 rows)
3706
3707 EXPLAIN (COSTS false) EXECUTE p1;
3708              QUERY PLAN             
3709 ------------------------------------
3710  Merge Join
3711    Merge Cond: (t1.c1 = t2.c1)
3712    ->  Sort
3713          Sort Key: t1.c1
3714          ->  Seq Scan on t1
3715    ->  Index Scan using t2_i1 on t2
3716 (6 rows)
3717
3718 SELECT name, setting FROM settings;
3719            name            |  setting  
3720 ---------------------------+-----------
3721  geqo                      | on
3722  geqo_effort               | 5
3723  geqo_generations          | 0
3724  geqo_pool_size            | 0
3725  geqo_seed                 | 0
3726  geqo_selection_bias       | 2
3727  geqo_threshold            | 12
3728  constraint_exclusion      | partition
3729  cursor_tuple_fraction     | 0.1
3730  default_statistics_target | 100
3731  from_collapse_limit       | 8
3732  join_collapse_limit       | 8
3733  cpu_index_tuple_cost      | 0.005
3734  cpu_operator_cost         | 0.0025
3735  cpu_tuple_cost            | 0.01
3736  effective_cache_size      | 16384
3737  random_page_cost          | 4
3738  seq_page_cost             | 1
3739  enable_bitmapscan         | on
3740  enable_hashagg            | on
3741  enable_hashjoin           | on
3742  enable_indexscan          | on
3743  enable_material           | on
3744  enable_mergejoin          | on
3745  enable_nestloop           | on
3746  enable_seqscan            | on
3747  enable_sort               | on
3748  enable_tidscan            | on
3749  client_min_messages       | log
3750 (29 rows)
3751
3752 -- No. A-12-1-4
3753 -- No. A-12-2-4
3754 SELECT name, setting FROM settings;
3755            name            |  setting  
3756 ---------------------------+-----------
3757  geqo                      | on
3758  geqo_effort               | 5
3759  geqo_generations          | 0
3760  geqo_pool_size            | 0
3761  geqo_seed                 | 0
3762  geqo_selection_bias       | 2
3763  geqo_threshold            | 12
3764  constraint_exclusion      | partition
3765  cursor_tuple_fraction     | 0.1
3766  default_statistics_target | 100
3767  from_collapse_limit       | 8
3768  join_collapse_limit       | 8
3769  cpu_index_tuple_cost      | 0.005
3770  cpu_operator_cost         | 0.0025
3771  cpu_tuple_cost            | 0.01
3772  effective_cache_size      | 16384
3773  random_page_cost          | 4
3774  seq_page_cost             | 1
3775  enable_bitmapscan         | on
3776  enable_hashagg            | on
3777  enable_hashjoin           | on
3778  enable_indexscan          | on
3779  enable_material           | on
3780  enable_mergejoin          | on
3781  enable_nestloop           | on
3782  enable_seqscan            | on
3783  enable_sort               | on
3784  enable_tidscan            | on
3785  client_min_messages       | log
3786 (29 rows)
3787
3788 SET pg_hint_plan.parse_messages TO error;
3789 EXPLAIN (COSTS false) EXECUTE p2;
3790 ERROR:  prepared statement "p2" does not exist
3791 EXPLAIN (COSTS false) EXECUTE p1;
3792              QUERY PLAN             
3793 ------------------------------------
3794  Merge Join
3795    Merge Cond: (t1.c1 = t2.c1)
3796    ->  Sort
3797          Sort Key: t1.c1
3798          ->  Seq Scan on t1
3799    ->  Index Scan using t2_i1 on t2
3800 (6 rows)
3801
3802 SELECT name, setting FROM settings;
3803            name            |  setting  
3804 ---------------------------+-----------
3805  geqo                      | on
3806  geqo_effort               | 5
3807  geqo_generations          | 0
3808  geqo_pool_size            | 0
3809  geqo_seed                 | 0
3810  geqo_selection_bias       | 2
3811  geqo_threshold            | 12
3812  constraint_exclusion      | partition
3813  cursor_tuple_fraction     | 0.1
3814  default_statistics_target | 100
3815  from_collapse_limit       | 8
3816  join_collapse_limit       | 8
3817  cpu_index_tuple_cost      | 0.005
3818  cpu_operator_cost         | 0.0025
3819  cpu_tuple_cost            | 0.01
3820  effective_cache_size      | 16384
3821  random_page_cost          | 4
3822  seq_page_cost             | 1
3823  enable_bitmapscan         | on
3824  enable_hashagg            | on
3825  enable_hashjoin           | on
3826  enable_indexscan          | on
3827  enable_material           | on
3828  enable_mergejoin          | on
3829  enable_nestloop           | on
3830  enable_seqscan            | on
3831  enable_sort               | on
3832  enable_tidscan            | on
3833  client_min_messages       | log
3834 (29 rows)
3835
3836 DEALLOCATE p1;
3837 SET pg_hint_plan.parse_messages TO LOG;
3838 ----
3839 ---- No. A-12-3 effective range of the hint
3840 ----
3841 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3842              QUERY PLAN             
3843 ------------------------------------
3844  Merge Join
3845    Merge Cond: (t1.c1 = t2.c1)
3846    ->  Index Scan using t1_i1 on t1
3847    ->  Sort
3848          Sort Key: t2.c1
3849          ->  Seq Scan on t2
3850 (6 rows)
3851
3852 -- No. A-12-3-1
3853 SET enable_indexscan TO off;
3854 SET enable_mergejoin TO off;
3855 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3856           QUERY PLAN          
3857 ------------------------------
3858  Hash Join
3859    Hash Cond: (t1.c1 = t2.c1)
3860    ->  Seq Scan on t1
3861    ->  Hash
3862          ->  Seq Scan on t2
3863 (5 rows)
3864
3865 SELECT name, setting FROM settings;
3866            name            |  setting  
3867 ---------------------------+-----------
3868  geqo                      | on
3869  geqo_effort               | 5
3870  geqo_generations          | 0
3871  geqo_pool_size            | 0
3872  geqo_seed                 | 0
3873  geqo_selection_bias       | 2
3874  geqo_threshold            | 12
3875  constraint_exclusion      | partition
3876  cursor_tuple_fraction     | 0.1
3877  default_statistics_target | 100
3878  from_collapse_limit       | 8
3879  join_collapse_limit       | 8
3880  cpu_index_tuple_cost      | 0.005
3881  cpu_operator_cost         | 0.0025
3882  cpu_tuple_cost            | 0.01
3883  effective_cache_size      | 16384
3884  random_page_cost          | 4
3885  seq_page_cost             | 1
3886  enable_bitmapscan         | on
3887  enable_hashagg            | on
3888  enable_hashjoin           | on
3889  enable_indexscan          | off
3890  enable_material           | on
3891  enable_mergejoin          | off
3892  enable_nestloop           | on
3893  enable_seqscan            | on
3894  enable_sort               | on
3895  enable_tidscan            | on
3896  client_min_messages       | log
3897 (29 rows)
3898
3899 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3900 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3901 LOG:  pg_hint_plan:
3902 used hint:
3903 IndexScan(t2)
3904 MergeJoin(t1 t2)
3905 Leading(t2 t1)
3906 Set(enable_indexscan on)
3907 Set(geqo_threshold 100)
3908 not used hint:
3909 duplication hint:
3910 error hint:
3911
3912              QUERY PLAN             
3913 ------------------------------------
3914  Merge Join
3915    Merge Cond: (t1.c1 = t2.c1)
3916    ->  Index Scan using t1_i1 on t1
3917    ->  Index Scan using t2_i1 on t2
3918 (4 rows)
3919
3920 SELECT name, setting FROM settings;
3921            name            |  setting  
3922 ---------------------------+-----------
3923  geqo                      | on
3924  geqo_effort               | 5
3925  geqo_generations          | 0
3926  geqo_pool_size            | 0
3927  geqo_seed                 | 0
3928  geqo_selection_bias       | 2
3929  geqo_threshold            | 12
3930  constraint_exclusion      | partition
3931  cursor_tuple_fraction     | 0.1
3932  default_statistics_target | 100
3933  from_collapse_limit       | 8
3934  join_collapse_limit       | 8
3935  cpu_index_tuple_cost      | 0.005
3936  cpu_operator_cost         | 0.0025
3937  cpu_tuple_cost            | 0.01
3938  effective_cache_size      | 16384
3939  random_page_cost          | 4
3940  seq_page_cost             | 1
3941  enable_bitmapscan         | on
3942  enable_hashagg            | on
3943  enable_hashjoin           | on
3944  enable_indexscan          | off
3945  enable_material           | on
3946  enable_mergejoin          | off
3947  enable_nestloop           | on
3948  enable_seqscan            | on
3949  enable_sort               | on
3950  enable_tidscan            | on
3951  client_min_messages       | log
3952 (29 rows)
3953
3954 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3955           QUERY PLAN          
3956 ------------------------------
3957  Hash Join
3958    Hash Cond: (t1.c1 = t2.c1)
3959    ->  Seq Scan on t1
3960    ->  Hash
3961          ->  Seq Scan on t2
3962 (5 rows)
3963
3964 -- No. A-12-3-2
3965 SET enable_indexscan TO off;
3966 SET enable_mergejoin TO off;
3967 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3968           QUERY PLAN          
3969 ------------------------------
3970  Hash Join
3971    Hash Cond: (t1.c1 = t2.c1)
3972    ->  Seq Scan on t1
3973    ->  Hash
3974          ->  Seq Scan on t2
3975 (5 rows)
3976
3977 SELECT name, setting FROM settings;
3978            name            |  setting  
3979 ---------------------------+-----------
3980  geqo                      | on
3981  geqo_effort               | 5
3982  geqo_generations          | 0
3983  geqo_pool_size            | 0
3984  geqo_seed                 | 0
3985  geqo_selection_bias       | 2
3986  geqo_threshold            | 12
3987  constraint_exclusion      | partition
3988  cursor_tuple_fraction     | 0.1
3989  default_statistics_target | 100
3990  from_collapse_limit       | 8
3991  join_collapse_limit       | 8
3992  cpu_index_tuple_cost      | 0.005
3993  cpu_operator_cost         | 0.0025
3994  cpu_tuple_cost            | 0.01
3995  effective_cache_size      | 16384
3996  random_page_cost          | 4
3997  seq_page_cost             | 1
3998  enable_bitmapscan         | on
3999  enable_hashagg            | on
4000  enable_hashjoin           | on
4001  enable_indexscan          | off
4002  enable_material           | on
4003  enable_mergejoin          | off
4004  enable_nestloop           | on
4005  enable_seqscan            | on
4006  enable_sort               | on
4007  enable_tidscan            | on
4008  client_min_messages       | log
4009 (29 rows)
4010
4011 BEGIN;
4012 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4013 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4014 LOG:  pg_hint_plan:
4015 used hint:
4016 IndexScan(t2)
4017 MergeJoin(t1 t2)
4018 Leading(t2 t1)
4019 Set(enable_indexscan on)
4020 Set(geqo_threshold 100)
4021 not used hint:
4022 duplication hint:
4023 error hint:
4024
4025              QUERY PLAN             
4026 ------------------------------------
4027  Merge Join
4028    Merge Cond: (t1.c1 = t2.c1)
4029    ->  Index Scan using t1_i1 on t1
4030    ->  Index Scan using t2_i1 on t2
4031 (4 rows)
4032
4033 COMMIT;
4034 BEGIN;
4035 SELECT name, setting FROM settings;
4036            name            |  setting  
4037 ---------------------------+-----------
4038  geqo                      | on
4039  geqo_effort               | 5
4040  geqo_generations          | 0
4041  geqo_pool_size            | 0
4042  geqo_seed                 | 0
4043  geqo_selection_bias       | 2
4044  geqo_threshold            | 12
4045  constraint_exclusion      | partition
4046  cursor_tuple_fraction     | 0.1
4047  default_statistics_target | 100
4048  from_collapse_limit       | 8
4049  join_collapse_limit       | 8
4050  cpu_index_tuple_cost      | 0.005
4051  cpu_operator_cost         | 0.0025
4052  cpu_tuple_cost            | 0.01
4053  effective_cache_size      | 16384
4054  random_page_cost          | 4
4055  seq_page_cost             | 1
4056  enable_bitmapscan         | on
4057  enable_hashagg            | on
4058  enable_hashjoin           | on
4059  enable_indexscan          | off
4060  enable_material           | on
4061  enable_mergejoin          | off
4062  enable_nestloop           | on
4063  enable_seqscan            | on
4064  enable_sort               | on
4065  enable_tidscan            | on
4066  client_min_messages       | log
4067 (29 rows)
4068
4069 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4070           QUERY PLAN          
4071 ------------------------------
4072  Hash Join
4073    Hash Cond: (t1.c1 = t2.c1)
4074    ->  Seq Scan on t1
4075    ->  Hash
4076          ->  Seq Scan on t2
4077 (5 rows)
4078
4079 COMMIT;
4080 -- No. A-12-3-3
4081 SET enable_indexscan TO off;
4082 SET enable_mergejoin TO off;
4083 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4084           QUERY PLAN          
4085 ------------------------------
4086  Hash Join
4087    Hash Cond: (t1.c1 = t2.c1)
4088    ->  Seq Scan on t1
4089    ->  Hash
4090          ->  Seq Scan on t2
4091 (5 rows)
4092
4093 SELECT name, setting FROM settings;
4094            name            |  setting  
4095 ---------------------------+-----------
4096  geqo                      | on
4097  geqo_effort               | 5
4098  geqo_generations          | 0
4099  geqo_pool_size            | 0
4100  geqo_seed                 | 0
4101  geqo_selection_bias       | 2
4102  geqo_threshold            | 12
4103  constraint_exclusion      | partition
4104  cursor_tuple_fraction     | 0.1
4105  default_statistics_target | 100
4106  from_collapse_limit       | 8
4107  join_collapse_limit       | 8
4108  cpu_index_tuple_cost      | 0.005
4109  cpu_operator_cost         | 0.0025
4110  cpu_tuple_cost            | 0.01
4111  effective_cache_size      | 16384
4112  random_page_cost          | 4
4113  seq_page_cost             | 1
4114  enable_bitmapscan         | on
4115  enable_hashagg            | on
4116  enable_hashjoin           | on
4117  enable_indexscan          | off
4118  enable_material           | on
4119  enable_mergejoin          | off
4120  enable_nestloop           | on
4121  enable_seqscan            | on
4122  enable_sort               | on
4123  enable_tidscan            | on
4124  client_min_messages       | log
4125 (29 rows)
4126
4127 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4128 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4129 LOG:  pg_hint_plan:
4130 used hint:
4131 IndexScan(t2)
4132 MergeJoin(t1 t2)
4133 Leading(t2 t1)
4134 Set(enable_indexscan on)
4135 Set(geqo_threshold 100)
4136 not used hint:
4137 duplication hint:
4138 error hint:
4139
4140              QUERY PLAN             
4141 ------------------------------------
4142  Merge Join
4143    Merge Cond: (t1.c1 = t2.c1)
4144    ->  Index Scan using t1_i1 on t1
4145    ->  Index Scan using t2_i1 on t2
4146 (4 rows)
4147
4148 \connect
4149 LOAD 'pg_hint_plan';
4150 SELECT name, setting FROM settings;
4151            name            |  setting  
4152 ---------------------------+-----------
4153  geqo                      | on
4154  geqo_effort               | 5
4155  geqo_generations          | 0
4156  geqo_pool_size            | 0
4157  geqo_seed                 | 0
4158  geqo_selection_bias       | 2
4159  geqo_threshold            | 12
4160  constraint_exclusion      | partition
4161  cursor_tuple_fraction     | 0.1
4162  default_statistics_target | 100
4163  from_collapse_limit       | 8
4164  join_collapse_limit       | 8
4165  cpu_index_tuple_cost      | 0.005
4166  cpu_operator_cost         | 0.0025
4167  cpu_tuple_cost            | 0.01
4168  effective_cache_size      | 16384
4169  random_page_cost          | 4
4170  seq_page_cost             | 1
4171  enable_bitmapscan         | on
4172  enable_hashagg            | on
4173  enable_hashjoin           | on
4174  enable_indexscan          | on
4175  enable_material           | on
4176  enable_mergejoin          | on
4177  enable_nestloop           | on
4178  enable_seqscan            | on
4179  enable_sort               | on
4180  enable_tidscan            | on
4181  client_min_messages       | notice
4182 (29 rows)
4183
4184 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4185              QUERY PLAN             
4186 ------------------------------------
4187  Merge Join
4188    Merge Cond: (t1.c1 = t2.c1)
4189    ->  Index Scan using t1_i1 on t1
4190    ->  Sort
4191          Sort Key: t2.c1
4192          ->  Seq Scan on t2
4193 (6 rows)
4194
4195 SET pg_hint_plan.enable_hint TO on;
4196 SET pg_hint_plan.debug_print TO on;
4197 SET client_min_messages TO LOG;
4198 SET search_path TO public;