OSDN Git Service

2af69bf2fa93f2fd2e46ff7c2a423c77b9e60c36
[pghintplan/pg_hint_plan.git] / expected / ut-A.out
1 LOAD 'pg_hint_plan';
2 SET pg_hint_plan.enable 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:  Block comments nest doesn't 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:  Block comments nest doesn't 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:  Block comments nest doesn't 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:  Block comments nest doesn't 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:  Opened 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:  Closed 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:  Keyword "NoSet" does not exist.
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:  Keyword ""Set"" does not exist.
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:  Block comments nest doesn't 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;
1447  pg_hint_plan.enable 
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 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;
1468  pg_hint_plan.enable 
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;
1486 RESET pg_hint_plan.debug_print;
1487 RESET pg_hint_plan.parse_messages;
1488 SHOW pg_hint_plan.enable;
1489  pg_hint_plan.enable 
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;
1509  pg_hint_plan.enable 
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 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;
1530  pg_hint_plan.enable 
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;
1548 RESET pg_hint_plan.debug_print;
1549 RESET pg_hint_plan.parse_messages;
1550 SHOW pg_hint_plan.enable;
1551  pg_hint_plan.enable 
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
1571 ----
1572 -- No. A-6-2-1
1573 SET pg_hint_plan.enable TO on;
1574 SHOW pg_hint_plan.enable;
1575  pg_hint_plan.enable 
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 TO off;
1592 SHOW pg_hint_plan.enable;
1593  pg_hint_plan.enable 
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 TO DEFAULT;
1608 SHOW pg_hint_plan.enable;
1609  pg_hint_plan.enable 
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 TO enable;
1626 ERROR:  parameter "pg_hint_plan.enable" requires a Boolean value
1627 SHOW pg_hint_plan.enable;
1628  pg_hint_plan.enable 
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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Opened 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:  Keyword ""Set"" does not exist.
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:  Closed 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 (1);
2244      QUERY PLAN      
2245 ---------------------
2246  Seq Scan on t1
2247    Filter: (c1 < $1)
2248 (2 rows)
2249
2250 DEALLOCATE p1;
2251 -- No. A-8-1-1
2252 -- No. A-8-1-2
2253 /*+SeqScan(t1)*/
2254 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2255 LOG:  pg_hint_plan:
2256 used hint:
2257 SeqScan(t1)
2258 not used hint:
2259 duplication hint:
2260 error hint:
2261
2262 /*+BitmapScan(t1)*/
2263 EXPLAIN (COSTS false) EXECUTE p1;
2264      QUERY PLAN     
2265 --------------------
2266  Seq Scan on t1
2267    Filter: (c1 = 1)
2268 (2 rows)
2269
2270 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2271 /*+BitmapScan(t1)*/
2272 EXPLAIN (COSTS false) EXECUTE p1;
2273 LOG:  pg_hint_plan:
2274 used hint:
2275 SeqScan(t1)
2276 not used hint:
2277 duplication hint:
2278 error hint:
2279
2280      QUERY PLAN     
2281 --------------------
2282  Seq Scan on t1
2283    Filter: (c1 = 1)
2284 (2 rows)
2285
2286 DEALLOCATE p1;
2287 /*+BitmapScan(t1)*/
2288 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2289 LOG:  pg_hint_plan:
2290 used hint:
2291 BitmapScan(t1)
2292 not used hint:
2293 duplication hint:
2294 error hint:
2295
2296 /*+SeqScan(t1)*/
2297 EXPLAIN (COSTS false) EXECUTE p1 (1);
2298             QUERY PLAN            
2299 ----------------------------------
2300  Bitmap Heap Scan on t1
2301    Recheck Cond: (c1 < $1)
2302    ->  Bitmap Index Scan on t1_i1
2303          Index Cond: (c1 < $1)
2304 (4 rows)
2305
2306 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2307 /*+SeqScan(t1)*/
2308 EXPLAIN (COSTS false) EXECUTE p1 (1);
2309 LOG:  pg_hint_plan:
2310 used hint:
2311 BitmapScan(t1)
2312 not used hint:
2313 duplication hint:
2314 error hint:
2315
2316             QUERY PLAN            
2317 ----------------------------------
2318  Bitmap Heap Scan on t1
2319    Recheck Cond: (c1 < $1)
2320    ->  Bitmap Index Scan on t1_i1
2321          Index Cond: (c1 < $1)
2322 (4 rows)
2323
2324 DEALLOCATE p1;
2325 -- No. A-8-1-3
2326 -- No. A-8-1-4
2327 /*+SeqScan(t1)*/
2328 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2329 LOG:  pg_hint_plan:
2330 used hint:
2331 SeqScan(t1)
2332 not used hint:
2333 duplication hint:
2334 error hint:
2335
2336 EXPLAIN (COSTS false) EXECUTE p1;
2337      QUERY PLAN     
2338 --------------------
2339  Seq Scan on t1
2340    Filter: (c1 = 1)
2341 (2 rows)
2342
2343 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2344 EXPLAIN (COSTS false) EXECUTE p1;
2345 LOG:  pg_hint_plan:
2346 used hint:
2347 SeqScan(t1)
2348 not used hint:
2349 duplication hint:
2350 error hint:
2351
2352      QUERY PLAN     
2353 --------------------
2354  Seq Scan on t1
2355    Filter: (c1 = 1)
2356 (2 rows)
2357
2358 DEALLOCATE p1;
2359 /*+BitmapScan(t1)*/
2360 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2361 LOG:  pg_hint_plan:
2362 used hint:
2363 BitmapScan(t1)
2364 not used hint:
2365 duplication hint:
2366 error hint:
2367
2368 EXPLAIN (COSTS false) EXECUTE p1 (1);
2369             QUERY PLAN            
2370 ----------------------------------
2371  Bitmap Heap Scan on t1
2372    Recheck Cond: (c1 < $1)
2373    ->  Bitmap Index Scan on t1_i1
2374          Index Cond: (c1 < $1)
2375 (4 rows)
2376
2377 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2378 EXPLAIN (COSTS false) EXECUTE p1 (1);
2379 LOG:  pg_hint_plan:
2380 used hint:
2381 BitmapScan(t1)
2382 not used hint:
2383 duplication hint:
2384 error hint:
2385
2386             QUERY PLAN            
2387 ----------------------------------
2388  Bitmap Heap Scan on t1
2389    Recheck Cond: (c1 < $1)
2390    ->  Bitmap Index Scan on t1_i1
2391          Index Cond: (c1 < $1)
2392 (4 rows)
2393
2394 DEALLOCATE p1;
2395 -- No. A-8-1-5
2396 -- No. A-8-1-6
2397 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2398 /*+BitmapScan(t1)*/
2399 EXPLAIN (COSTS false) EXECUTE p1;
2400           QUERY PLAN          
2401 ------------------------------
2402  Index Scan using t1_i1 on t1
2403    Index Cond: (c1 = 1)
2404 (2 rows)
2405
2406 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2407 /*+BitmapScan(t1)*/
2408 EXPLAIN (COSTS false) EXECUTE p1;
2409           QUERY PLAN          
2410 ------------------------------
2411  Index Scan using t1_i1 on t1
2412    Index Cond: (c1 = 1)
2413 (2 rows)
2414
2415 DEALLOCATE p1;
2416 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2417 /*+BitmapScan(t1)*/
2418 EXPLAIN (COSTS false) EXECUTE p1 (1);
2419      QUERY PLAN      
2420 ---------------------
2421  Seq Scan on t1
2422    Filter: (c1 < $1)
2423 (2 rows)
2424
2425 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2426 /*+BitmapScan(t1)*/
2427 EXPLAIN (COSTS false) EXECUTE p1 (1);
2428      QUERY PLAN      
2429 ---------------------
2430  Seq Scan on t1
2431    Filter: (c1 < $1)
2432 (2 rows)
2433
2434 DEALLOCATE p1;
2435 ----
2436 ---- No. A-8-4 EXECUTE statement name error
2437 ----
2438 -- No. A-8-4-1
2439 EXECUTE p1;
2440 ERROR:  prepared statement "p1" does not exist
2441 SHOW pg_hint_plan.debug_print;
2442  pg_hint_plan.debug_print 
2443 --------------------------
2444  on
2445 (1 row)
2446
2447 ----
2448 ---- No. A-9-5 EXECUTE statement name error
2449 ----
2450 -- No. A-9-5-1
2451 SELECT pg_stat_statements_reset();
2452  pg_stat_statements_reset 
2453 --------------------------
2454  
2455 (1 row)
2456
2457 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2458  c1 | c2 | c3 | c4 
2459 ----+----+----+----
2460   1 |  1 |  1 | 1
2461 (1 row)
2462
2463 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2464 LOG:  pg_hint_plan:
2465 used hint:
2466 Set(enable_seqscan off)
2467 not used hint:
2468 duplication hint:
2469 error hint:
2470
2471  c1 | c2 | c3 | c4 
2472 ----+----+----+----
2473   1 |  1 |  1 | 1
2474 (1 row)
2475
2476 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2477 LOG:  pg_hint_plan:
2478 used hint:
2479 SeqScan(t1)
2480 not used hint:
2481 duplication hint:
2482 error hint:
2483
2484  c1 | c2 | c3 | c4 
2485 ----+----+----+----
2486   1 |  1 |  1 | 1
2487 (1 row)
2488
2489 SELECT s.query, s.calls
2490   FROM public.pg_stat_statements s
2491   JOIN pg_catalog.pg_database d
2492     ON (s.dbid = d.oid)
2493  ORDER BY 1;
2494                                query                               | calls 
2495 -------------------------------------------------------------------+-------
2496  /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;             |     1
2497  /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1; |     1
2498  SELECT * FROM s1.t1 WHERE t1.c1 = 1;                              |     1
2499  SELECT pg_stat_statements_reset();                                |     1
2500 (4 rows)
2501
2502 ----
2503 ---- No. A-10-1 duplicate hint
2504 ----
2505 -- No. A-10-1-1
2506 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)';
2507                      QUERY PLAN                      
2508 -----------------------------------------------------
2509  Nested Loop
2510    Join Filter: (t1.c1 = t4.c1)
2511    ->  Nested Loop
2512          Join Filter: (t1.c1 = t3.c1)
2513          ->  Nested Loop
2514                Join Filter: (t1.c1 = t2.c1)
2515                ->  Tid Scan on t1
2516                      TID Cond: (ctid = '(1,1)'::tid)
2517                ->  Seq Scan on t2
2518                      Filter: (ctid = '(1,1)'::tid)
2519          ->  Tid Scan on t3
2520                TID Cond: (ctid = '(1,1)'::tid)
2521    ->  Tid Scan on t4
2522          TID Cond: (ctid = '(1,1)'::tid)
2523 (14 rows)
2524
2525 /*+
2526 Set(enable_tidscan aaa)
2527 Set(enable_tidscan on)
2528 Set(enable_tidscan off)
2529 SeqScan(t4)
2530 IndexScan(t4)
2531 BitmapScan(t4)
2532 TidScan(t4)
2533 NestLoop(t4 t3)
2534 MergeJoin(t4 t3)
2535 HashJoin(t4 t3)
2536 Leading(t2 t1 t4 t3)
2537 Leading(t1 t4 t3 t2)
2538 Leading(t4 t3 t2 t1)
2539 */
2540 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)';
2541 INFO:  hint syntax error at or near "SeqScan(t4)
2542 IndexScan(t4)
2543 BitmapScan(t4)
2544 TidScan(t4)
2545 NestLoop(t4 t3)
2546 MergeJoin(t4 t3)
2547 HashJoin(t4 t3)
2548 Leading(t2 t1 t4 t3)
2549 Leading(t1 t4 t3 t2)
2550 Leading(t4 t3 t2 t1)
2551 "
2552 DETAIL:  Conflict scan method hint.
2553 INFO:  hint syntax error at or near "IndexScan(t4)
2554 BitmapScan(t4)
2555 TidScan(t4)
2556 NestLoop(t4 t3)
2557 MergeJoin(t4 t3)
2558 HashJoin(t4 t3)
2559 Leading(t2 t1 t4 t3)
2560 Leading(t1 t4 t3 t2)
2561 Leading(t4 t3 t2 t1)
2562 "
2563 DETAIL:  Conflict scan method hint.
2564 INFO:  hint syntax error at or near "BitmapScan(t4)
2565 TidScan(t4)
2566 NestLoop(t4 t3)
2567 MergeJoin(t4 t3)
2568 HashJoin(t4 t3)
2569 Leading(t2 t1 t4 t3)
2570 Leading(t1 t4 t3 t2)
2571 Leading(t4 t3 t2 t1)
2572 "
2573 DETAIL:  Conflict scan method hint.
2574 INFO:  hint syntax error at or near "NestLoop(t4 t3)
2575 MergeJoin(t4 t3)
2576 HashJoin(t4 t3)
2577 Leading(t2 t1 t4 t3)
2578 Leading(t1 t4 t3 t2)
2579 Leading(t4 t3 t2 t1)
2580 "
2581 DETAIL:  Conflict join method hint.
2582 INFO:  hint syntax error at or near "MergeJoin(t4 t3)
2583 HashJoin(t4 t3)
2584 Leading(t2 t1 t4 t3)
2585 Leading(t1 t4 t3 t2)
2586 Leading(t4 t3 t2 t1)
2587 "
2588 DETAIL:  Conflict join method hint.
2589 INFO:  hint syntax error at or near "Leading(t2 t1 t4 t3)
2590 Leading(t1 t4 t3 t2)
2591 Leading(t4 t3 t2 t1)
2592 "
2593 DETAIL:  Conflict leading hint.
2594 INFO:  hint syntax error at or near "Leading(t1 t4 t3 t2)
2595 Leading(t4 t3 t2 t1)
2596 "
2597 DETAIL:  Conflict leading hint.
2598 INFO:  hint syntax error at or near "Set(enable_tidscan aaa)
2599 Set(enable_tidscan on)
2600 Set(enable_tidscan off)
2601 SeqScan(t4)
2602 IndexScan(t4)
2603 BitmapScan(t4)
2604 TidScan(t4)
2605 NestLoop(t4 t3)
2606 MergeJoin(t4 t3)
2607 HashJoin(t4 t3)
2608 Leading(t2 t1 t4 t3)
2609 Leading(t1 t4 t3 t2)
2610 Leading(t4 t3 t2 t1)
2611 "
2612 DETAIL:  Conflict set hint.
2613 INFO:  hint syntax error at or near "Set(enable_tidscan on)
2614 Set(enable_tidscan off)
2615 SeqScan(t4)
2616 IndexScan(t4)
2617 BitmapScan(t4)
2618 TidScan(t4)
2619 NestLoop(t4 t3)
2620 MergeJoin(t4 t3)
2621 HashJoin(t4 t3)
2622 Leading(t2 t1 t4 t3)
2623 Leading(t1 t4 t3 t2)
2624 Leading(t4 t3 t2 t1)
2625 "
2626 DETAIL:  Conflict set hint.
2627 LOG:  pg_hint_plan:
2628 used hint:
2629 TidScan(t4)
2630 HashJoin(t3 t4)
2631 Leading(t4 t3 t2 t1)
2632 Set(enable_tidscan off)
2633 not used hint:
2634 duplication hint:
2635 SeqScan(t4)
2636 IndexScan(t4)
2637 BitmapScan(t4)
2638 NestLoop(t3 t4)
2639 MergeJoin(t3 t4)
2640 Leading(t2 t1 t4 t3)
2641 Leading(t1 t4 t3 t2)
2642 Set(enable_tidscan aaa)
2643 Set(enable_tidscan on)
2644 error hint:
2645
2646                         QUERY PLAN                         
2647 -----------------------------------------------------------
2648  Nested Loop
2649    ->  Nested Loop
2650          Join Filter: (t3.c1 = t2.c1)
2651          ->  Hash Join
2652                Hash Cond: (t3.c1 = t4.c1)
2653                ->  Seq Scan on t3
2654                      Filter: (ctid = '(1,1)'::tid)
2655                ->  Hash
2656                      ->  Tid Scan on t4
2657                            TID Cond: (ctid = '(1,1)'::tid)
2658          ->  Seq Scan on t2
2659                Filter: (ctid = '(1,1)'::tid)
2660    ->  Index Scan using t1_i1 on t1
2661          Index Cond: (c1 = t2.c1)
2662          Filter: (ctid = '(1,1)'::tid)
2663 (15 rows)
2664
2665 -- No. A-10-1-2
2666 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)';
2667                      QUERY PLAN                      
2668 -----------------------------------------------------
2669  Nested Loop
2670    Join Filter: (t1.c1 = t4.c1)
2671    ->  Nested Loop
2672          Join Filter: (t1.c1 = t3.c1)
2673          ->  Nested Loop
2674                Join Filter: (t1.c1 = t2.c1)
2675                ->  Tid Scan on t1
2676                      TID Cond: (ctid = '(1,1)'::tid)
2677                ->  Seq Scan on t2
2678                      Filter: (ctid = '(1,1)'::tid)
2679          ->  Tid Scan on t3
2680                TID Cond: (ctid = '(1,1)'::tid)
2681    ->  Tid Scan on t4
2682          TID Cond: (ctid = '(1,1)'::tid)
2683 (14 rows)
2684
2685 /*+
2686 SeqScan(t4)
2687 Set(enable_tidscan aaa)
2688 IndexScan(t4)
2689 NestLoop(t4 t3)
2690 Leading(t2 t1 t4 t3)
2691 Set(enable_tidscan on)
2692 BitmapScan(t4)
2693 MergeJoin(t4 t3)
2694 Leading(t1 t4 t3 t2)
2695 Set(enable_tidscan off)
2696 TidScan(t4)
2697 HashJoin(t4 t3)
2698 Leading(t4 t3 t2 t1)
2699 */
2700 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)';
2701 INFO:  hint syntax error at or near "SeqScan(t4)
2702 Set(enable_tidscan aaa)
2703 IndexScan(t4)
2704 NestLoop(t4 t3)
2705 Leading(t2 t1 t4 t3)
2706 Set(enable_tidscan on)
2707 BitmapScan(t4)
2708 MergeJoin(t4 t3)
2709 Leading(t1 t4 t3 t2)
2710 Set(enable_tidscan off)
2711 TidScan(t4)
2712 HashJoin(t4 t3)
2713 Leading(t4 t3 t2 t1)
2714 "
2715 DETAIL:  Conflict scan method hint.
2716 INFO:  hint syntax error at or near "IndexScan(t4)
2717 NestLoop(t4 t3)
2718 Leading(t2 t1 t4 t3)
2719 Set(enable_tidscan on)
2720 BitmapScan(t4)
2721 MergeJoin(t4 t3)
2722 Leading(t1 t4 t3 t2)
2723 Set(enable_tidscan off)
2724 TidScan(t4)
2725 HashJoin(t4 t3)
2726 Leading(t4 t3 t2 t1)
2727 "
2728 DETAIL:  Conflict scan method hint.
2729 INFO:  hint syntax error at or near "BitmapScan(t4)
2730 MergeJoin(t4 t3)
2731 Leading(t1 t4 t3 t2)
2732 Set(enable_tidscan off)
2733 TidScan(t4)
2734 HashJoin(t4 t3)
2735 Leading(t4 t3 t2 t1)
2736 "
2737 DETAIL:  Conflict scan method hint.
2738 INFO:  hint syntax error at or near "NestLoop(t4 t3)
2739 Leading(t2 t1 t4 t3)
2740 Set(enable_tidscan on)
2741 BitmapScan(t4)
2742 MergeJoin(t4 t3)
2743 Leading(t1 t4 t3 t2)
2744 Set(enable_tidscan off)
2745 TidScan(t4)
2746 HashJoin(t4 t3)
2747 Leading(t4 t3 t2 t1)
2748 "
2749 DETAIL:  Conflict join method hint.
2750 INFO:  hint syntax error at or near "MergeJoin(t4 t3)
2751 Leading(t1 t4 t3 t2)
2752 Set(enable_tidscan off)
2753 TidScan(t4)
2754 HashJoin(t4 t3)
2755 Leading(t4 t3 t2 t1)
2756 "
2757 DETAIL:  Conflict join method hint.
2758 INFO:  hint syntax error at or near "Leading(t2 t1 t4 t3)
2759 Set(enable_tidscan on)
2760 BitmapScan(t4)
2761 MergeJoin(t4 t3)
2762 Leading(t1 t4 t3 t2)
2763 Set(enable_tidscan off)
2764 TidScan(t4)
2765 HashJoin(t4 t3)
2766 Leading(t4 t3 t2 t1)
2767 "
2768 DETAIL:  Conflict leading hint.
2769 INFO:  hint syntax error at or near "Leading(t1 t4 t3 t2)
2770 Set(enable_tidscan off)
2771 TidScan(t4)
2772 HashJoin(t4 t3)
2773 Leading(t4 t3 t2 t1)
2774 "
2775 DETAIL:  Conflict leading hint.
2776 INFO:  hint syntax error at or near "Set(enable_tidscan aaa)
2777 IndexScan(t4)
2778 NestLoop(t4 t3)
2779 Leading(t2 t1 t4 t3)
2780 Set(enable_tidscan on)
2781 BitmapScan(t4)
2782 MergeJoin(t4 t3)
2783 Leading(t1 t4 t3 t2)
2784 Set(enable_tidscan off)
2785 TidScan(t4)
2786 HashJoin(t4 t3)
2787 Leading(t4 t3 t2 t1)
2788 "
2789 DETAIL:  Conflict set hint.
2790 INFO:  hint syntax error at or near "Set(enable_tidscan on)
2791 BitmapScan(t4)
2792 MergeJoin(t4 t3)
2793 Leading(t1 t4 t3 t2)
2794 Set(enable_tidscan off)
2795 TidScan(t4)
2796 HashJoin(t4 t3)
2797 Leading(t4 t3 t2 t1)
2798 "
2799 DETAIL:  Conflict set hint.
2800 LOG:  pg_hint_plan:
2801 used hint:
2802 TidScan(t4)
2803 HashJoin(t3 t4)
2804 Leading(t4 t3 t2 t1)
2805 Set(enable_tidscan off)
2806 not used hint:
2807 duplication hint:
2808 SeqScan(t4)
2809 IndexScan(t4)
2810 BitmapScan(t4)
2811 NestLoop(t3 t4)
2812 MergeJoin(t3 t4)
2813 Leading(t2 t1 t4 t3)
2814 Leading(t1 t4 t3 t2)
2815 Set(enable_tidscan aaa)
2816 Set(enable_tidscan on)
2817 error hint:
2818
2819                         QUERY PLAN                         
2820 -----------------------------------------------------------
2821  Nested Loop
2822    ->  Nested Loop
2823          Join Filter: (t3.c1 = t2.c1)
2824          ->  Hash Join
2825                Hash Cond: (t3.c1 = t4.c1)
2826                ->  Seq Scan on t3
2827                      Filter: (ctid = '(1,1)'::tid)
2828                ->  Hash
2829                      ->  Tid Scan on t4
2830                            TID Cond: (ctid = '(1,1)'::tid)
2831          ->  Seq Scan on t2
2832                Filter: (ctid = '(1,1)'::tid)
2833    ->  Index Scan using t1_i1 on t1
2834          Index Cond: (c1 = t2.c1)
2835          Filter: (ctid = '(1,1)'::tid)
2836 (15 rows)
2837
2838 ----
2839 ---- No. A-10-2 restrict query type
2840 ----
2841 -- No. A-10-2-1
2842 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
2843           QUERY PLAN          
2844 ------------------------------
2845  Hash Full Join
2846    Hash Cond: (t1.c1 = t2.c1)
2847    ->  Seq Scan on t1
2848    ->  Hash
2849          ->  Seq Scan on t2
2850 (5 rows)
2851
2852 /*+HashJoin(t1 t2)*/
2853 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
2854 LOG:  pg_hint_plan:
2855 used hint:
2856 HashJoin(t1 t2)
2857 not used hint:
2858 duplication hint:
2859 error hint:
2860
2861           QUERY PLAN          
2862 ------------------------------
2863  Hash Full Join
2864    Hash Cond: (t1.c1 = t2.c1)
2865    ->  Seq Scan on t1
2866    ->  Hash
2867          ->  Seq Scan on t2
2868 (5 rows)
2869
2870 /*+MergeJoin(t1 t2)*/
2871 EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
2872 LOG:  pg_hint_plan:
2873 used hint:
2874 MergeJoin(t1 t2)
2875 not used hint:
2876 duplication hint:
2877 error hint:
2878
2879              QUERY PLAN             
2880 ------------------------------------
2881  Merge Full Join
2882    Merge Cond: (t1.c1 = t2.c1)
2883    ->  Index Scan using t1_i1 on t1
2884    ->  Sort
2885          Sort Key: t2.c1
2886          ->  Seq Scan on t2
2887 (6 rows)
2888
2889 /*+NestLoop(t1 t2)*/
2890 EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
2891 LOG:  pg_hint_plan:
2892 used hint:
2893 NestLoop(t1 t2)
2894 not used hint:
2895 duplication hint:
2896 error hint:
2897
2898                                 QUERY PLAN                                
2899 --------------------------------------------------------------------------
2900  Hash Full Join  (cost=10000000003.25..10000000024.00 rows=1000 width=29)
2901    Hash Cond: (t1.c1 = t2.c1)
2902    ->  Seq Scan on t1  (cost=0.00..16.00 rows=1000 width=15)
2903    ->  Hash  (cost=2.00..2.00 rows=100 width=14)
2904          ->  Seq Scan on t2  (cost=0.00..2.00 rows=100 width=14)
2905 (5 rows)
2906
2907 -- No. A-10-2-2
2908 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
2909             QUERY PLAN             
2910 -----------------------------------
2911  Tid Scan on t1
2912    TID Cond: (ctid = '(1,1)'::tid)
2913    Filter: (c3 = 1)
2914 (3 rows)
2915
2916 /*+IndexScan(t1)*/
2917 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
2918 LOG:  pg_hint_plan:
2919 used hint:
2920 IndexScan(t1)
2921 not used hint:
2922 duplication hint:
2923 error hint:
2924
2925            QUERY PLAN            
2926 ---------------------------------
2927  Index Scan using t1_i on t1
2928    Index Cond: (c3 = 1)
2929    Filter: (ctid = '(1,1)'::tid)
2930 (3 rows)
2931
2932 /*+IndexScan(t1 t1_i)*/
2933 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
2934 LOG:  pg_hint_plan:
2935 used hint:
2936 IndexScan(t1 t1_i)
2937 not used hint:
2938 duplication hint:
2939 error hint:
2940
2941            QUERY PLAN            
2942 ---------------------------------
2943  Index Scan using t1_i on t1
2944    Index Cond: (c3 = 1)
2945    Filter: (ctid = '(1,1)'::tid)
2946 (3 rows)
2947
2948 /*+IndexScan(t1 t1_i1)*/
2949 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c3 = 1 AND t1.ctid = '(1,1)';
2950 LOG:  pg_hint_plan:
2951 used hint:
2952 IndexScan(t1 t1_i1)
2953 not used hint:
2954 duplication hint:
2955 error hint:
2956
2957                               QUERY PLAN                               
2958 -----------------------------------------------------------------------
2959  Tid Scan on t1  (cost=10000000000.00..10000000004.02 rows=1 width=15)
2960    TID Cond: (ctid = '(1,1)'::tid)
2961    Filter: (c3 = 1)
2962 (3 rows)
2963
2964 -- No. A-10-2-3
2965 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2966           QUERY PLAN          
2967 ------------------------------
2968  Index Scan using t1_i1 on t1
2969    Index Cond: (c1 = 1)
2970 (2 rows)
2971
2972 /*+TidScan(t1)*/
2973 EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2974 LOG:  pg_hint_plan:
2975 used hint:
2976 TidScan(t1)
2977 not used hint:
2978 duplication hint:
2979 error hint:
2980
2981                               QUERY PLAN                               
2982 -----------------------------------------------------------------------
2983  Seq Scan on t1  (cost=10000000000.00..10000000018.50 rows=1 width=15)
2984    Filter: (c1 = 1)
2985 (2 rows)
2986
2987 /*+TidScan(t1)*/
2988 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2989 LOG:  pg_hint_plan:
2990 used hint:
2991 TidScan(t1)
2992 not used hint:
2993 duplication hint:
2994 error hint:
2995
2996             QUERY PLAN             
2997 -----------------------------------
2998  Tid Scan on t1
2999    TID Cond: (ctid = '(1,1)'::tid)
3000    Filter: (c1 = 1)
3001 (3 rows)
3002
3003 ----
3004 ---- No. A-10-3 VIEW, RULE multi specified
3005 ----
3006 -- No. A-10-3-1
3007 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3008             QUERY PLAN            
3009 ----------------------------------
3010  Hash Join
3011    Hash Cond: (v1t1.c1 = v1t1.c1)
3012    ->  Seq Scan on t1 v1t1
3013    ->  Hash
3014          ->  Seq Scan on t1 v1t1
3015 (5 rows)
3016
3017 /*+Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)*/
3018 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
3019 INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3020 DETAIL:  Relation name "v1t1" is ambiguous.
3021 INFO:  hint syntax error at or near "Leading(v1t1 v1t1)HashJoin(v1t1 v1t1)BitmapScan(v1t1)"
3022 DETAIL:  Relation name "v1t1" is ambiguous.
3023 LOG:  pg_hint_plan:
3024 used hint:
3025 BitmapScan(v1t1)
3026 not used hint:
3027 Leading(v1t1 v1t1)
3028 duplication hint:
3029 error hint:
3030 HashJoin(v1t1 v1t1)
3031
3032                 QUERY PLAN                
3033 ------------------------------------------
3034  Nested Loop
3035    ->  Index Scan using t1_i1 on t1 v1t1
3036    ->  Bitmap Heap Scan on t1 v1t1
3037          Recheck Cond: (c1 = v1t1.c1)
3038          ->  Bitmap Index Scan on t1_i1
3039                Index Cond: (c1 = v1t1.c1)
3040 (6 rows)
3041
3042 -- No. A-10-3-2
3043 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3044             QUERY PLAN             
3045 -----------------------------------
3046  Hash Join
3047    Hash Cond: (v1t1.c1 = v1t1_.c1)
3048    ->  Seq Scan on t1 v1t1
3049    ->  Hash
3050          ->  Seq Scan on t1 v1t1_
3051 (5 rows)
3052
3053 /*+Leading(v1t1 v1t1_)NestLoop(v1t1 v1t1_)SeqScan(v1t1)BitmapScan(v1t1_)*/
3054 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
3055 LOG:  pg_hint_plan:
3056 used hint:
3057 SeqScan(v1t1)
3058 BitmapScan(v1t1_)
3059 NestLoop(v1t1 v1t1_)
3060 Leading(v1t1 v1t1_)
3061 not used hint:
3062 duplication hint:
3063 error hint:
3064
3065                 QUERY PLAN                
3066 ------------------------------------------
3067  Nested Loop
3068    ->  Seq Scan on t1 v1t1
3069    ->  Bitmap Heap Scan on t1 v1t1_
3070          Recheck Cond: (c1 = v1t1.c1)
3071          ->  Bitmap Index Scan on t1_i1
3072                Index Cond: (c1 = v1t1.c1)
3073 (6 rows)
3074
3075 -- No. A-10-3-3
3076 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3077             QUERY PLAN            
3078 ----------------------------------
3079  Hash Join
3080    Hash Cond: (r4t1.c1 = r4t1.c1)
3081    ->  Seq Scan on t1 r4t1
3082    ->  Hash
3083          ->  Seq Scan on t1 r4t1
3084 (5 rows)
3085
3086 /*+Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)*/
3087 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
3088 INFO:  hint syntax error at or near "HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3089 DETAIL:  Relation name "r4t1" is ambiguous.
3090 INFO:  hint syntax error at or near "Leading(r4t1 r4t1)HashJoin(r4t1 r4t1)BitmapScan(r4t1)"
3091 DETAIL:  Relation name "r4t1" is ambiguous.
3092 LOG:  pg_hint_plan:
3093 used hint:
3094 BitmapScan(r4t1)
3095 not used hint:
3096 Leading(r4t1 r4t1)
3097 duplication hint:
3098 error hint:
3099 HashJoin(r4t1 r4t1)
3100
3101                 QUERY PLAN                
3102 ------------------------------------------
3103  Nested Loop
3104    ->  Index Scan using t1_i1 on t1 r4t1
3105    ->  Bitmap Heap Scan on t1 r4t1
3106          Recheck Cond: (c1 = r4t1.c1)
3107          ->  Bitmap Index Scan on t1_i1
3108                Index Cond: (c1 = r4t1.c1)
3109 (6 rows)
3110
3111 -- No. A-10-3-4
3112 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3113             QUERY PLAN            
3114 ----------------------------------
3115  Hash Join
3116    Hash Cond: (r4t1.c1 = r5t1.c1)
3117    ->  Seq Scan on t1 r4t1
3118    ->  Hash
3119          ->  Seq Scan on t1 r5t1
3120 (5 rows)
3121
3122 /*+Leading(r4t1 r5t1)NestLoop(r4t1 r5t1)SeqScan(r4t1)BitmapScan(r5t1)*/
3123 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
3124 LOG:  pg_hint_plan:
3125 used hint:
3126 SeqScan(r4t1)
3127 BitmapScan(r5t1)
3128 NestLoop(r4t1 r5t1)
3129 Leading(r4t1 r5t1)
3130 not used hint:
3131 duplication hint:
3132 error hint:
3133
3134                 QUERY PLAN                
3135 ------------------------------------------
3136  Nested Loop
3137    ->  Seq Scan on t1 r4t1
3138    ->  Bitmap Heap Scan on t1 r5t1
3139          Recheck Cond: (c1 = r4t1.c1)
3140          ->  Bitmap Index Scan on t1_i1
3141                Index Cond: (c1 = r4t1.c1)
3142 (6 rows)
3143
3144 ----
3145 ---- No. A-12-1 reset of global variable of core at the error
3146 ---- No. A-12-2 reset of global variable of original at the error
3147 ----
3148 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3149              QUERY PLAN             
3150 ------------------------------------
3151  Merge Join
3152    Merge Cond: (t1.c1 = t2.c1)
3153    ->  Index Scan using t1_i1 on t1
3154    ->  Sort
3155          Sort Key: t2.c1
3156          ->  Seq Scan on t2
3157 (6 rows)
3158
3159 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3160 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3161 INFO:  hint syntax error at or near "NestLoop(t1 t1)"
3162 DETAIL:  Relation name "t1" is duplicate.
3163 LOG:  pg_hint_plan:
3164 used hint:
3165 SeqScan(t1)
3166 MergeJoin(t1 t2)
3167 Set(enable_seqscan off)
3168 Set(geqo_threshold 100)
3169 not used hint:
3170 duplication hint:
3171 error hint:
3172 NestLoop(t1 t1)
3173
3174 EXPLAIN (COSTS false) EXECUTE p1;
3175              QUERY PLAN             
3176 ------------------------------------
3177  Merge Join
3178    Merge Cond: (t1.c1 = t2.c1)
3179    ->  Sort
3180          Sort Key: t1.c1
3181          ->  Seq Scan on t1
3182    ->  Index Scan using t2_i1 on t2
3183 (6 rows)
3184
3185 -- No. A-12-1-1
3186 -- No. A-12-2-1
3187 SELECT name, setting FROM settings;
3188            name            |  setting  
3189 ---------------------------+-----------
3190  geqo                      | on
3191  geqo_effort               | 5
3192  geqo_generations          | 0
3193  geqo_pool_size            | 0
3194  geqo_seed                 | 0
3195  geqo_selection_bias       | 2
3196  geqo_threshold            | 12
3197  constraint_exclusion      | partition
3198  cursor_tuple_fraction     | 0.1
3199  default_statistics_target | 100
3200  from_collapse_limit       | 8
3201  join_collapse_limit       | 8
3202  cpu_index_tuple_cost      | 0.005
3203  cpu_operator_cost         | 0.0025
3204  cpu_tuple_cost            | 0.01
3205  effective_cache_size      | 16384
3206  random_page_cost          | 4
3207  seq_page_cost             | 1
3208  enable_bitmapscan         | on
3209  enable_hashagg            | on
3210  enable_hashjoin           | on
3211  enable_indexscan          | on
3212  enable_material           | on
3213  enable_mergejoin          | on
3214  enable_nestloop           | on
3215  enable_seqscan            | on
3216  enable_sort               | on
3217  enable_tidscan            | on
3218  client_min_messages       | log
3219 (29 rows)
3220
3221 SET pg_hint_plan.parse_messages TO error;
3222 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3223 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3224 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3225 DETAIL:  Relation name "t1" is duplicate.
3226 SELECT name, setting FROM settings;
3227            name            |  setting  
3228 ---------------------------+-----------
3229  geqo                      | on
3230  geqo_effort               | 5
3231  geqo_generations          | 0
3232  geqo_pool_size            | 0
3233  geqo_seed                 | 0
3234  geqo_selection_bias       | 2
3235  geqo_threshold            | 12
3236  constraint_exclusion      | partition
3237  cursor_tuple_fraction     | 0.1
3238  default_statistics_target | 100
3239  from_collapse_limit       | 8
3240  join_collapse_limit       | 8
3241  cpu_index_tuple_cost      | 0.005
3242  cpu_operator_cost         | 0.0025
3243  cpu_tuple_cost            | 0.01
3244  effective_cache_size      | 16384
3245  random_page_cost          | 4
3246  seq_page_cost             | 1
3247  enable_bitmapscan         | on
3248  enable_hashagg            | on
3249  enable_hashjoin           | on
3250  enable_indexscan          | on
3251  enable_material           | on
3252  enable_mergejoin          | on
3253  enable_nestloop           | on
3254  enable_seqscan            | on
3255  enable_sort               | on
3256  enable_tidscan            | on
3257  client_min_messages       | log
3258 (29 rows)
3259
3260 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3261 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3262 LOG:  pg_hint_plan:
3263 used hint:
3264 SeqScan(t1)
3265 MergeJoin(t1 t2)
3266 Set(enable_seqscan off)
3267 Set(geqo_threshold 100)
3268 not used hint:
3269 duplication hint:
3270 error hint:
3271
3272              QUERY PLAN             
3273 ------------------------------------
3274  Merge Join
3275    Merge Cond: (t1.c1 = t2.c1)
3276    ->  Sort
3277          Sort Key: t1.c1
3278          ->  Seq Scan on t1
3279    ->  Index Scan using t2_i1 on t2
3280 (6 rows)
3281
3282 -- No. A-12-1-2
3283 -- No. A-12-2-2
3284 SELECT name, setting FROM settings;
3285            name            |  setting  
3286 ---------------------------+-----------
3287  geqo                      | on
3288  geqo_effort               | 5
3289  geqo_generations          | 0
3290  geqo_pool_size            | 0
3291  geqo_seed                 | 0
3292  geqo_selection_bias       | 2
3293  geqo_threshold            | 12
3294  constraint_exclusion      | partition
3295  cursor_tuple_fraction     | 0.1
3296  default_statistics_target | 100
3297  from_collapse_limit       | 8
3298  join_collapse_limit       | 8
3299  cpu_index_tuple_cost      | 0.005
3300  cpu_operator_cost         | 0.0025
3301  cpu_tuple_cost            | 0.01
3302  effective_cache_size      | 16384
3303  random_page_cost          | 4
3304  seq_page_cost             | 1
3305  enable_bitmapscan         | on
3306  enable_hashagg            | on
3307  enable_hashjoin           | on
3308  enable_indexscan          | on
3309  enable_material           | on
3310  enable_mergejoin          | on
3311  enable_nestloop           | on
3312  enable_seqscan            | on
3313  enable_sort               | on
3314  enable_tidscan            | on
3315  client_min_messages       | log
3316 (29 rows)
3317
3318 SET pg_hint_plan.parse_messages TO error;
3319 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3320 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3321 ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
3322 DETAIL:  Relation name "t1" is duplicate.
3323 SELECT name, setting FROM settings;
3324            name            |  setting  
3325 ---------------------------+-----------
3326  geqo                      | on
3327  geqo_effort               | 5
3328  geqo_generations          | 0
3329  geqo_pool_size            | 0
3330  geqo_seed                 | 0
3331  geqo_selection_bias       | 2
3332  geqo_threshold            | 12
3333  constraint_exclusion      | partition
3334  cursor_tuple_fraction     | 0.1
3335  default_statistics_target | 100
3336  from_collapse_limit       | 8
3337  join_collapse_limit       | 8
3338  cpu_index_tuple_cost      | 0.005
3339  cpu_operator_cost         | 0.0025
3340  cpu_tuple_cost            | 0.01
3341  effective_cache_size      | 16384
3342  random_page_cost          | 4
3343  seq_page_cost             | 1
3344  enable_bitmapscan         | on
3345  enable_hashagg            | on
3346  enable_hashjoin           | on
3347  enable_indexscan          | on
3348  enable_material           | on
3349  enable_mergejoin          | on
3350  enable_nestloop           | on
3351  enable_seqscan            | on
3352  enable_sort               | on
3353  enable_tidscan            | on
3354  client_min_messages       | log
3355 (29 rows)
3356
3357 EXPLAIN (COSTS false) EXECUTE p1;
3358              QUERY PLAN             
3359 ------------------------------------
3360  Merge Join
3361    Merge Cond: (t1.c1 = t2.c1)
3362    ->  Sort
3363          Sort Key: t1.c1
3364          ->  Seq Scan on t1
3365    ->  Index Scan using t2_i1 on t2
3366 (6 rows)
3367
3368 -- No. A-12-1-3
3369 -- No. A-12-2-3
3370 SELECT name, setting FROM settings;
3371            name            |  setting  
3372 ---------------------------+-----------
3373  geqo                      | on
3374  geqo_effort               | 5
3375  geqo_generations          | 0
3376  geqo_pool_size            | 0
3377  geqo_seed                 | 0
3378  geqo_selection_bias       | 2
3379  geqo_threshold            | 12
3380  constraint_exclusion      | partition
3381  cursor_tuple_fraction     | 0.1
3382  default_statistics_target | 100
3383  from_collapse_limit       | 8
3384  join_collapse_limit       | 8
3385  cpu_index_tuple_cost      | 0.005
3386  cpu_operator_cost         | 0.0025
3387  cpu_tuple_cost            | 0.01
3388  effective_cache_size      | 16384
3389  random_page_cost          | 4
3390  seq_page_cost             | 1
3391  enable_bitmapscan         | on
3392  enable_hashagg            | on
3393  enable_hashjoin           | on
3394  enable_indexscan          | on
3395  enable_material           | on
3396  enable_mergejoin          | on
3397  enable_nestloop           | on
3398  enable_seqscan            | on
3399  enable_sort               | on
3400  enable_tidscan            | on
3401  client_min_messages       | log
3402 (29 rows)
3403
3404 SET pg_hint_plan.parse_messages TO error;
3405 EXPLAIN (COSTS false) EXECUTE p2;
3406 ERROR:  prepared statement "p2" does not exist
3407 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3408 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3409 LOG:  pg_hint_plan:
3410 used hint:
3411 SeqScan(t1)
3412 MergeJoin(t1 t2)
3413 Set(enable_seqscan off)
3414 Set(geqo_threshold 100)
3415 not used hint:
3416 duplication hint:
3417 error hint:
3418
3419              QUERY PLAN             
3420 ------------------------------------
3421  Merge Join
3422    Merge Cond: (t1.c1 = t2.c1)
3423    ->  Sort
3424          Sort Key: t1.c1
3425          ->  Seq Scan on t1
3426    ->  Index Scan using t2_i1 on t2
3427 (6 rows)
3428
3429 EXPLAIN (COSTS false) EXECUTE p1;
3430              QUERY PLAN             
3431 ------------------------------------
3432  Merge Join
3433    Merge Cond: (t1.c1 = t2.c1)
3434    ->  Sort
3435          Sort Key: t1.c1
3436          ->  Seq Scan on t1
3437    ->  Index Scan using t2_i1 on t2
3438 (6 rows)
3439
3440 SELECT name, setting FROM settings;
3441            name            |  setting  
3442 ---------------------------+-----------
3443  geqo                      | on
3444  geqo_effort               | 5
3445  geqo_generations          | 0
3446  geqo_pool_size            | 0
3447  geqo_seed                 | 0
3448  geqo_selection_bias       | 2
3449  geqo_threshold            | 12
3450  constraint_exclusion      | partition
3451  cursor_tuple_fraction     | 0.1
3452  default_statistics_target | 100
3453  from_collapse_limit       | 8
3454  join_collapse_limit       | 8
3455  cpu_index_tuple_cost      | 0.005
3456  cpu_operator_cost         | 0.0025
3457  cpu_tuple_cost            | 0.01
3458  effective_cache_size      | 16384
3459  random_page_cost          | 4
3460  seq_page_cost             | 1
3461  enable_bitmapscan         | on
3462  enable_hashagg            | on
3463  enable_hashjoin           | on
3464  enable_indexscan          | on
3465  enable_material           | on
3466  enable_mergejoin          | on
3467  enable_nestloop           | on
3468  enable_seqscan            | on
3469  enable_sort               | on
3470  enable_tidscan            | on
3471  client_min_messages       | log
3472 (29 rows)
3473
3474 -- No. A-12-1-4
3475 -- No. A-12-2-4
3476 SELECT name, setting FROM settings;
3477            name            |  setting  
3478 ---------------------------+-----------
3479  geqo                      | on
3480  geqo_effort               | 5
3481  geqo_generations          | 0
3482  geqo_pool_size            | 0
3483  geqo_seed                 | 0
3484  geqo_selection_bias       | 2
3485  geqo_threshold            | 12
3486  constraint_exclusion      | partition
3487  cursor_tuple_fraction     | 0.1
3488  default_statistics_target | 100
3489  from_collapse_limit       | 8
3490  join_collapse_limit       | 8
3491  cpu_index_tuple_cost      | 0.005
3492  cpu_operator_cost         | 0.0025
3493  cpu_tuple_cost            | 0.01
3494  effective_cache_size      | 16384
3495  random_page_cost          | 4
3496  seq_page_cost             | 1
3497  enable_bitmapscan         | on
3498  enable_hashagg            | on
3499  enable_hashjoin           | on
3500  enable_indexscan          | on
3501  enable_material           | on
3502  enable_mergejoin          | on
3503  enable_nestloop           | on
3504  enable_seqscan            | on
3505  enable_sort               | on
3506  enable_tidscan            | on
3507  client_min_messages       | log
3508 (29 rows)
3509
3510 SET pg_hint_plan.parse_messages TO error;
3511 EXPLAIN (COSTS false) EXECUTE p2;
3512 ERROR:  prepared statement "p2" does not exist
3513 EXPLAIN (COSTS false) EXECUTE p1;
3514              QUERY PLAN             
3515 ------------------------------------
3516  Merge Join
3517    Merge Cond: (t1.c1 = t2.c1)
3518    ->  Sort
3519          Sort Key: t1.c1
3520          ->  Seq Scan on t1
3521    ->  Index Scan using t2_i1 on t2
3522 (6 rows)
3523
3524 SELECT name, setting FROM settings;
3525            name            |  setting  
3526 ---------------------------+-----------
3527  geqo                      | on
3528  geqo_effort               | 5
3529  geqo_generations          | 0
3530  geqo_pool_size            | 0
3531  geqo_seed                 | 0
3532  geqo_selection_bias       | 2
3533  geqo_threshold            | 12
3534  constraint_exclusion      | partition
3535  cursor_tuple_fraction     | 0.1
3536  default_statistics_target | 100
3537  from_collapse_limit       | 8
3538  join_collapse_limit       | 8
3539  cpu_index_tuple_cost      | 0.005
3540  cpu_operator_cost         | 0.0025
3541  cpu_tuple_cost            | 0.01
3542  effective_cache_size      | 16384
3543  random_page_cost          | 4
3544  seq_page_cost             | 1
3545  enable_bitmapscan         | on
3546  enable_hashagg            | on
3547  enable_hashjoin           | on
3548  enable_indexscan          | on
3549  enable_material           | on
3550  enable_mergejoin          | on
3551  enable_nestloop           | on
3552  enable_seqscan            | on
3553  enable_sort               | on
3554  enable_tidscan            | on
3555  client_min_messages       | log
3556 (29 rows)
3557
3558 DEALLOCATE p1;
3559 SET pg_hint_plan.parse_messages TO LOG;
3560 ----
3561 ---- No. A-12-3 effective range of the hint
3562 ----
3563 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3564              QUERY PLAN             
3565 ------------------------------------
3566  Merge Join
3567    Merge Cond: (t1.c1 = t2.c1)
3568    ->  Index Scan using t1_i1 on t1
3569    ->  Sort
3570          Sort Key: t2.c1
3571          ->  Seq Scan on t2
3572 (6 rows)
3573
3574 -- No. A-12-3-1
3575 SET enable_indexscan TO off;
3576 SET enable_mergejoin TO off;
3577 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3578           QUERY PLAN          
3579 ------------------------------
3580  Hash Join
3581    Hash Cond: (t1.c1 = t2.c1)
3582    ->  Seq Scan on t1
3583    ->  Hash
3584          ->  Seq Scan on t2
3585 (5 rows)
3586
3587 SELECT name, setting FROM settings;
3588            name            |  setting  
3589 ---------------------------+-----------
3590  geqo                      | on
3591  geqo_effort               | 5
3592  geqo_generations          | 0
3593  geqo_pool_size            | 0
3594  geqo_seed                 | 0
3595  geqo_selection_bias       | 2
3596  geqo_threshold            | 12
3597  constraint_exclusion      | partition
3598  cursor_tuple_fraction     | 0.1
3599  default_statistics_target | 100
3600  from_collapse_limit       | 8
3601  join_collapse_limit       | 8
3602  cpu_index_tuple_cost      | 0.005
3603  cpu_operator_cost         | 0.0025
3604  cpu_tuple_cost            | 0.01
3605  effective_cache_size      | 16384
3606  random_page_cost          | 4
3607  seq_page_cost             | 1
3608  enable_bitmapscan         | on
3609  enable_hashagg            | on
3610  enable_hashjoin           | on
3611  enable_indexscan          | off
3612  enable_material           | on
3613  enable_mergejoin          | off
3614  enable_nestloop           | on
3615  enable_seqscan            | on
3616  enable_sort               | on
3617  enable_tidscan            | on
3618  client_min_messages       | log
3619 (29 rows)
3620
3621 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3622 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3623 LOG:  pg_hint_plan:
3624 used hint:
3625 IndexScan(t2)
3626 MergeJoin(t1 t2)
3627 Leading(t2 t1)
3628 Set(enable_indexscan on)
3629 Set(geqo_threshold 100)
3630 not used hint:
3631 duplication hint:
3632 error hint:
3633
3634              QUERY PLAN             
3635 ------------------------------------
3636  Merge Join
3637    Merge Cond: (t1.c1 = t2.c1)
3638    ->  Index Scan using t1_i1 on t1
3639    ->  Index Scan using t2_i1 on t2
3640 (4 rows)
3641
3642 SELECT name, setting FROM settings;
3643            name            |  setting  
3644 ---------------------------+-----------
3645  geqo                      | on
3646  geqo_effort               | 5
3647  geqo_generations          | 0
3648  geqo_pool_size            | 0
3649  geqo_seed                 | 0
3650  geqo_selection_bias       | 2
3651  geqo_threshold            | 12
3652  constraint_exclusion      | partition
3653  cursor_tuple_fraction     | 0.1
3654  default_statistics_target | 100
3655  from_collapse_limit       | 8
3656  join_collapse_limit       | 8
3657  cpu_index_tuple_cost      | 0.005
3658  cpu_operator_cost         | 0.0025
3659  cpu_tuple_cost            | 0.01
3660  effective_cache_size      | 16384
3661  random_page_cost          | 4
3662  seq_page_cost             | 1
3663  enable_bitmapscan         | on
3664  enable_hashagg            | on
3665  enable_hashjoin           | on
3666  enable_indexscan          | off
3667  enable_material           | on
3668  enable_mergejoin          | off
3669  enable_nestloop           | on
3670  enable_seqscan            | on
3671  enable_sort               | on
3672  enable_tidscan            | on
3673  client_min_messages       | log
3674 (29 rows)
3675
3676 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3677           QUERY PLAN          
3678 ------------------------------
3679  Hash Join
3680    Hash Cond: (t1.c1 = t2.c1)
3681    ->  Seq Scan on t1
3682    ->  Hash
3683          ->  Seq Scan on t2
3684 (5 rows)
3685
3686 -- No. A-12-3-2
3687 SET enable_indexscan TO off;
3688 SET enable_mergejoin TO off;
3689 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3690           QUERY PLAN          
3691 ------------------------------
3692  Hash Join
3693    Hash Cond: (t1.c1 = t2.c1)
3694    ->  Seq Scan on t1
3695    ->  Hash
3696          ->  Seq Scan on t2
3697 (5 rows)
3698
3699 SELECT name, setting FROM settings;
3700            name            |  setting  
3701 ---------------------------+-----------
3702  geqo                      | on
3703  geqo_effort               | 5
3704  geqo_generations          | 0
3705  geqo_pool_size            | 0
3706  geqo_seed                 | 0
3707  geqo_selection_bias       | 2
3708  geqo_threshold            | 12
3709  constraint_exclusion      | partition
3710  cursor_tuple_fraction     | 0.1
3711  default_statistics_target | 100
3712  from_collapse_limit       | 8
3713  join_collapse_limit       | 8
3714  cpu_index_tuple_cost      | 0.005
3715  cpu_operator_cost         | 0.0025
3716  cpu_tuple_cost            | 0.01
3717  effective_cache_size      | 16384
3718  random_page_cost          | 4
3719  seq_page_cost             | 1
3720  enable_bitmapscan         | on
3721  enable_hashagg            | on
3722  enable_hashjoin           | on
3723  enable_indexscan          | off
3724  enable_material           | on
3725  enable_mergejoin          | off
3726  enable_nestloop           | on
3727  enable_seqscan            | on
3728  enable_sort               | on
3729  enable_tidscan            | on
3730  client_min_messages       | log
3731 (29 rows)
3732
3733 BEGIN;
3734 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3735 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3736 LOG:  pg_hint_plan:
3737 used hint:
3738 IndexScan(t2)
3739 MergeJoin(t1 t2)
3740 Leading(t2 t1)
3741 Set(enable_indexscan on)
3742 Set(geqo_threshold 100)
3743 not used hint:
3744 duplication hint:
3745 error hint:
3746
3747              QUERY PLAN             
3748 ------------------------------------
3749  Merge Join
3750    Merge Cond: (t1.c1 = t2.c1)
3751    ->  Index Scan using t1_i1 on t1
3752    ->  Index Scan using t2_i1 on t2
3753 (4 rows)
3754
3755 COMMIT;
3756 BEGIN;
3757 SELECT name, setting FROM settings;
3758            name            |  setting  
3759 ---------------------------+-----------
3760  geqo                      | on
3761  geqo_effort               | 5
3762  geqo_generations          | 0
3763  geqo_pool_size            | 0
3764  geqo_seed                 | 0
3765  geqo_selection_bias       | 2
3766  geqo_threshold            | 12
3767  constraint_exclusion      | partition
3768  cursor_tuple_fraction     | 0.1
3769  default_statistics_target | 100
3770  from_collapse_limit       | 8
3771  join_collapse_limit       | 8
3772  cpu_index_tuple_cost      | 0.005
3773  cpu_operator_cost         | 0.0025
3774  cpu_tuple_cost            | 0.01
3775  effective_cache_size      | 16384
3776  random_page_cost          | 4
3777  seq_page_cost             | 1
3778  enable_bitmapscan         | on
3779  enable_hashagg            | on
3780  enable_hashjoin           | on
3781  enable_indexscan          | off
3782  enable_material           | on
3783  enable_mergejoin          | off
3784  enable_nestloop           | on
3785  enable_seqscan            | on
3786  enable_sort               | on
3787  enable_tidscan            | on
3788  client_min_messages       | log
3789 (29 rows)
3790
3791 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3792           QUERY PLAN          
3793 ------------------------------
3794  Hash Join
3795    Hash Cond: (t1.c1 = t2.c1)
3796    ->  Seq Scan on t1
3797    ->  Hash
3798          ->  Seq Scan on t2
3799 (5 rows)
3800
3801 COMMIT;
3802 -- No. A-12-3-3
3803 SET enable_indexscan TO off;
3804 SET enable_mergejoin TO off;
3805 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3806           QUERY PLAN          
3807 ------------------------------
3808  Hash Join
3809    Hash Cond: (t1.c1 = t2.c1)
3810    ->  Seq Scan on t1
3811    ->  Hash
3812          ->  Seq Scan on t2
3813 (5 rows)
3814
3815 SELECT name, setting FROM settings;
3816            name            |  setting  
3817 ---------------------------+-----------
3818  geqo                      | on
3819  geqo_effort               | 5
3820  geqo_generations          | 0
3821  geqo_pool_size            | 0
3822  geqo_seed                 | 0
3823  geqo_selection_bias       | 2
3824  geqo_threshold            | 12
3825  constraint_exclusion      | partition
3826  cursor_tuple_fraction     | 0.1
3827  default_statistics_target | 100
3828  from_collapse_limit       | 8
3829  join_collapse_limit       | 8
3830  cpu_index_tuple_cost      | 0.005
3831  cpu_operator_cost         | 0.0025
3832  cpu_tuple_cost            | 0.01
3833  effective_cache_size      | 16384
3834  random_page_cost          | 4
3835  seq_page_cost             | 1
3836  enable_bitmapscan         | on
3837  enable_hashagg            | on
3838  enable_hashjoin           | on
3839  enable_indexscan          | off
3840  enable_material           | on
3841  enable_mergejoin          | off
3842  enable_nestloop           | on
3843  enable_seqscan            | on
3844  enable_sort               | on
3845  enable_tidscan            | on
3846  client_min_messages       | log
3847 (29 rows)
3848
3849 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3850 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3851 LOG:  pg_hint_plan:
3852 used hint:
3853 IndexScan(t2)
3854 MergeJoin(t1 t2)
3855 Leading(t2 t1)
3856 Set(enable_indexscan on)
3857 Set(geqo_threshold 100)
3858 not used hint:
3859 duplication hint:
3860 error hint:
3861
3862              QUERY PLAN             
3863 ------------------------------------
3864  Merge Join
3865    Merge Cond: (t1.c1 = t2.c1)
3866    ->  Index Scan using t1_i1 on t1
3867    ->  Index Scan using t2_i1 on t2
3868 (4 rows)
3869
3870 \connect
3871 LOAD 'pg_hint_plan';
3872 SELECT name, setting FROM settings;
3873            name            |  setting  
3874 ---------------------------+-----------
3875  geqo                      | on
3876  geqo_effort               | 5
3877  geqo_generations          | 0
3878  geqo_pool_size            | 0
3879  geqo_seed                 | 0
3880  geqo_selection_bias       | 2
3881  geqo_threshold            | 12
3882  constraint_exclusion      | partition
3883  cursor_tuple_fraction     | 0.1
3884  default_statistics_target | 100
3885  from_collapse_limit       | 8
3886  join_collapse_limit       | 8
3887  cpu_index_tuple_cost      | 0.005
3888  cpu_operator_cost         | 0.0025
3889  cpu_tuple_cost            | 0.01
3890  effective_cache_size      | 16384
3891  random_page_cost          | 4
3892  seq_page_cost             | 1
3893  enable_bitmapscan         | on
3894  enable_hashagg            | on
3895  enable_hashjoin           | on
3896  enable_indexscan          | on
3897  enable_material           | on
3898  enable_mergejoin          | on
3899  enable_nestloop           | on
3900  enable_seqscan            | on
3901  enable_sort               | on
3902  enable_tidscan            | on
3903  client_min_messages       | notice
3904 (29 rows)
3905
3906 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3907              QUERY PLAN             
3908 ------------------------------------
3909  Merge Join
3910    Merge Cond: (t1.c1 = t2.c1)
3911    ->  Index Scan using t1_i1 on t1
3912    ->  Sort
3913          Sort Key: t2.c1
3914          ->  Seq Scan on t2
3915 (6 rows)
3916
3917 SET pg_hint_plan.enable TO on;
3918 SET pg_hint_plan.debug_print TO on;
3919 SET client_min_messages TO LOG;
3920 SET search_path TO public;