OSDN Git Service

Support PostgreSQL 14
[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  from_collapse_limit            | 8
3243  jit                            | on
3244  join_collapse_limit            | 8
3245  plan_cache_mode                | auto
3246  cpu_index_tuple_cost           | 0.005
3247  cpu_operator_cost              | 0.0025
3248  cpu_tuple_cost                 | 0.01
3249  effective_cache_size           | 16384
3250  jit_above_cost                 | 100000
3251  jit_inline_above_cost          | 500000
3252  jit_optimize_above_cost        | 500000
3253  min_parallel_index_scan_size   | 64
3254  min_parallel_table_scan_size   | 1024
3255  parallel_setup_cost            | 1000
3256  parallel_tuple_cost            | 0.1
3257  random_page_cost               | 4
3258  seq_page_cost                  | 1
3259  enable_async_append            | on
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_memoize                 | on
3269  enable_mergejoin               | on
3270  enable_nestloop                | on
3271  enable_parallel_append         | on
3272  enable_parallel_hash           | on
3273  enable_partition_pruning       | on
3274  enable_partitionwise_aggregate | off
3275  enable_partitionwise_join      | off
3276  enable_seqscan                 | on
3277  enable_sort                    | on
3278  enable_tidscan                 | on
3279 (48 rows)
3280
3281 SET pg_hint_plan.parse_messages TO error;
3282 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3283 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3284 ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3285 DETAIL:  Relation name "t1" is duplicated.
3286 SELECT name, setting FROM settings;
3287               name              |  setting  
3288 --------------------------------+-----------
3289  client_min_messages            | log
3290  geqo                           | on
3291  geqo_effort                    | 5
3292  geqo_generations               | 0
3293  geqo_pool_size                 | 0
3294  geqo_seed                      | 0
3295  geqo_selection_bias            | 2
3296  geqo_threshold                 | 12
3297  constraint_exclusion           | partition
3298  cursor_tuple_fraction          | 0.1
3299  default_statistics_target      | 100
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_async_append            | on
3318  enable_bitmapscan              | on
3319  enable_gathermerge             | on
3320  enable_hashagg                 | on
3321  enable_hashjoin                | on
3322  enable_incremental_sort        | on
3323  enable_indexonlyscan           | on
3324  enable_indexscan               | on
3325  enable_material                | on
3326  enable_memoize                 | on
3327  enable_mergejoin               | on
3328  enable_nestloop                | on
3329  enable_parallel_append         | on
3330  enable_parallel_hash           | on
3331  enable_partition_pruning       | on
3332  enable_partitionwise_aggregate | off
3333  enable_partitionwise_join      | off
3334  enable_seqscan                 | on
3335  enable_sort                    | on
3336  enable_tidscan                 | on
3337 (48 rows)
3338
3339 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3340 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3341 LOG:  pg_hint_plan:
3342 used hint:
3343 SeqScan(t1)
3344 MergeJoin(t1 t2)
3345 Set(enable_seqscan off)
3346 Set(geqo_threshold 100)
3347 not used hint:
3348 duplication hint:
3349 error hint:
3350
3351              QUERY PLAN             
3352 ------------------------------------
3353  Merge Join
3354    Merge Cond: (t1.c1 = t2.c1)
3355    ->  Sort
3356          Sort Key: t1.c1
3357          ->  Seq Scan on t1
3358    ->  Index Scan using t2_i1 on t2
3359 (6 rows)
3360
3361 -- No. A-12-1-2
3362 -- No. A-12-2-2
3363 SELECT name, setting FROM settings;
3364               name              |  setting  
3365 --------------------------------+-----------
3366  client_min_messages            | log
3367  geqo                           | on
3368  geqo_effort                    | 5
3369  geqo_generations               | 0
3370  geqo_pool_size                 | 0
3371  geqo_seed                      | 0
3372  geqo_selection_bias            | 2
3373  geqo_threshold                 | 12
3374  constraint_exclusion           | partition
3375  cursor_tuple_fraction          | 0.1
3376  default_statistics_target      | 100
3377  from_collapse_limit            | 8
3378  jit                            | on
3379  join_collapse_limit            | 8
3380  plan_cache_mode                | auto
3381  cpu_index_tuple_cost           | 0.005
3382  cpu_operator_cost              | 0.0025
3383  cpu_tuple_cost                 | 0.01
3384  effective_cache_size           | 16384
3385  jit_above_cost                 | 100000
3386  jit_inline_above_cost          | 500000
3387  jit_optimize_above_cost        | 500000
3388  min_parallel_index_scan_size   | 64
3389  min_parallel_table_scan_size   | 1024
3390  parallel_setup_cost            | 1000
3391  parallel_tuple_cost            | 0.1
3392  random_page_cost               | 4
3393  seq_page_cost                  | 1
3394  enable_async_append            | on
3395  enable_bitmapscan              | on
3396  enable_gathermerge             | on
3397  enable_hashagg                 | on
3398  enable_hashjoin                | on
3399  enable_incremental_sort        | on
3400  enable_indexonlyscan           | on
3401  enable_indexscan               | on
3402  enable_material                | on
3403  enable_memoize                 | on
3404  enable_mergejoin               | on
3405  enable_nestloop                | on
3406  enable_parallel_append         | on
3407  enable_parallel_hash           | on
3408  enable_partition_pruning       | on
3409  enable_partitionwise_aggregate | off
3410  enable_partitionwise_join      | off
3411  enable_seqscan                 | on
3412  enable_sort                    | on
3413  enable_tidscan                 | on
3414 (48 rows)
3415
3416 SET pg_hint_plan.parse_messages TO error;
3417 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3418 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3419 ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3420 DETAIL:  Relation name "t1" is duplicated.
3421 SELECT name, setting FROM settings;
3422               name              |  setting  
3423 --------------------------------+-----------
3424  client_min_messages            | log
3425  geqo                           | on
3426  geqo_effort                    | 5
3427  geqo_generations               | 0
3428  geqo_pool_size                 | 0
3429  geqo_seed                      | 0
3430  geqo_selection_bias            | 2
3431  geqo_threshold                 | 12
3432  constraint_exclusion           | partition
3433  cursor_tuple_fraction          | 0.1
3434  default_statistics_target      | 100
3435  from_collapse_limit            | 8
3436  jit                            | on
3437  join_collapse_limit            | 8
3438  plan_cache_mode                | auto
3439  cpu_index_tuple_cost           | 0.005
3440  cpu_operator_cost              | 0.0025
3441  cpu_tuple_cost                 | 0.01
3442  effective_cache_size           | 16384
3443  jit_above_cost                 | 100000
3444  jit_inline_above_cost          | 500000
3445  jit_optimize_above_cost        | 500000
3446  min_parallel_index_scan_size   | 64
3447  min_parallel_table_scan_size   | 1024
3448  parallel_setup_cost            | 1000
3449  parallel_tuple_cost            | 0.1
3450  random_page_cost               | 4
3451  seq_page_cost                  | 1
3452  enable_async_append            | on
3453  enable_bitmapscan              | on
3454  enable_gathermerge             | on
3455  enable_hashagg                 | on
3456  enable_hashjoin                | on
3457  enable_incremental_sort        | on
3458  enable_indexonlyscan           | on
3459  enable_indexscan               | on
3460  enable_material                | on
3461  enable_memoize                 | on
3462  enable_mergejoin               | on
3463  enable_nestloop                | on
3464  enable_parallel_append         | on
3465  enable_parallel_hash           | on
3466  enable_partition_pruning       | on
3467  enable_partitionwise_aggregate | off
3468  enable_partitionwise_join      | off
3469  enable_seqscan                 | on
3470  enable_sort                    | on
3471  enable_tidscan                 | on
3472 (48 rows)
3473
3474 EXPLAIN (COSTS false) EXECUTE p1;
3475              QUERY PLAN             
3476 ------------------------------------
3477  Merge Join
3478    Merge Cond: (t1.c1 = t2.c1)
3479    ->  Sort
3480          Sort Key: t1.c1
3481          ->  Seq Scan on t1
3482    ->  Index Scan using t2_i1 on t2
3483 (6 rows)
3484
3485 -- No. A-12-1-3
3486 -- No. A-12-2-3
3487 SELECT name, setting FROM settings;
3488               name              |  setting  
3489 --------------------------------+-----------
3490  client_min_messages            | log
3491  geqo                           | on
3492  geqo_effort                    | 5
3493  geqo_generations               | 0
3494  geqo_pool_size                 | 0
3495  geqo_seed                      | 0
3496  geqo_selection_bias            | 2
3497  geqo_threshold                 | 12
3498  constraint_exclusion           | partition
3499  cursor_tuple_fraction          | 0.1
3500  default_statistics_target      | 100
3501  from_collapse_limit            | 8
3502  jit                            | on
3503  join_collapse_limit            | 8
3504  plan_cache_mode                | auto
3505  cpu_index_tuple_cost           | 0.005
3506  cpu_operator_cost              | 0.0025
3507  cpu_tuple_cost                 | 0.01
3508  effective_cache_size           | 16384
3509  jit_above_cost                 | 100000
3510  jit_inline_above_cost          | 500000
3511  jit_optimize_above_cost        | 500000
3512  min_parallel_index_scan_size   | 64
3513  min_parallel_table_scan_size   | 1024
3514  parallel_setup_cost            | 1000
3515  parallel_tuple_cost            | 0.1
3516  random_page_cost               | 4
3517  seq_page_cost                  | 1
3518  enable_async_append            | on
3519  enable_bitmapscan              | on
3520  enable_gathermerge             | on
3521  enable_hashagg                 | on
3522  enable_hashjoin                | on
3523  enable_incremental_sort        | on
3524  enable_indexonlyscan           | on
3525  enable_indexscan               | on
3526  enable_material                | on
3527  enable_memoize                 | on
3528  enable_mergejoin               | on
3529  enable_nestloop                | on
3530  enable_parallel_append         | on
3531  enable_parallel_hash           | on
3532  enable_partition_pruning       | on
3533  enable_partitionwise_aggregate | off
3534  enable_partitionwise_join      | off
3535  enable_seqscan                 | on
3536  enable_sort                    | on
3537  enable_tidscan                 | on
3538 (48 rows)
3539
3540 SET pg_hint_plan.parse_messages TO error;
3541 EXPLAIN (COSTS false) EXECUTE p2;
3542 ERROR:  prepared statement "p2" does not exist
3543 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3544 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3545 LOG:  pg_hint_plan:
3546 used hint:
3547 SeqScan(t1)
3548 MergeJoin(t1 t2)
3549 Set(enable_seqscan off)
3550 Set(geqo_threshold 100)
3551 not used hint:
3552 duplication hint:
3553 error hint:
3554
3555              QUERY PLAN             
3556 ------------------------------------
3557  Merge Join
3558    Merge Cond: (t1.c1 = t2.c1)
3559    ->  Sort
3560          Sort Key: t1.c1
3561          ->  Seq Scan on t1
3562    ->  Index Scan using t2_i1 on t2
3563 (6 rows)
3564
3565 EXPLAIN (COSTS false) EXECUTE p1;
3566              QUERY PLAN             
3567 ------------------------------------
3568  Merge Join
3569    Merge Cond: (t1.c1 = t2.c1)
3570    ->  Sort
3571          Sort Key: t1.c1
3572          ->  Seq Scan on t1
3573    ->  Index Scan using t2_i1 on t2
3574 (6 rows)
3575
3576 SELECT name, setting FROM settings;
3577               name              |  setting  
3578 --------------------------------+-----------
3579  client_min_messages            | log
3580  geqo                           | on
3581  geqo_effort                    | 5
3582  geqo_generations               | 0
3583  geqo_pool_size                 | 0
3584  geqo_seed                      | 0
3585  geqo_selection_bias            | 2
3586  geqo_threshold                 | 12
3587  constraint_exclusion           | partition
3588  cursor_tuple_fraction          | 0.1
3589  default_statistics_target      | 100
3590  from_collapse_limit            | 8
3591  jit                            | on
3592  join_collapse_limit            | 8
3593  plan_cache_mode                | auto
3594  cpu_index_tuple_cost           | 0.005
3595  cpu_operator_cost              | 0.0025
3596  cpu_tuple_cost                 | 0.01
3597  effective_cache_size           | 16384
3598  jit_above_cost                 | 100000
3599  jit_inline_above_cost          | 500000
3600  jit_optimize_above_cost        | 500000
3601  min_parallel_index_scan_size   | 64
3602  min_parallel_table_scan_size   | 1024
3603  parallel_setup_cost            | 1000
3604  parallel_tuple_cost            | 0.1
3605  random_page_cost               | 4
3606  seq_page_cost                  | 1
3607  enable_async_append            | on
3608  enable_bitmapscan              | on
3609  enable_gathermerge             | on
3610  enable_hashagg                 | on
3611  enable_hashjoin                | on
3612  enable_incremental_sort        | on
3613  enable_indexonlyscan           | on
3614  enable_indexscan               | on
3615  enable_material                | on
3616  enable_memoize                 | on
3617  enable_mergejoin               | on
3618  enable_nestloop                | on
3619  enable_parallel_append         | on
3620  enable_parallel_hash           | on
3621  enable_partition_pruning       | on
3622  enable_partitionwise_aggregate | off
3623  enable_partitionwise_join      | off
3624  enable_seqscan                 | on
3625  enable_sort                    | on
3626  enable_tidscan                 | on
3627 (48 rows)
3628
3629 -- No. A-12-1-4
3630 -- No. A-12-2-4
3631 SELECT name, setting FROM settings;
3632               name              |  setting  
3633 --------------------------------+-----------
3634  client_min_messages            | log
3635  geqo                           | on
3636  geqo_effort                    | 5
3637  geqo_generations               | 0
3638  geqo_pool_size                 | 0
3639  geqo_seed                      | 0
3640  geqo_selection_bias            | 2
3641  geqo_threshold                 | 12
3642  constraint_exclusion           | partition
3643  cursor_tuple_fraction          | 0.1
3644  default_statistics_target      | 100
3645  from_collapse_limit            | 8
3646  jit                            | on
3647  join_collapse_limit            | 8
3648  plan_cache_mode                | auto
3649  cpu_index_tuple_cost           | 0.005
3650  cpu_operator_cost              | 0.0025
3651  cpu_tuple_cost                 | 0.01
3652  effective_cache_size           | 16384
3653  jit_above_cost                 | 100000
3654  jit_inline_above_cost          | 500000
3655  jit_optimize_above_cost        | 500000
3656  min_parallel_index_scan_size   | 64
3657  min_parallel_table_scan_size   | 1024
3658  parallel_setup_cost            | 1000
3659  parallel_tuple_cost            | 0.1
3660  random_page_cost               | 4
3661  seq_page_cost                  | 1
3662  enable_async_append            | on
3663  enable_bitmapscan              | on
3664  enable_gathermerge             | on
3665  enable_hashagg                 | on
3666  enable_hashjoin                | on
3667  enable_incremental_sort        | on
3668  enable_indexonlyscan           | on
3669  enable_indexscan               | on
3670  enable_material                | on
3671  enable_memoize                 | on
3672  enable_mergejoin               | on
3673  enable_nestloop                | on
3674  enable_parallel_append         | on
3675  enable_parallel_hash           | on
3676  enable_partition_pruning       | on
3677  enable_partitionwise_aggregate | off
3678  enable_partitionwise_join      | off
3679  enable_seqscan                 | on
3680  enable_sort                    | on
3681  enable_tidscan                 | on
3682 (48 rows)
3683
3684 SET pg_hint_plan.parse_messages TO error;
3685 EXPLAIN (COSTS false) EXECUTE p2;
3686 ERROR:  prepared statement "p2" does not exist
3687 EXPLAIN (COSTS false) EXECUTE p1;
3688              QUERY PLAN             
3689 ------------------------------------
3690  Merge Join
3691    Merge Cond: (t1.c1 = t2.c1)
3692    ->  Sort
3693          Sort Key: t1.c1
3694          ->  Seq Scan on t1
3695    ->  Index Scan using t2_i1 on t2
3696 (6 rows)
3697
3698 SELECT name, setting FROM settings;
3699               name              |  setting  
3700 --------------------------------+-----------
3701  client_min_messages            | log
3702  geqo                           | on
3703  geqo_effort                    | 5
3704  geqo_generations               | 0
3705  geqo_pool_size                 | 0
3706  geqo_seed                      | 0
3707  geqo_selection_bias            | 2
3708  geqo_threshold                 | 12
3709  constraint_exclusion           | partition
3710  cursor_tuple_fraction          | 0.1
3711  default_statistics_target      | 100
3712  from_collapse_limit            | 8
3713  jit                            | on
3714  join_collapse_limit            | 8
3715  plan_cache_mode                | auto
3716  cpu_index_tuple_cost           | 0.005
3717  cpu_operator_cost              | 0.0025
3718  cpu_tuple_cost                 | 0.01
3719  effective_cache_size           | 16384
3720  jit_above_cost                 | 100000
3721  jit_inline_above_cost          | 500000
3722  jit_optimize_above_cost        | 500000
3723  min_parallel_index_scan_size   | 64
3724  min_parallel_table_scan_size   | 1024
3725  parallel_setup_cost            | 1000
3726  parallel_tuple_cost            | 0.1
3727  random_page_cost               | 4
3728  seq_page_cost                  | 1
3729  enable_async_append            | on
3730  enable_bitmapscan              | on
3731  enable_gathermerge             | on
3732  enable_hashagg                 | on
3733  enable_hashjoin                | on
3734  enable_incremental_sort        | on
3735  enable_indexonlyscan           | on
3736  enable_indexscan               | on
3737  enable_material                | on
3738  enable_memoize                 | on
3739  enable_mergejoin               | on
3740  enable_nestloop                | on
3741  enable_parallel_append         | on
3742  enable_parallel_hash           | on
3743  enable_partition_pruning       | on
3744  enable_partitionwise_aggregate | off
3745  enable_partitionwise_join      | off
3746  enable_seqscan                 | on
3747  enable_sort                    | on
3748  enable_tidscan                 | on
3749 (48 rows)
3750
3751 DEALLOCATE p1;
3752 SET pg_hint_plan.parse_messages TO LOG;
3753 ----
3754 ---- No. A-12-3 effective range of the hint
3755 ----
3756 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3757              QUERY PLAN             
3758 ------------------------------------
3759  Merge Join
3760    Merge Cond: (t1.c1 = t2.c1)
3761    ->  Index Scan using t1_i1 on t1
3762    ->  Sort
3763          Sort Key: t2.c1
3764          ->  Seq Scan on t2
3765 (6 rows)
3766
3767 -- No. A-12-3-1
3768 SET enable_indexscan TO off;
3769 SET enable_mergejoin TO off;
3770 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3771           QUERY PLAN          
3772 ------------------------------
3773  Hash Join
3774    Hash Cond: (t1.c1 = t2.c1)
3775    ->  Seq Scan on t1
3776    ->  Hash
3777          ->  Seq Scan on t2
3778 (5 rows)
3779
3780 SELECT name, setting FROM settings;
3781               name              |  setting  
3782 --------------------------------+-----------
3783  client_min_messages            | log
3784  geqo                           | on
3785  geqo_effort                    | 5
3786  geqo_generations               | 0
3787  geqo_pool_size                 | 0
3788  geqo_seed                      | 0
3789  geqo_selection_bias            | 2
3790  geqo_threshold                 | 12
3791  constraint_exclusion           | partition
3792  cursor_tuple_fraction          | 0.1
3793  default_statistics_target      | 100
3794  from_collapse_limit            | 8
3795  jit                            | on
3796  join_collapse_limit            | 8
3797  plan_cache_mode                | auto
3798  cpu_index_tuple_cost           | 0.005
3799  cpu_operator_cost              | 0.0025
3800  cpu_tuple_cost                 | 0.01
3801  effective_cache_size           | 16384
3802  jit_above_cost                 | 100000
3803  jit_inline_above_cost          | 500000
3804  jit_optimize_above_cost        | 500000
3805  min_parallel_index_scan_size   | 64
3806  min_parallel_table_scan_size   | 1024
3807  parallel_setup_cost            | 1000
3808  parallel_tuple_cost            | 0.1
3809  random_page_cost               | 4
3810  seq_page_cost                  | 1
3811  enable_async_append            | on
3812  enable_bitmapscan              | on
3813  enable_gathermerge             | on
3814  enable_hashagg                 | on
3815  enable_hashjoin                | on
3816  enable_incremental_sort        | on
3817  enable_indexonlyscan           | on
3818  enable_indexscan               | off
3819  enable_material                | on
3820  enable_memoize                 | on
3821  enable_mergejoin               | off
3822  enable_nestloop                | on
3823  enable_parallel_append         | on
3824  enable_parallel_hash           | on
3825  enable_partition_pruning       | on
3826  enable_partitionwise_aggregate | off
3827  enable_partitionwise_join      | off
3828  enable_seqscan                 | on
3829  enable_sort                    | on
3830  enable_tidscan                 | on
3831 (48 rows)
3832
3833 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3834 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3835 LOG:  pg_hint_plan:
3836 used hint:
3837 IndexScan(t2)
3838 MergeJoin(t1 t2)
3839 Leading(t2 t1)
3840 Set(enable_indexscan on)
3841 Set(geqo_threshold 100)
3842 not used hint:
3843 duplication hint:
3844 error hint:
3845
3846              QUERY PLAN             
3847 ------------------------------------
3848  Merge Join
3849    Merge Cond: (t1.c1 = t2.c1)
3850    ->  Index Scan using t1_i1 on t1
3851    ->  Index Scan using t2_i1 on t2
3852 (4 rows)
3853
3854 SELECT name, setting FROM settings;
3855               name              |  setting  
3856 --------------------------------+-----------
3857  client_min_messages            | log
3858  geqo                           | on
3859  geqo_effort                    | 5
3860  geqo_generations               | 0
3861  geqo_pool_size                 | 0
3862  geqo_seed                      | 0
3863  geqo_selection_bias            | 2
3864  geqo_threshold                 | 12
3865  constraint_exclusion           | partition
3866  cursor_tuple_fraction          | 0.1
3867  default_statistics_target      | 100
3868  from_collapse_limit            | 8
3869  jit                            | on
3870  join_collapse_limit            | 8
3871  plan_cache_mode                | auto
3872  cpu_index_tuple_cost           | 0.005
3873  cpu_operator_cost              | 0.0025
3874  cpu_tuple_cost                 | 0.01
3875  effective_cache_size           | 16384
3876  jit_above_cost                 | 100000
3877  jit_inline_above_cost          | 500000
3878  jit_optimize_above_cost        | 500000
3879  min_parallel_index_scan_size   | 64
3880  min_parallel_table_scan_size   | 1024
3881  parallel_setup_cost            | 1000
3882  parallel_tuple_cost            | 0.1
3883  random_page_cost               | 4
3884  seq_page_cost                  | 1
3885  enable_async_append            | on
3886  enable_bitmapscan              | on
3887  enable_gathermerge             | on
3888  enable_hashagg                 | on
3889  enable_hashjoin                | on
3890  enable_incremental_sort        | on
3891  enable_indexonlyscan           | on
3892  enable_indexscan               | off
3893  enable_material                | on
3894  enable_memoize                 | on
3895  enable_mergejoin               | off
3896  enable_nestloop                | on
3897  enable_parallel_append         | on
3898  enable_parallel_hash           | on
3899  enable_partition_pruning       | on
3900  enable_partitionwise_aggregate | off
3901  enable_partitionwise_join      | off
3902  enable_seqscan                 | on
3903  enable_sort                    | on
3904  enable_tidscan                 | on
3905 (48 rows)
3906
3907 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3908           QUERY PLAN          
3909 ------------------------------
3910  Hash Join
3911    Hash Cond: (t1.c1 = t2.c1)
3912    ->  Seq Scan on t1
3913    ->  Hash
3914          ->  Seq Scan on t2
3915 (5 rows)
3916
3917 -- No. A-12-3-2
3918 SET enable_indexscan TO off;
3919 SET enable_mergejoin TO off;
3920 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3921           QUERY PLAN          
3922 ------------------------------
3923  Hash Join
3924    Hash Cond: (t1.c1 = t2.c1)
3925    ->  Seq Scan on t1
3926    ->  Hash
3927          ->  Seq Scan on t2
3928 (5 rows)
3929
3930 SELECT name, setting FROM settings;
3931               name              |  setting  
3932 --------------------------------+-----------
3933  client_min_messages            | log
3934  geqo                           | on
3935  geqo_effort                    | 5
3936  geqo_generations               | 0
3937  geqo_pool_size                 | 0
3938  geqo_seed                      | 0
3939  geqo_selection_bias            | 2
3940  geqo_threshold                 | 12
3941  constraint_exclusion           | partition
3942  cursor_tuple_fraction          | 0.1
3943  default_statistics_target      | 100
3944  from_collapse_limit            | 8
3945  jit                            | on
3946  join_collapse_limit            | 8
3947  plan_cache_mode                | auto
3948  cpu_index_tuple_cost           | 0.005
3949  cpu_operator_cost              | 0.0025
3950  cpu_tuple_cost                 | 0.01
3951  effective_cache_size           | 16384
3952  jit_above_cost                 | 100000
3953  jit_inline_above_cost          | 500000
3954  jit_optimize_above_cost        | 500000
3955  min_parallel_index_scan_size   | 64
3956  min_parallel_table_scan_size   | 1024
3957  parallel_setup_cost            | 1000
3958  parallel_tuple_cost            | 0.1
3959  random_page_cost               | 4
3960  seq_page_cost                  | 1
3961  enable_async_append            | on
3962  enable_bitmapscan              | on
3963  enable_gathermerge             | on
3964  enable_hashagg                 | on
3965  enable_hashjoin                | on
3966  enable_incremental_sort        | on
3967  enable_indexonlyscan           | on
3968  enable_indexscan               | off
3969  enable_material                | on
3970  enable_memoize                 | on
3971  enable_mergejoin               | off
3972  enable_nestloop                | on
3973  enable_parallel_append         | on
3974  enable_parallel_hash           | on
3975  enable_partition_pruning       | on
3976  enable_partitionwise_aggregate | off
3977  enable_partitionwise_join      | off
3978  enable_seqscan                 | on
3979  enable_sort                    | on
3980  enable_tidscan                 | on
3981 (48 rows)
3982
3983 BEGIN;
3984 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3985 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3986 LOG:  pg_hint_plan:
3987 used hint:
3988 IndexScan(t2)
3989 MergeJoin(t1 t2)
3990 Leading(t2 t1)
3991 Set(enable_indexscan on)
3992 Set(geqo_threshold 100)
3993 not used hint:
3994 duplication hint:
3995 error hint:
3996
3997              QUERY PLAN             
3998 ------------------------------------
3999  Merge Join
4000    Merge Cond: (t1.c1 = t2.c1)
4001    ->  Index Scan using t1_i1 on t1
4002    ->  Index Scan using t2_i1 on t2
4003 (4 rows)
4004
4005 COMMIT;
4006 BEGIN;
4007 SELECT name, setting FROM settings;
4008               name              |  setting  
4009 --------------------------------+-----------
4010  client_min_messages            | log
4011  geqo                           | on
4012  geqo_effort                    | 5
4013  geqo_generations               | 0
4014  geqo_pool_size                 | 0
4015  geqo_seed                      | 0
4016  geqo_selection_bias            | 2
4017  geqo_threshold                 | 12
4018  constraint_exclusion           | partition
4019  cursor_tuple_fraction          | 0.1
4020  default_statistics_target      | 100
4021  from_collapse_limit            | 8
4022  jit                            | on
4023  join_collapse_limit            | 8
4024  plan_cache_mode                | auto
4025  cpu_index_tuple_cost           | 0.005
4026  cpu_operator_cost              | 0.0025
4027  cpu_tuple_cost                 | 0.01
4028  effective_cache_size           | 16384
4029  jit_above_cost                 | 100000
4030  jit_inline_above_cost          | 500000
4031  jit_optimize_above_cost        | 500000
4032  min_parallel_index_scan_size   | 64
4033  min_parallel_table_scan_size   | 1024
4034  parallel_setup_cost            | 1000
4035  parallel_tuple_cost            | 0.1
4036  random_page_cost               | 4
4037  seq_page_cost                  | 1
4038  enable_async_append            | on
4039  enable_bitmapscan              | on
4040  enable_gathermerge             | on
4041  enable_hashagg                 | on
4042  enable_hashjoin                | on
4043  enable_incremental_sort        | on
4044  enable_indexonlyscan           | on
4045  enable_indexscan               | off
4046  enable_material                | on
4047  enable_memoize                 | on
4048  enable_mergejoin               | off
4049  enable_nestloop                | on
4050  enable_parallel_append         | on
4051  enable_parallel_hash           | on
4052  enable_partition_pruning       | on
4053  enable_partitionwise_aggregate | off
4054  enable_partitionwise_join      | off
4055  enable_seqscan                 | on
4056  enable_sort                    | on
4057  enable_tidscan                 | on
4058 (48 rows)
4059
4060 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4061           QUERY PLAN          
4062 ------------------------------
4063  Hash Join
4064    Hash Cond: (t1.c1 = t2.c1)
4065    ->  Seq Scan on t1
4066    ->  Hash
4067          ->  Seq Scan on t2
4068 (5 rows)
4069
4070 COMMIT;
4071 -- No. A-12-3-3
4072 SET enable_indexscan TO off;
4073 SET enable_mergejoin TO off;
4074 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4075           QUERY PLAN          
4076 ------------------------------
4077  Hash Join
4078    Hash Cond: (t1.c1 = t2.c1)
4079    ->  Seq Scan on t1
4080    ->  Hash
4081          ->  Seq Scan on t2
4082 (5 rows)
4083
4084 SELECT name, setting FROM settings;
4085               name              |  setting  
4086 --------------------------------+-----------
4087  client_min_messages            | log
4088  geqo                           | on
4089  geqo_effort                    | 5
4090  geqo_generations               | 0
4091  geqo_pool_size                 | 0
4092  geqo_seed                      | 0
4093  geqo_selection_bias            | 2
4094  geqo_threshold                 | 12
4095  constraint_exclusion           | partition
4096  cursor_tuple_fraction          | 0.1
4097  default_statistics_target      | 100
4098  from_collapse_limit            | 8
4099  jit                            | on
4100  join_collapse_limit            | 8
4101  plan_cache_mode                | auto
4102  cpu_index_tuple_cost           | 0.005
4103  cpu_operator_cost              | 0.0025
4104  cpu_tuple_cost                 | 0.01
4105  effective_cache_size           | 16384
4106  jit_above_cost                 | 100000
4107  jit_inline_above_cost          | 500000
4108  jit_optimize_above_cost        | 500000
4109  min_parallel_index_scan_size   | 64
4110  min_parallel_table_scan_size   | 1024
4111  parallel_setup_cost            | 1000
4112  parallel_tuple_cost            | 0.1
4113  random_page_cost               | 4
4114  seq_page_cost                  | 1
4115  enable_async_append            | on
4116  enable_bitmapscan              | on
4117  enable_gathermerge             | on
4118  enable_hashagg                 | on
4119  enable_hashjoin                | on
4120  enable_incremental_sort        | on
4121  enable_indexonlyscan           | on
4122  enable_indexscan               | off
4123  enable_material                | on
4124  enable_memoize                 | on
4125  enable_mergejoin               | off
4126  enable_nestloop                | on
4127  enable_parallel_append         | on
4128  enable_parallel_hash           | on
4129  enable_partition_pruning       | on
4130  enable_partitionwise_aggregate | off
4131  enable_partitionwise_join      | off
4132  enable_seqscan                 | on
4133  enable_sort                    | on
4134  enable_tidscan                 | on
4135 (48 rows)
4136
4137 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
4138 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4139 LOG:  pg_hint_plan:
4140 used hint:
4141 IndexScan(t2)
4142 MergeJoin(t1 t2)
4143 Leading(t2 t1)
4144 Set(enable_indexscan on)
4145 Set(geqo_threshold 100)
4146 not used hint:
4147 duplication hint:
4148 error hint:
4149
4150              QUERY PLAN             
4151 ------------------------------------
4152  Merge Join
4153    Merge Cond: (t1.c1 = t2.c1)
4154    ->  Index Scan using t1_i1 on t1
4155    ->  Index Scan using t2_i1 on t2
4156 (4 rows)
4157
4158 \connect
4159 SET enable_indexscan TO off;
4160 SET enable_mergejoin TO off;
4161 LOAD 'pg_hint_plan';
4162 SELECT name, setting FROM settings;
4163               name              |  setting  
4164 --------------------------------+-----------
4165  client_min_messages            | notice
4166  geqo                           | on
4167  geqo_effort                    | 5
4168  geqo_generations               | 0
4169  geqo_pool_size                 | 0
4170  geqo_seed                      | 0
4171  geqo_selection_bias            | 2
4172  geqo_threshold                 | 12
4173  constraint_exclusion           | partition
4174  cursor_tuple_fraction          | 0.1
4175  default_statistics_target      | 100
4176  from_collapse_limit            | 8
4177  jit                            | on
4178  join_collapse_limit            | 8
4179  plan_cache_mode                | auto
4180  cpu_index_tuple_cost           | 0.005
4181  cpu_operator_cost              | 0.0025
4182  cpu_tuple_cost                 | 0.01
4183  effective_cache_size           | 16384
4184  jit_above_cost                 | 100000
4185  jit_inline_above_cost          | 500000
4186  jit_optimize_above_cost        | 500000
4187  min_parallel_index_scan_size   | 64
4188  min_parallel_table_scan_size   | 1024
4189  parallel_setup_cost            | 1000
4190  parallel_tuple_cost            | 0.1
4191  random_page_cost               | 4
4192  seq_page_cost                  | 1
4193  enable_async_append            | on
4194  enable_bitmapscan              | on
4195  enable_gathermerge             | on
4196  enable_hashagg                 | on
4197  enable_hashjoin                | on
4198  enable_incremental_sort        | on
4199  enable_indexonlyscan           | on
4200  enable_indexscan               | off
4201  enable_material                | on
4202  enable_memoize                 | on
4203  enable_mergejoin               | off
4204  enable_nestloop                | on
4205  enable_parallel_append         | on
4206  enable_parallel_hash           | on
4207  enable_partition_pruning       | on
4208  enable_partitionwise_aggregate | off
4209  enable_partitionwise_join      | off
4210  enable_seqscan                 | on
4211  enable_sort                    | on
4212  enable_tidscan                 | on
4213 (48 rows)
4214
4215 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4216           QUERY PLAN          
4217 ------------------------------
4218  Hash Join
4219    Hash Cond: (t1.c1 = t2.c1)
4220    ->  Seq Scan on t1
4221    ->  Hash
4222          ->  Seq Scan on t2
4223 (5 rows)
4224
4225 SET pg_hint_plan.enable_hint TO on;
4226 SET pg_hint_plan.debug_print TO on;
4227 SET client_min_messages TO LOG;
4228 SET search_path TO public;
4229 RESET enable_indexscan;
4230 RESET enable_mergejoin;
4231 ----
4232 ---- No. A-13 call planner recursively
4233 ----
4234 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4235 DECLARE
4236     new_cnt int;
4237 BEGIN
4238     RAISE NOTICE 'nested_planner(%)', cnt;
4239
4240     /* 再帰終了の判断 */
4241     IF cnt <= 1 THEN
4242         RETURN 0;
4243     END IF;
4244
4245         SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4246           FROM s1.t1 t_1
4247           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4248          ORDER BY t_1.c1 LIMIT 1;
4249
4250     RETURN new_cnt;
4251 END;
4252 $$ LANGUAGE plpgsql IMMUTABLE;
4253 ----
4254 ---- No. A-13-2 use hint of main query
4255 ----
4256 --No.13-2-1
4257 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4258 NOTICE:  nested_planner(1)
4259               QUERY PLAN               
4260 ---------------------------------------
4261  Index Only Scan using t1_i1 on t1 t_1
4262 (1 row)
4263
4264 /*+SeqScan(t_1)*/
4265 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4266 NOTICE:  nested_planner(1)
4267 LOG:  pg_hint_plan:
4268 used hint:
4269 SeqScan(t_1)
4270 not used hint:
4271 duplication hint:
4272 error hint:
4273
4274         QUERY PLAN        
4275 --------------------------
4276  Sort
4277    Sort Key: c1
4278    ->  Seq Scan on t1 t_1
4279 (3 rows)
4280
4281 ----
4282 ---- No. A-13-3 output number of times of debugging log
4283 ----
4284 --No.13-3-1
4285 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4286 NOTICE:  nested_planner(1)
4287               QUERY PLAN               
4288 ---------------------------------------
4289  Index Only Scan using t1_i1 on t1 t_1
4290 (1 row)
4291
4292 /*+SeqScan(t_2)*/
4293 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4294 NOTICE:  nested_planner(1)
4295 LOG:  pg_hint_plan:
4296 used hint:
4297 not used hint:
4298 SeqScan(t_2)
4299 duplication hint:
4300 error hint:
4301
4302               QUERY PLAN               
4303 ---------------------------------------
4304  Index Only Scan using t1_i1 on t1 t_1
4305 (1 row)
4306
4307 --No.13-3-2
4308 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4309 NOTICE:  nested_planner(2)
4310 NOTICE:  nested_planner(1)
4311 LOG:  pg_hint_plan:
4312 used hint:
4313 IndexScan(t_1)
4314 not used hint:
4315 duplication hint:
4316 error hint:
4317
4318               QUERY PLAN               
4319 ---------------------------------------
4320  Index Only Scan using t1_i1 on t1 t_1
4321 (1 row)
4322
4323 /*+SeqScan(t_2)*/
4324 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4325 NOTICE:  nested_planner(2)
4326 NOTICE:  nested_planner(1)
4327 LOG:  pg_hint_plan:
4328 used hint:
4329 IndexScan(t_1)
4330 not used hint:
4331 duplication hint:
4332 error hint:
4333
4334 LOG:  pg_hint_plan:
4335 used hint:
4336 not used hint:
4337 SeqScan(t_2)
4338 duplication hint:
4339 error hint:
4340
4341               QUERY PLAN               
4342 ---------------------------------------
4343  Index Only Scan using t1_i1 on t1 t_1
4344 (1 row)
4345
4346 --No.13-3-3
4347 --
4348 -- Redefine not to use cached plan
4349 --
4350 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4351 DECLARE
4352     new_cnt int;
4353 BEGIN
4354     RAISE NOTICE 'nested_planner(%)', cnt;
4355
4356     /* 再帰終了の判断 */
4357     IF cnt <= 1 THEN
4358         RETURN 0;
4359     END IF;
4360
4361         SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4362           FROM s1.t1 t_1
4363           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4364          ORDER BY t_1.c1 LIMIT 1;
4365
4366     RETURN new_cnt;
4367 END;
4368 $$ LANGUAGE plpgsql IMMUTABLE;
4369 -- The function called at the bottom desn't use a hint, the immediate
4370 -- caller level should restore its own hint. So, the first LOG from
4371 -- pg_hint_plan should use the IndexScan(t_1) hint
4372 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4373 NOTICE:  nested_planner(5)
4374 NOTICE:  nested_planner(4)
4375 NOTICE:  nested_planner(3)
4376 NOTICE:  nested_planner(2)
4377 NOTICE:  nested_planner(1)
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 LOG:  pg_hint_plan:
4393 used hint:
4394 IndexScan(t_1)
4395 not used hint:
4396 duplication hint:
4397 error hint:
4398
4399 LOG:  pg_hint_plan:
4400 used hint:
4401 IndexScan(t_1)
4402 not used hint:
4403 duplication hint:
4404 error hint:
4405
4406               QUERY PLAN               
4407 ---------------------------------------
4408  Index Only Scan using t1_i1 on t1 t_1
4409 (1 row)
4410
4411 -- The top level uses SeqScan(t_1), but the function should use only
4412 -- the hint in the function.
4413 /*+SeqScan(t_1) SeqScan(t_2)*/
4414 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4415 NOTICE:  nested_planner(5)
4416 NOTICE:  nested_planner(4)
4417 NOTICE:  nested_planner(3)
4418 NOTICE:  nested_planner(2)
4419 NOTICE:  nested_planner(1)
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 IndexScan(t_1)
4437 not used hint:
4438 duplication hint:
4439 error hint:
4440
4441 LOG:  pg_hint_plan:
4442 used hint:
4443 IndexScan(t_1)
4444 not used hint:
4445 duplication hint:
4446 error hint:
4447
4448 LOG:  pg_hint_plan:
4449 used hint:
4450 SeqScan(t_1)
4451 not used hint:
4452 SeqScan(t_2)
4453 duplication hint:
4454 error hint:
4455
4456         QUERY PLAN        
4457 --------------------------
4458  Sort
4459    Sort Key: c1
4460    ->  Seq Scan on t1 t_1
4461 (3 rows)
4462
4463 ----
4464 ---- No. A-13-4 output of debugging log on hint status
4465 ----
4466 CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
4467         SELECT /*+ IndexScan(t_1) */t_1.c1
4468           FROM s1.t1 t_1
4469           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4470          ORDER BY t_1.c1 LIMIT 1;
4471 $$ LANGUAGE SQL IMMUTABLE;
4472 --No.13-4-1
4473 -- recall_planner() is reduced to constant while planning using the
4474 -- hint defined in the function. Then the outer query is planned based
4475 -- on the following hint. pg_hint_plan shows the log for the function
4476 -- but the resulting explain output doesn't contain the corresponding
4477 -- plan.
4478 /*+HashJoin(t_1 t_2)*/
4479 EXPLAIN (COSTS false)
4480  SELECT recall_planner() FROM s1.t1 t_1
4481    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4482   ORDER BY t_1.c1;
4483 LOG:  pg_hint_plan:
4484 used hint:
4485 IndexScan(t_1)
4486 not used hint:
4487 duplication hint:
4488 error hint:
4489
4490 LOG:  pg_hint_plan:
4491 used hint:
4492 HashJoin(t_1 t_2)
4493 not used hint:
4494 duplication hint:
4495 error hint:
4496
4497               QUERY PLAN              
4498 --------------------------------------
4499  Sort
4500    Sort Key: t_1.c1
4501    ->  Hash Join
4502          Hash Cond: (t_1.c1 = t_2.c1)
4503          ->  Seq Scan on t1 t_1
4504          ->  Hash
4505                ->  Seq Scan on t2 t_2
4506 (7 rows)
4507
4508 --No.13-4-2
4509 --See description for No.13-4-1
4510 /*+HashJoin(st_1 st_2)*/
4511 EXPLAIN (COSTS false)
4512  SELECT recall_planner() FROM s1.t1 st_1
4513    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4514   ORDER BY st_1.c1;
4515 LOG:  pg_hint_plan:
4516 used hint:
4517 IndexScan(t_1)
4518 not used hint:
4519 duplication hint:
4520 error hint:
4521
4522 LOG:  pg_hint_plan:
4523 used hint:
4524 HashJoin(st_1 st_2)
4525 not used hint:
4526 duplication hint:
4527 error hint:
4528
4529                QUERY PLAN               
4530 ----------------------------------------
4531  Sort
4532    Sort Key: st_1.c1
4533    ->  Hash Join
4534          Hash Cond: (st_1.c1 = st_2.c1)
4535          ->  Seq Scan on t1 st_1
4536          ->  Hash
4537                ->  Seq Scan on t2 st_2
4538 (7 rows)
4539
4540 --No.13-4-3
4541 --See description for No.13-4-1
4542 /*+HashJoin(t_1 t_2)*/
4543 EXPLAIN (COSTS false)
4544  SELECT recall_planner() FROM s1.t1 st_1
4545    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4546   ORDER BY st_1.c1;
4547 LOG:  pg_hint_plan:
4548 used hint:
4549 IndexScan(t_1)
4550 not used hint:
4551 duplication hint:
4552 error hint:
4553
4554 LOG:  pg_hint_plan:
4555 used hint:
4556 not used hint:
4557 HashJoin(t_1 t_2)
4558 duplication hint:
4559 error hint:
4560
4561                   QUERY PLAN                  
4562 ----------------------------------------------
4563  Merge Join
4564    Merge Cond: (st_1.c1 = st_2.c1)
4565    ->  Index Only Scan using t1_i1 on t1 st_1
4566    ->  Sort
4567          Sort Key: st_2.c1
4568          ->  Seq Scan on t2 st_2
4569 (6 rows)
4570
4571 --No.13-4-4
4572 --See description for No.13-4-1
4573 /*+HashJoin(st_1 st_2)*/
4574 EXPLAIN (COSTS false)
4575  SELECT recall_planner() FROM s1.t1 t_1
4576    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4577   ORDER BY t_1.c1;
4578 LOG:  pg_hint_plan:
4579 used hint:
4580 IndexScan(t_1)
4581 not used hint:
4582 duplication hint:
4583 error hint:
4584
4585 LOG:  pg_hint_plan:
4586 used hint:
4587 not used hint:
4588 HashJoin(st_1 st_2)
4589 duplication hint:
4590 error hint:
4591
4592                  QUERY PLAN                  
4593 ---------------------------------------------
4594  Merge Join
4595    Merge Cond: (t_1.c1 = t_2.c1)
4596    ->  Index Only Scan using t1_i1 on t1 t_1
4597    ->  Sort
4598          Sort Key: t_2.c1
4599          ->  Seq Scan on t2 t_2
4600 (6 rows)
4601
4602 --No.13-4-5
4603 -- See description for No.13-4-1. No joins in ths plan, so
4604 -- pg_hint_plan doesn't complain on the wrongly written error hint.
4605 /*+HashJoin(t_1 t_1)*/
4606 EXPLAIN (COSTS false)
4607  SELECT recall_planner() FROM s1.t1 t_1
4608   ORDER BY t_1.c1;
4609 LOG:  pg_hint_plan:
4610 used hint:
4611 IndexScan(t_1)
4612 not used hint:
4613 duplication hint:
4614 error hint:
4615
4616 LOG:  pg_hint_plan:
4617 used hint:
4618 not used hint:
4619 HashJoin(t_1 t_1)
4620 duplication hint:
4621 error hint:
4622
4623               QUERY PLAN               
4624 ---------------------------------------
4625  Index Only Scan using t1_i1 on t1 t_1
4626 (1 row)
4627
4628 --No.13-4-6
4629 CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
4630         SELECT /*+ IndexScan(t_1) */t_1.c1
4631           FROM s1.t1 t_1
4632          ORDER BY t_1.c1 LIMIT 1;
4633 $$ LANGUAGE SQL IMMUTABLE;
4634 EXPLAIN (COSTS false)
4635  SELECT recall_planner_one_t() FROM s1.t1 t_1
4636    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4637   ORDER BY t_1.c1;
4638 LOG:  pg_hint_plan:
4639 used hint:
4640 IndexScan(t_1)
4641 not used hint:
4642 duplication hint:
4643 error hint:
4644
4645                  QUERY PLAN                  
4646 ---------------------------------------------
4647  Merge Join
4648    Merge Cond: (t_1.c1 = t_2.c1)
4649    ->  Index Only Scan using t1_i1 on t1 t_1
4650    ->  Sort
4651          Sort Key: t_2.c1
4652          ->  Seq Scan on t2 t_2
4653 (6 rows)
4654
4655 /*+HashJoin(t_1 t_1)*/
4656 EXPLAIN (COSTS false)
4657  SELECT recall_planner_one_t() FROM s1.t1 t_1
4658    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4659   ORDER BY t_1.c1;
4660 LOG:  pg_hint_plan:
4661 used hint:
4662 IndexScan(t_1)
4663 not used hint:
4664 duplication hint:
4665 error hint:
4666
4667 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4668 DETAIL:  Relation name "t_1" is duplicated.
4669 LOG:  pg_hint_plan:
4670 used hint:
4671 not used hint:
4672 duplication hint:
4673 error hint:
4674 HashJoin(t_1 t_1)
4675
4676                  QUERY PLAN                  
4677 ---------------------------------------------
4678  Merge Join
4679    Merge Cond: (t_1.c1 = t_2.c1)
4680    ->  Index Only Scan using t1_i1 on t1 t_1
4681    ->  Sort
4682          Sort Key: t_2.c1
4683          ->  Seq Scan on t2 t_2
4684 (6 rows)
4685
4686 DROP FUNCTION recall_planner_one_t(int);
4687 ERROR:  function recall_planner_one_t(integer) does not exist
4688 --No.13-4-7
4689 -- See description for No.13-4-1. Complains on the wrongly written hint.
4690 /*+HashJoin(t_1 t_1)*/
4691 EXPLAIN (COSTS false)
4692  SELECT recall_planner() FROM s1.t1 t_1
4693    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4694   ORDER BY t_1.c1;
4695 LOG:  pg_hint_plan:
4696 used hint:
4697 IndexScan(t_1)
4698 not used hint:
4699 duplication hint:
4700 error hint:
4701
4702 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4703 DETAIL:  Relation name "t_1" is duplicated.
4704 LOG:  pg_hint_plan:
4705 used hint:
4706 not used hint:
4707 duplication hint:
4708 error hint:
4709 HashJoin(t_1 t_1)
4710
4711                  QUERY PLAN                  
4712 ---------------------------------------------
4713  Merge Join
4714    Merge Cond: (t_1.c1 = t_2.c1)
4715    ->  Index Only Scan using t1_i1 on t1 t_1
4716    ->  Sort
4717          Sort Key: t_2.c1
4718          ->  Seq Scan on t2 t_2
4719 (6 rows)
4720
4721 --No.13-4-8
4722 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
4723 EXPLAIN (COSTS false)
4724  SELECT recall_planner() FROM s1.t1 t_1
4725    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4726   ORDER BY t_1.c1;
4727 INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4728 DETAIL:  Conflict join method hint.
4729 LOG:  pg_hint_plan:
4730 used hint:
4731 IndexScan(t_1)
4732 not used hint:
4733 duplication hint:
4734 error hint:
4735
4736 LOG:  pg_hint_plan:
4737 used hint:
4738 HashJoin(t_1 t_2)
4739 not used hint:
4740 duplication hint:
4741 MergeJoin(t_1 t_2)
4742 error hint:
4743
4744               QUERY PLAN              
4745 --------------------------------------
4746  Sort
4747    Sort Key: t_1.c1
4748    ->  Hash Join
4749          Hash Cond: (t_1.c1 = t_2.c1)
4750          ->  Seq Scan on t1 t_1
4751          ->  Hash
4752                ->  Seq Scan on t2 t_2
4753 (7 rows)
4754
4755 --No.14-1-1 plancache invalidation
4756 CREATE TABLE s1.tpc AS SELECT a FROM generate_series(0, 999) a;
4757 CREATE INDEX ON s1.tpc(a);
4758 PREPARE p1 AS SELECT * FROM s1.tpc WHERE a < 999;
4759 /*+ IndexScan(tpc) */PREPARE p2 AS SELECT * FROM s1.tpc WHERE a < 999;
4760 /*+ SeqScan(tpc) */PREPARE p3(int) AS SELECT * FROM s1.tpc WHERE a = $1;
4761 EXPLAIN EXECUTE p1;
4762                       QUERY PLAN                      
4763 ------------------------------------------------------
4764  Seq Scan on tpc  (cost=0.00..17.50 rows=333 width=4)
4765    Filter: (a < 999)
4766 (2 rows)
4767
4768 EXPLAIN EXECUTE p2;
4769 LOG:  pg_hint_plan:
4770 used hint:
4771 IndexScan(tpc)
4772 not used hint:
4773 duplication hint:
4774 error hint:
4775
4776                                QUERY PLAN                               
4777 ------------------------------------------------------------------------
4778  Index Scan using tpc_a_idx on tpc  (cost=0.28..34.10 rows=333 width=4)
4779    Index Cond: (a < 999)
4780 (2 rows)
4781
4782 EXPLAIN EXECUTE p3(500);
4783 LOG:  pg_hint_plan:
4784 used hint:
4785 SeqScan(tpc)
4786 not used hint:
4787 duplication hint:
4788 error hint:
4789
4790                      QUERY PLAN                     
4791 ----------------------------------------------------
4792  Seq Scan on tpc  (cost=0.00..17.50 rows=5 width=4)
4793    Filter: (a = 500)
4794 (2 rows)
4795
4796 -- The DROP invalidates the plan caches
4797 DROP TABLE s1.tpc;
4798 CREATE TABLE s1.tpc AS SELECT a FROM generate_series(0, 999) a;
4799 CREATE INDEX ON s1.tpc(a);
4800 EXPLAIN EXECUTE p1;
4801                       QUERY PLAN                      
4802 ------------------------------------------------------
4803  Seq Scan on tpc  (cost=0.00..17.50 rows=333 width=4)
4804    Filter: (a < 999)
4805 (2 rows)
4806
4807 EXPLAIN EXECUTE p2;
4808 LOG:  pg_hint_plan:
4809 used hint:
4810 IndexScan(tpc)
4811 not used hint:
4812 duplication hint:
4813 error hint:
4814
4815                                QUERY PLAN                               
4816 ------------------------------------------------------------------------
4817  Index Scan using tpc_a_idx on tpc  (cost=0.28..34.10 rows=333 width=4)
4818    Index Cond: (a < 999)
4819 (2 rows)
4820
4821 EXPLAIN EXECUTE p3(500);
4822 LOG:  pg_hint_plan:
4823 used hint:
4824 SeqScan(tpc)
4825 not used hint:
4826 duplication hint:
4827 error hint:
4828
4829                      QUERY PLAN                     
4830 ----------------------------------------------------
4831  Seq Scan on tpc  (cost=0.00..17.50 rows=5 width=4)
4832    Filter: (a = 500)
4833 (2 rows)
4834
4835 DEALLOCATE p1;
4836 DEALLOCATE p2;
4837 DEALLOCATE p3;
4838 DROP TABLE s1.tpc;