OSDN Git Service

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