OSDN Git Service

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