OSDN Git Service

Support DECLARE CURSOR syntax and added regression for table hinting.
[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: INPROGR, 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: INPROGR, xid/subid/cid: 0/1/0
1793 DEBUG:  CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0
1794 SHOW pg_hint_plan.parse_messages;
1795 DEBUG:  StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0
1796 DEBUG:  CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGR, 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: INPROGR, 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: INPROGR, 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: INPROGR, 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 fatal;
2018 /*+Set*/SELECT 1;
2019 -- No. A-8-4-11
2020 RESET client_min_messages;
2021 SET pg_hint_plan.parse_messages TO DEFAULT;
2022 SHOW pg_hint_plan.parse_messages;
2023  pg_hint_plan.parse_messages 
2024 -----------------------------
2025  info
2026 (1 row)
2027
2028 /*+Set*/SELECT 1;
2029 INFO:  pg_hint_plan: hint syntax error at or near ""
2030 DETAIL:  Opening parenthesis is necessary.
2031  ?column? 
2032 ----------
2033         1
2034 (1 row)
2035
2036 -- No. A-8-4-12
2037 SET pg_hint_plan.parse_messages TO fatal;
2038 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "fatal"
2039 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2040 SHOW pg_hint_plan.parse_messages;
2041  pg_hint_plan.parse_messages 
2042 -----------------------------
2043  info
2044 (1 row)
2045
2046 -- No. A-8-4-13
2047 SET pg_hint_plan.parse_messages TO panic;
2048 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "panic"
2049 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2050 SHOW pg_hint_plan.parse_messages;
2051  pg_hint_plan.parse_messages 
2052 -----------------------------
2053  info
2054 (1 row)
2055
2056 -- No. A-8-4-14
2057 SET pg_hint_plan.parse_messages TO on;
2058 ERROR:  invalid value for parameter "pg_hint_plan.parse_messages": "on"
2059 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, info, notice, warning, error.
2060 SHOW pg_hint_plan.parse_messages;
2061  pg_hint_plan.parse_messages 
2062 -----------------------------
2063  info
2064 (1 row)
2065
2066 ----
2067 ---- No. A-8-5 original GUC parameter pg_hint_plan.enable_hint_table
2068 ----
2069 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints)
2070         VALUES (
2071         'EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = ?;',
2072         '',
2073         'SeqScan(t1)');
2074 -- No. A-8-5-1
2075 SET pg_hint_plan.enable_hint_table TO on;
2076 SHOW pg_hint_plan.enable_hint_table;
2077  pg_hint_plan.enable_hint_table 
2078 --------------------------------
2079  on
2080 (1 row)
2081
2082 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2083      QUERY PLAN     
2084 --------------------
2085  Seq Scan on t1
2086    Filter: (c1 = 1)
2087 (2 rows)
2088
2089 -- No. A-8-5-2
2090 SET pg_hint_plan.enable_hint_table TO off;
2091 SHOW pg_hint_plan.enable_hint_table;
2092  pg_hint_plan.enable_hint_table 
2093 --------------------------------
2094  off
2095 (1 row)
2096
2097 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2098           QUERY PLAN          
2099 ------------------------------
2100  Index Scan using t1_i1 on t1
2101    Index Cond: (c1 = 1)
2102 (2 rows)
2103
2104 -- No. A-8-5-3
2105 SET pg_hint_plan.enable_hint_table TO DEFAULT;
2106 SHOW pg_hint_plan.enable_hint_table;
2107  pg_hint_plan.enable_hint_table 
2108 --------------------------------
2109  off
2110 (1 row)
2111
2112 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2113           QUERY PLAN          
2114 ------------------------------
2115  Index Scan using t1_i1 on t1
2116    Index Cond: (c1 = 1)
2117 (2 rows)
2118
2119 -- No. A-8-5-4
2120 SET pg_hint_plan.enable_hint_table TO enable;
2121 ERROR:  parameter "pg_hint_plan.enable_hint_table" requires a Boolean value
2122 SHOW pg_hint_plan.enable_hint_table;
2123  pg_hint_plan.enable_hint_table 
2124 --------------------------------
2125  off
2126 (1 row)
2127
2128 TRUNCATE hint_plan.hints;
2129 ----
2130 ---- No. A-9-1 parse error message output
2131 ----
2132 -- No. A-9-1-1
2133 /*+"Set"(enable_indexscan on)*/SELECT 1;
2134 INFO:  pg_hint_plan: hint syntax error at or near ""Set"(enable_indexscan on)"
2135 DETAIL:  Unrecognized hint keyword ""Set"".
2136  ?column? 
2137 ----------
2138         1
2139 (1 row)
2140
2141 /*+Set()(enable_indexscan on)*/SELECT 1;
2142 INFO:  pg_hint_plan: hint syntax error at or near "Set()(enable_indexscan on)"
2143 DETAIL:  Set hint requires name and value of GUC parameter.
2144 INFO:  pg_hint_plan: hint syntax error at or near "(enable_indexscan on)"
2145 DETAIL:  Unrecognized hint keyword "".
2146  ?column? 
2147 ----------
2148         1
2149 (1 row)
2150
2151 /*+Set(enable_indexscan on*/SELECT 1;
2152 INFO:  pg_hint_plan: hint syntax error at or near ""
2153 DETAIL:  Closing parenthesis is necessary.
2154  ?column? 
2155 ----------
2156         1
2157 (1 row)
2158
2159 ----
2160 ---- No. A-9-3 hint state output
2161 ----
2162 SET pg_hint_plan.debug_print TO on;
2163 SET client_min_messages TO LOG;
2164 -- No. A-9-3-1
2165 /*+SeqScan(t1)*/
2166 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2167 LOG:  pg_hint_plan:
2168 used hint:
2169 SeqScan(t1)
2170 not used hint:
2171 duplication hint:
2172 error hint:
2173
2174      QUERY PLAN     
2175 --------------------
2176  Seq Scan on t1
2177    Filter: (c1 = 1)
2178 (2 rows)
2179
2180 -- No. A-9-3-2
2181 /*+SeqScan(no_table)*/
2182 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2183 LOG:  pg_hint_plan:
2184 used hint:
2185 not used hint:
2186 SeqScan(no_table)
2187 duplication hint:
2188 error hint:
2189
2190           QUERY PLAN          
2191 ------------------------------
2192  Index Scan using t1_i1 on t1
2193    Index Cond: (c1 = 1)
2194 (2 rows)
2195
2196 -- No. A-9-3-3
2197 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2198             QUERY PLAN             
2199 -----------------------------------
2200  Tid Scan on t1
2201    TID Cond: (ctid = '(1,1)'::tid)
2202    Filter: (c1 = 1)
2203 (3 rows)
2204
2205 /*+TidScan(t1)BitmapScan(t1)*/
2206 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2207 INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
2208 DETAIL:  Conflict scan method hint.
2209 LOG:  pg_hint_plan:
2210 used hint:
2211 BitmapScan(t1)
2212 not used hint:
2213 duplication hint:
2214 TidScan(t1)
2215 error hint:
2216
2217             QUERY PLAN            
2218 ----------------------------------
2219  Bitmap Heap Scan on t1
2220    Recheck Cond: (c1 = 1)
2221    Filter: (ctid = '(1,1)'::tid)
2222    ->  Bitmap Index Scan on t1_i1
2223          Index Cond: (c1 = 1)
2224 (5 rows)
2225
2226 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
2227 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2228 INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
2229 DETAIL:  Conflict scan method hint.
2230 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
2231 DETAIL:  Conflict scan method hint.
2232 LOG:  pg_hint_plan:
2233 used hint:
2234 IndexScan(t1)
2235 not used hint:
2236 duplication hint:
2237 TidScan(t1)
2238 BitmapScan(t1)
2239 error hint:
2240
2241            QUERY PLAN            
2242 ---------------------------------
2243  Index Scan using t1_i1 on t1
2244    Index Cond: (c1 = 1)
2245    Filter: (ctid = '(1,1)'::tid)
2246 (3 rows)
2247
2248 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
2249 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
2250 INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2251 DETAIL:  Conflict scan method hint.
2252 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
2253 DETAIL:  Conflict scan method hint.
2254 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
2255 DETAIL:  Conflict scan method hint.
2256 LOG:  pg_hint_plan:
2257 used hint:
2258 SeqScan(t1)
2259 not used hint:
2260 duplication hint:
2261 TidScan(t1)
2262 BitmapScan(t1)
2263 IndexScan(t1)
2264 error hint:
2265
2266                    QUERY PLAN                   
2267 ------------------------------------------------
2268  Seq Scan on t1
2269    Filter: ((c1 = 1) AND (ctid = '(1,1)'::tid))
2270 (2 rows)
2271
2272 -- No. A-9-3-4
2273 /*+Set(enable_indexscan enable)*/
2274 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2275 INFO:  parameter "enable_indexscan" requires a Boolean value
2276 LOG:  pg_hint_plan:
2277 used hint:
2278 not used hint:
2279 duplication hint:
2280 error hint:
2281 Set(enable_indexscan enable)
2282
2283           QUERY PLAN          
2284 ------------------------------
2285  Index Scan using t1_i1 on t1
2286    Index Cond: (c1 = 1)
2287 (2 rows)
2288
2289 ----
2290 ---- No. A-10-1 hint state output
2291 ----
2292 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2293 EXPLAIN (COSTS false) EXECUTE p1;
2294           QUERY PLAN          
2295 ------------------------------
2296  Index Scan using t1_i1 on t1
2297    Index Cond: (c1 = 1)
2298 (2 rows)
2299
2300 DEALLOCATE p1;
2301 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2302 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2303       QUERY PLAN       
2304 -----------------------
2305  Seq Scan on t1
2306    Filter: (c1 < 1000)
2307 (2 rows)
2308
2309 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2310       QUERY PLAN       
2311 -----------------------
2312  Seq Scan on t1
2313    Filter: (c1 < 1000)
2314 (2 rows)
2315
2316 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2317       QUERY PLAN       
2318 -----------------------
2319  Seq Scan on t1
2320    Filter: (c1 < 1000)
2321 (2 rows)
2322
2323 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2324       QUERY PLAN       
2325 -----------------------
2326  Seq Scan on t1
2327    Filter: (c1 < 1000)
2328 (2 rows)
2329
2330 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2331       QUERY PLAN       
2332 -----------------------
2333  Seq Scan on t1
2334    Filter: (c1 < 1000)
2335 (2 rows)
2336
2337 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2338      QUERY PLAN      
2339 ---------------------
2340  Seq Scan on t1
2341    Filter: (c1 < $1)
2342 (2 rows)
2343
2344 DEALLOCATE p1;
2345 -- No. A-10-1-1
2346 -- No. A-10-1-2
2347 /*+SeqScan(t1)*/
2348 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2349 /*+BitmapScan(t1)*/
2350 EXPLAIN (COSTS false) EXECUTE p1;
2351 LOG:  pg_hint_plan:
2352 used hint:
2353 SeqScan(t1)
2354 not used hint:
2355 duplication hint:
2356 error hint:
2357
2358      QUERY PLAN     
2359 --------------------
2360  Seq Scan on t1
2361    Filter: (c1 = 1)
2362 (2 rows)
2363
2364 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2365 /*+BitmapScan(t1)*/
2366 EXPLAIN (COSTS false) EXECUTE p1;
2367 LOG:  pg_hint_plan:
2368 used hint:
2369 SeqScan(t1)
2370 not used hint:
2371 duplication hint:
2372 error hint:
2373
2374      QUERY PLAN     
2375 --------------------
2376  Seq Scan on t1
2377    Filter: (c1 = 1)
2378 (2 rows)
2379
2380 DEALLOCATE p1;
2381 /*+BitmapScan(t1)*/
2382 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2383 /*+SeqScan(t1)*/
2384 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2385 LOG:  pg_hint_plan:
2386 used hint:
2387 BitmapScan(t1)
2388 not used hint:
2389 duplication hint:
2390 error hint:
2391
2392             QUERY PLAN            
2393 ----------------------------------
2394  Bitmap Heap Scan on t1
2395    Recheck Cond: (c1 < 1000)
2396    ->  Bitmap Index Scan on t1_i1
2397          Index Cond: (c1 < 1000)
2398 (4 rows)
2399
2400 /*+SeqScan(t1)*/
2401 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2402 LOG:  pg_hint_plan:
2403 used hint:
2404 BitmapScan(t1)
2405 not used hint:
2406 duplication hint:
2407 error hint:
2408
2409             QUERY PLAN            
2410 ----------------------------------
2411  Bitmap Heap Scan on t1
2412    Recheck Cond: (c1 < 1000)
2413    ->  Bitmap Index Scan on t1_i1
2414          Index Cond: (c1 < 1000)
2415 (4 rows)
2416
2417 /*+SeqScan(t1)*/
2418 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2419 LOG:  pg_hint_plan:
2420 used hint:
2421 BitmapScan(t1)
2422 not used hint:
2423 duplication hint:
2424 error hint:
2425
2426             QUERY PLAN            
2427 ----------------------------------
2428  Bitmap Heap Scan on t1
2429    Recheck Cond: (c1 < 1000)
2430    ->  Bitmap Index Scan on t1_i1
2431          Index Cond: (c1 < 1000)
2432 (4 rows)
2433
2434 /*+SeqScan(t1)*/
2435 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2436 LOG:  pg_hint_plan:
2437 used hint:
2438 BitmapScan(t1)
2439 not used hint:
2440 duplication hint:
2441 error hint:
2442
2443             QUERY PLAN            
2444 ----------------------------------
2445  Bitmap Heap Scan on t1
2446    Recheck Cond: (c1 < 1000)
2447    ->  Bitmap Index Scan on t1_i1
2448          Index Cond: (c1 < 1000)
2449 (4 rows)
2450
2451 /*+SeqScan(t1)*/
2452 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2453 LOG:  pg_hint_plan:
2454 used hint:
2455 BitmapScan(t1)
2456 not used hint:
2457 duplication hint:
2458 error hint:
2459
2460             QUERY PLAN            
2461 ----------------------------------
2462  Bitmap Heap Scan on t1
2463    Recheck Cond: (c1 < 1000)
2464    ->  Bitmap Index Scan on t1_i1
2465          Index Cond: (c1 < 1000)
2466 (4 rows)
2467
2468 /*+SeqScan(t1)*/
2469 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2470 LOG:  pg_hint_plan:
2471 used hint:
2472 BitmapScan(t1)
2473 not used hint:
2474 duplication hint:
2475 error hint:
2476
2477             QUERY PLAN            
2478 ----------------------------------
2479  Bitmap Heap Scan on t1
2480    Recheck Cond: (c1 < $1)
2481    ->  Bitmap Index Scan on t1_i1
2482          Index Cond: (c1 < $1)
2483 (4 rows)
2484
2485 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2486 /*+SeqScan(t1)*/
2487 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2488 LOG:  pg_hint_plan:
2489 used hint:
2490 BitmapScan(t1)
2491 not used hint:
2492 duplication hint:
2493 error hint:
2494
2495             QUERY PLAN            
2496 ----------------------------------
2497  Bitmap Heap Scan on t1
2498    Recheck Cond: (c1 < $1)
2499    ->  Bitmap Index Scan on t1_i1
2500          Index Cond: (c1 < $1)
2501 (4 rows)
2502
2503 DEALLOCATE p1;
2504 -- No. A-10-1-3
2505 -- No. A-10-1-4
2506 /*+SeqScan(t1)*/
2507 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2508 EXPLAIN (COSTS false) EXECUTE p1;
2509 LOG:  pg_hint_plan:
2510 used hint:
2511 SeqScan(t1)
2512 not used hint:
2513 duplication hint:
2514 error hint:
2515
2516      QUERY PLAN     
2517 --------------------
2518  Seq Scan on t1
2519    Filter: (c1 = 1)
2520 (2 rows)
2521
2522 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2523 EXPLAIN (COSTS false) EXECUTE p1;
2524 LOG:  pg_hint_plan:
2525 used hint:
2526 SeqScan(t1)
2527 not used hint:
2528 duplication hint:
2529 error hint:
2530
2531      QUERY PLAN     
2532 --------------------
2533  Seq Scan on t1
2534    Filter: (c1 = 1)
2535 (2 rows)
2536
2537 DEALLOCATE p1;
2538 /*+BitmapScan(t1)*/
2539 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2540 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2541 LOG:  pg_hint_plan:
2542 used hint:
2543 BitmapScan(t1)
2544 not used hint:
2545 duplication hint:
2546 error hint:
2547
2548             QUERY PLAN            
2549 ----------------------------------
2550  Bitmap Heap Scan on t1
2551    Recheck Cond: (c1 < 1000)
2552    ->  Bitmap Index Scan on t1_i1
2553          Index Cond: (c1 < 1000)
2554 (4 rows)
2555
2556 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2557 LOG:  pg_hint_plan:
2558 used hint:
2559 BitmapScan(t1)
2560 not used hint:
2561 duplication hint:
2562 error hint:
2563
2564             QUERY PLAN            
2565 ----------------------------------
2566  Bitmap Heap Scan on t1
2567    Recheck Cond: (c1 < 1000)
2568    ->  Bitmap Index Scan on t1_i1
2569          Index Cond: (c1 < 1000)
2570 (4 rows)
2571
2572 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2573 LOG:  pg_hint_plan:
2574 used hint:
2575 BitmapScan(t1)
2576 not used hint:
2577 duplication hint:
2578 error hint:
2579
2580             QUERY PLAN            
2581 ----------------------------------
2582  Bitmap Heap Scan on t1
2583    Recheck Cond: (c1 < 1000)
2584    ->  Bitmap Index Scan on t1_i1
2585          Index Cond: (c1 < 1000)
2586 (4 rows)
2587
2588 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2589 LOG:  pg_hint_plan:
2590 used hint:
2591 BitmapScan(t1)
2592 not used hint:
2593 duplication hint:
2594 error hint:
2595
2596             QUERY PLAN            
2597 ----------------------------------
2598  Bitmap Heap Scan on t1
2599    Recheck Cond: (c1 < 1000)
2600    ->  Bitmap Index Scan on t1_i1
2601          Index Cond: (c1 < 1000)
2602 (4 rows)
2603
2604 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2605 LOG:  pg_hint_plan:
2606 used hint:
2607 BitmapScan(t1)
2608 not used hint:
2609 duplication hint:
2610 error hint:
2611
2612             QUERY PLAN            
2613 ----------------------------------
2614  Bitmap Heap Scan on t1
2615    Recheck Cond: (c1 < 1000)
2616    ->  Bitmap Index Scan on t1_i1
2617          Index Cond: (c1 < 1000)
2618 (4 rows)
2619
2620 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2621 LOG:  pg_hint_plan:
2622 used hint:
2623 BitmapScan(t1)
2624 not used hint:
2625 duplication hint:
2626 error hint:
2627
2628             QUERY PLAN            
2629 ----------------------------------
2630  Bitmap Heap Scan on t1
2631    Recheck Cond: (c1 < $1)
2632    ->  Bitmap Index Scan on t1_i1
2633          Index Cond: (c1 < $1)
2634 (4 rows)
2635
2636 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2637 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2638 LOG:  pg_hint_plan:
2639 used hint:
2640 BitmapScan(t1)
2641 not used hint:
2642 duplication hint:
2643 error hint:
2644
2645             QUERY PLAN            
2646 ----------------------------------
2647  Bitmap Heap Scan on t1
2648    Recheck Cond: (c1 < $1)
2649    ->  Bitmap Index Scan on t1_i1
2650          Index Cond: (c1 < $1)
2651 (4 rows)
2652
2653 DEALLOCATE p1;
2654 -- No. A-10-1-5
2655 -- No. A-10-1-6
2656 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2657 /*+BitmapScan(t1)*/
2658 EXPLAIN (COSTS false) EXECUTE p1;
2659           QUERY PLAN          
2660 ------------------------------
2661  Index Scan using t1_i1 on t1
2662    Index Cond: (c1 = 1)
2663 (2 rows)
2664
2665 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2666 /*+BitmapScan(t1)*/
2667 EXPLAIN (COSTS false) EXECUTE p1;
2668           QUERY PLAN          
2669 ------------------------------
2670  Index Scan using t1_i1 on t1
2671    Index Cond: (c1 = 1)
2672 (2 rows)
2673
2674 DEALLOCATE p1;
2675 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2676 /*+BitmapScan(t1)*/
2677 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2678       QUERY PLAN       
2679 -----------------------
2680  Seq Scan on t1
2681    Filter: (c1 < 1000)
2682 (2 rows)
2683
2684 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2685       QUERY PLAN       
2686 -----------------------
2687  Seq Scan on t1
2688    Filter: (c1 < 1000)
2689 (2 rows)
2690
2691 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2692       QUERY PLAN       
2693 -----------------------
2694  Seq Scan on t1
2695    Filter: (c1 < 1000)
2696 (2 rows)
2697
2698 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2699       QUERY PLAN       
2700 -----------------------
2701  Seq Scan on t1
2702    Filter: (c1 < 1000)
2703 (2 rows)
2704
2705 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2706       QUERY PLAN       
2707 -----------------------
2708  Seq Scan on t1
2709    Filter: (c1 < 1000)
2710 (2 rows)
2711
2712 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2713      QUERY PLAN      
2714 ---------------------
2715  Seq Scan on t1
2716    Filter: (c1 < $1)
2717 (2 rows)
2718
2719 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2720 /*+BitmapScan(t1)*/
2721 EXPLAIN (COSTS false) EXECUTE p1 (1000);
2722      QUERY PLAN      
2723 ---------------------
2724  Seq Scan on t1
2725    Filter: (c1 < $1)
2726 (2 rows)
2727
2728 DEALLOCATE p1;
2729 -- No. A-10-1-9
2730 -- No. A-10-1-10
2731 /*+SeqScan(t1)*/
2732 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2733 /*+BitmapScan(t1)*/
2734 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2735 LOG:  pg_hint_plan:
2736 used hint:
2737 SeqScan(t1)
2738 not used hint:
2739 duplication hint:
2740 error hint:
2741
2742      QUERY PLAN     
2743 --------------------
2744  Seq Scan on t1
2745    Filter: (c1 = 1)
2746 (2 rows)
2747
2748 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2749 /*+BitmapScan(t1)*/
2750 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2751 LOG:  pg_hint_plan:
2752 used hint:
2753 SeqScan(t1)
2754 not used hint:
2755 duplication hint:
2756 error hint:
2757
2758      QUERY PLAN     
2759 --------------------
2760  Seq Scan on t1
2761    Filter: (c1 = 1)
2762 (2 rows)
2763
2764 DEALLOCATE p1;
2765 /*+BitmapScan(t1)*/
2766 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2767 /*+SeqScan(t1)*/
2768 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2769 LOG:  pg_hint_plan:
2770 used hint:
2771 BitmapScan(t1)
2772 not used hint:
2773 duplication hint:
2774 error hint:
2775
2776             QUERY PLAN            
2777 ----------------------------------
2778  Bitmap Heap Scan on t1
2779    Recheck Cond: (c1 < 1000)
2780    ->  Bitmap Index Scan on t1_i1
2781          Index Cond: (c1 < 1000)
2782 (4 rows)
2783
2784 /*+SeqScan(t1)*/
2785 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2786 LOG:  pg_hint_plan:
2787 used hint:
2788 BitmapScan(t1)
2789 not used hint:
2790 duplication hint:
2791 error hint:
2792
2793             QUERY PLAN            
2794 ----------------------------------
2795  Bitmap Heap Scan on t1
2796    Recheck Cond: (c1 < 1000)
2797    ->  Bitmap Index Scan on t1_i1
2798          Index Cond: (c1 < 1000)
2799 (4 rows)
2800
2801 /*+SeqScan(t1)*/
2802 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2803 LOG:  pg_hint_plan:
2804 used hint:
2805 BitmapScan(t1)
2806 not used hint:
2807 duplication hint:
2808 error hint:
2809
2810             QUERY PLAN            
2811 ----------------------------------
2812  Bitmap Heap Scan on t1
2813    Recheck Cond: (c1 < 1000)
2814    ->  Bitmap Index Scan on t1_i1
2815          Index Cond: (c1 < 1000)
2816 (4 rows)
2817
2818 /*+SeqScan(t1)*/
2819 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2820 LOG:  pg_hint_plan:
2821 used hint:
2822 BitmapScan(t1)
2823 not used hint:
2824 duplication hint:
2825 error hint:
2826
2827             QUERY PLAN            
2828 ----------------------------------
2829  Bitmap Heap Scan on t1
2830    Recheck Cond: (c1 < 1000)
2831    ->  Bitmap Index Scan on t1_i1
2832          Index Cond: (c1 < 1000)
2833 (4 rows)
2834
2835 /*+SeqScan(t1)*/
2836 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2837 LOG:  pg_hint_plan:
2838 used hint:
2839 BitmapScan(t1)
2840 not used hint:
2841 duplication hint:
2842 error hint:
2843
2844             QUERY PLAN            
2845 ----------------------------------
2846  Bitmap Heap Scan on t1
2847    Recheck Cond: (c1 < 1000)
2848    ->  Bitmap Index Scan on t1_i1
2849          Index Cond: (c1 < 1000)
2850 (4 rows)
2851
2852 /*+SeqScan(t1)*/
2853 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2854 LOG:  pg_hint_plan:
2855 used hint:
2856 BitmapScan(t1)
2857 not used hint:
2858 duplication hint:
2859 error hint:
2860
2861             QUERY PLAN            
2862 ----------------------------------
2863  Bitmap Heap Scan on t1
2864    Recheck Cond: (c1 < $1)
2865    ->  Bitmap Index Scan on t1_i1
2866          Index Cond: (c1 < $1)
2867 (4 rows)
2868
2869 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2870 /*+SeqScan(t1)*/
2871 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2872 LOG:  pg_hint_plan:
2873 used hint:
2874 BitmapScan(t1)
2875 not used hint:
2876 duplication hint:
2877 error hint:
2878
2879             QUERY PLAN            
2880 ----------------------------------
2881  Bitmap Heap Scan on t1
2882    Recheck Cond: (c1 < $1)
2883    ->  Bitmap Index Scan on t1_i1
2884          Index Cond: (c1 < $1)
2885 (4 rows)
2886
2887 DEALLOCATE p1;
2888 -- No. A-10-1-11
2889 -- No. A-10-1-12
2890 /*+SeqScan(t1)*/
2891 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
2892 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2893 LOG:  pg_hint_plan:
2894 used hint:
2895 SeqScan(t1)
2896 not used hint:
2897 duplication hint:
2898 error hint:
2899
2900      QUERY PLAN     
2901 --------------------
2902  Seq Scan on t1
2903    Filter: (c1 = 1)
2904 (2 rows)
2905
2906 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
2907 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
2908 LOG:  pg_hint_plan:
2909 used hint:
2910 SeqScan(t1)
2911 not used hint:
2912 duplication hint:
2913 error hint:
2914
2915      QUERY PLAN     
2916 --------------------
2917  Seq Scan on t1
2918    Filter: (c1 = 1)
2919 (2 rows)
2920
2921 DEALLOCATE p1;
2922 /*+BitmapScan(t1)*/
2923 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
2924 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2925 LOG:  pg_hint_plan:
2926 used hint:
2927 BitmapScan(t1)
2928 not used hint:
2929 duplication hint:
2930 error hint:
2931
2932             QUERY PLAN            
2933 ----------------------------------
2934  Bitmap Heap Scan on t1
2935    Recheck Cond: (c1 < 1000)
2936    ->  Bitmap Index Scan on t1_i1
2937          Index Cond: (c1 < 1000)
2938 (4 rows)
2939
2940 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2941 LOG:  pg_hint_plan:
2942 used hint:
2943 BitmapScan(t1)
2944 not used hint:
2945 duplication hint:
2946 error hint:
2947
2948             QUERY PLAN            
2949 ----------------------------------
2950  Bitmap Heap Scan on t1
2951    Recheck Cond: (c1 < 1000)
2952    ->  Bitmap Index Scan on t1_i1
2953          Index Cond: (c1 < 1000)
2954 (4 rows)
2955
2956 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2957 LOG:  pg_hint_plan:
2958 used hint:
2959 BitmapScan(t1)
2960 not used hint:
2961 duplication hint:
2962 error hint:
2963
2964             QUERY PLAN            
2965 ----------------------------------
2966  Bitmap Heap Scan on t1
2967    Recheck Cond: (c1 < 1000)
2968    ->  Bitmap Index Scan on t1_i1
2969          Index Cond: (c1 < 1000)
2970 (4 rows)
2971
2972 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2973 LOG:  pg_hint_plan:
2974 used hint:
2975 BitmapScan(t1)
2976 not used hint:
2977 duplication hint:
2978 error hint:
2979
2980             QUERY PLAN            
2981 ----------------------------------
2982  Bitmap Heap Scan on t1
2983    Recheck Cond: (c1 < 1000)
2984    ->  Bitmap Index Scan on t1_i1
2985          Index Cond: (c1 < 1000)
2986 (4 rows)
2987
2988 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
2989 LOG:  pg_hint_plan:
2990 used hint:
2991 BitmapScan(t1)
2992 not used hint:
2993 duplication hint:
2994 error hint:
2995
2996             QUERY PLAN            
2997 ----------------------------------
2998  Bitmap Heap Scan on t1
2999    Recheck Cond: (c1 < 1000)
3000    ->  Bitmap Index Scan on t1_i1
3001          Index Cond: (c1 < 1000)
3002 (4 rows)
3003
3004 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3005 LOG:  pg_hint_plan:
3006 used hint:
3007 BitmapScan(t1)
3008 not used hint:
3009 duplication hint:
3010 error hint:
3011
3012             QUERY PLAN            
3013 ----------------------------------
3014  Bitmap Heap Scan on t1
3015    Recheck Cond: (c1 < $1)
3016    ->  Bitmap Index Scan on t1_i1
3017          Index Cond: (c1 < $1)
3018 (4 rows)
3019
3020 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3021 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3022 LOG:  pg_hint_plan:
3023 used hint:
3024 BitmapScan(t1)
3025 not used hint:
3026 duplication hint:
3027 error hint:
3028
3029             QUERY PLAN            
3030 ----------------------------------
3031  Bitmap Heap Scan on t1
3032    Recheck Cond: (c1 < $1)
3033    ->  Bitmap Index Scan on t1_i1
3034          Index Cond: (c1 < $1)
3035 (4 rows)
3036
3037 DEALLOCATE p1;
3038 -- No. A-10-1-13
3039 -- No. A-10-1-14
3040 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3041 /*+BitmapScan(t1)*/
3042 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3043           QUERY PLAN          
3044 ------------------------------
3045  Index Scan using t1_i1 on t1
3046    Index Cond: (c1 = 1)
3047 (2 rows)
3048
3049 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3050 /*+BitmapScan(t1)*/
3051 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1;
3052           QUERY PLAN          
3053 ------------------------------
3054  Index Scan using t1_i1 on t1
3055    Index Cond: (c1 = 1)
3056 (2 rows)
3057
3058 DEALLOCATE p1;
3059 PREPARE p1 AS SELECT * FROM s1.t1 WHERE t1.c1 < $1;
3060 /*+BitmapScan(t1)*/
3061 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3062       QUERY PLAN       
3063 -----------------------
3064  Seq Scan on t1
3065    Filter: (c1 < 1000)
3066 (2 rows)
3067
3068 /*+BitmapScan(t1)*/
3069 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3070       QUERY PLAN       
3071 -----------------------
3072  Seq Scan on t1
3073    Filter: (c1 < 1000)
3074 (2 rows)
3075
3076 /*+BitmapScan(t1)*/
3077 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3078       QUERY PLAN       
3079 -----------------------
3080  Seq Scan on t1
3081    Filter: (c1 < 1000)
3082 (2 rows)
3083
3084 /*+BitmapScan(t1)*/
3085 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3086       QUERY PLAN       
3087 -----------------------
3088  Seq Scan on t1
3089    Filter: (c1 < 1000)
3090 (2 rows)
3091
3092 /*+BitmapScan(t1)*/
3093 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3094       QUERY PLAN       
3095 -----------------------
3096  Seq Scan on t1
3097    Filter: (c1 < 1000)
3098 (2 rows)
3099
3100 /*+BitmapScan(t1)*/
3101 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3102      QUERY PLAN      
3103 ---------------------
3104  Seq Scan on t1
3105    Filter: (c1 < $1)
3106 (2 rows)
3107
3108 UPDATE pg_catalog.pg_class SET relpages = relpages WHERE relname = 't1';
3109 /*+BitmapScan(t1)*/
3110 EXPLAIN (COSTS false) CREATE TABLE test AS EXECUTE p1 (1000);
3111      QUERY PLAN      
3112 ---------------------
3113  Seq Scan on t1
3114    Filter: (c1 < $1)
3115 (2 rows)
3116
3117 DEALLOCATE p1;
3118 ----
3119 ---- No. A-10-4 EXECUTE statement name error
3120 ----
3121 -- No. A-10-4-1
3122 EXECUTE p1;
3123 ERROR:  prepared statement "p1" does not exist
3124 SHOW pg_hint_plan.debug_print;
3125  pg_hint_plan.debug_print 
3126 --------------------------
3127  on
3128 (1 row)
3129
3130 ----
3131 ---- No. A-11-5 EXECUTE statement name error
3132 ----
3133 -- No. A-11-5-1
3134 SELECT pg_stat_statements_reset();
3135  pg_stat_statements_reset 
3136 --------------------------
3137  
3138 (1 row)
3139
3140 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3141  c1 | c2 | c3 | c4 
3142 ----+----+----+----
3143   1 |  1 |  1 | 1
3144 (1 row)
3145
3146 /*+Set(enable_seqscan off)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3147 LOG:  pg_hint_plan:
3148 used hint:
3149 Set(enable_seqscan off)
3150 not used hint:
3151 duplication hint:
3152 error hint:
3153
3154  c1 | c2 | c3 | c4 
3155 ----+----+----+----
3156   1 |  1 |  1 | 1
3157 (1 row)
3158
3159 /*+SeqScan(t1)*/ SELECT * FROM s1.t1 WHERE t1.c1 = 1;
3160 LOG:  pg_hint_plan:
3161 used hint:
3162 SeqScan(t1)
3163 not used hint:
3164 duplication hint:
3165 error hint:
3166
3167  c1 | c2 | c3 | c4 
3168 ----+----+----+----
3169   1 |  1 |  1 | 1
3170 (1 row)
3171
3172 SELECT s.query, s.calls
3173   FROM public.pg_stat_statements s
3174   JOIN pg_catalog.pg_database d
3175     ON (s.dbid = d.oid)
3176  ORDER BY 1;
3177                 query                 | calls 
3178 --------------------------------------+-------
3179  SELECT * FROM s1.t1 WHERE t1.c1 = $1 |     3
3180  SELECT pg_stat_statements_reset()    |     1
3181 (2 rows)
3182
3183 ----
3184 ---- No. A-12-1 reset of global variable of core at the error
3185 ---- No. A-12-2 reset of global variable of original at the error
3186 ----
3187 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3188              QUERY PLAN             
3189 ------------------------------------
3190  Merge Join
3191    Merge Cond: (t1.c1 = t2.c1)
3192    ->  Index Scan using t1_i1 on t1
3193    ->  Sort
3194          Sort Key: t2.c1
3195          ->  Seq Scan on t2
3196 (6 rows)
3197
3198 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3199 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3200 EXPLAIN (COSTS false) EXECUTE p1;
3201 INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3202 DETAIL:  Relation name "t1" is duplicated.
3203 LOG:  pg_hint_plan:
3204 used hint:
3205 SeqScan(t1)
3206 MergeJoin(t1 t2)
3207 Set(enable_seqscan off)
3208 Set(geqo_threshold 100)
3209 not used hint:
3210 duplication hint:
3211 error hint:
3212 NestLoop(t1 t1)
3213
3214              QUERY PLAN             
3215 ------------------------------------
3216  Merge Join
3217    Merge Cond: (t1.c1 = t2.c1)
3218    ->  Sort
3219          Sort Key: t1.c1
3220          ->  Seq Scan on t1
3221    ->  Index Scan using t2_i1 on t2
3222 (6 rows)
3223
3224 -- No. A-12-1-1
3225 -- No. A-12-2-1
3226 SELECT name, setting FROM settings;
3227              name             |  setting  
3228 ------------------------------+-----------
3229  geqo                         | on
3230  geqo_effort                  | 5
3231  geqo_generations             | 0
3232  geqo_pool_size               | 0
3233  geqo_seed                    | 0
3234  geqo_selection_bias          | 2
3235  geqo_threshold               | 12
3236  constraint_exclusion         | partition
3237  cursor_tuple_fraction        | 0.1
3238  default_statistics_target    | 100
3239  force_parallel_mode          | off
3240  from_collapse_limit          | 8
3241  join_collapse_limit          | 8
3242  cpu_index_tuple_cost         | 0.005
3243  cpu_operator_cost            | 0.0025
3244  cpu_tuple_cost               | 0.01
3245  effective_cache_size         | 16384
3246  min_parallel_index_scan_size | 64
3247  min_parallel_table_scan_size | 1024
3248  parallel_setup_cost          | 1000
3249  parallel_tuple_cost          | 0.1
3250  random_page_cost             | 4
3251  seq_page_cost                | 1
3252  enable_bitmapscan            | on
3253  enable_gathermerge           | on
3254  enable_hashagg               | on
3255  enable_hashjoin              | on
3256  enable_indexonlyscan         | on
3257  enable_indexscan             | on
3258  enable_material              | on
3259  enable_mergejoin             | on
3260  enable_nestloop              | on
3261  enable_seqscan               | on
3262  enable_sort                  | on
3263  enable_tidscan               | on
3264  client_min_messages          | log
3265 (36 rows)
3266
3267 SET pg_hint_plan.parse_messages TO error;
3268 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3269 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3270 ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3271 DETAIL:  Relation name "t1" is duplicated.
3272 SELECT name, setting FROM settings;
3273              name             |  setting  
3274 ------------------------------+-----------
3275  geqo                         | on
3276  geqo_effort                  | 5
3277  geqo_generations             | 0
3278  geqo_pool_size               | 0
3279  geqo_seed                    | 0
3280  geqo_selection_bias          | 2
3281  geqo_threshold               | 12
3282  constraint_exclusion         | partition
3283  cursor_tuple_fraction        | 0.1
3284  default_statistics_target    | 100
3285  force_parallel_mode          | off
3286  from_collapse_limit          | 8
3287  join_collapse_limit          | 8
3288  cpu_index_tuple_cost         | 0.005
3289  cpu_operator_cost            | 0.0025
3290  cpu_tuple_cost               | 0.01
3291  effective_cache_size         | 16384
3292  min_parallel_index_scan_size | 64
3293  min_parallel_table_scan_size | 1024
3294  parallel_setup_cost          | 1000
3295  parallel_tuple_cost          | 0.1
3296  random_page_cost             | 4
3297  seq_page_cost                | 1
3298  enable_bitmapscan            | on
3299  enable_gathermerge           | on
3300  enable_hashagg               | on
3301  enable_hashjoin              | on
3302  enable_indexonlyscan         | on
3303  enable_indexscan             | on
3304  enable_material              | on
3305  enable_mergejoin             | on
3306  enable_nestloop              | on
3307  enable_seqscan               | on
3308  enable_sort                  | on
3309  enable_tidscan               | on
3310  client_min_messages          | log
3311 (36 rows)
3312
3313 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3314 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3315 LOG:  pg_hint_plan:
3316 used hint:
3317 SeqScan(t1)
3318 MergeJoin(t1 t2)
3319 Set(enable_seqscan off)
3320 Set(geqo_threshold 100)
3321 not used hint:
3322 duplication hint:
3323 error hint:
3324
3325              QUERY PLAN             
3326 ------------------------------------
3327  Merge Join
3328    Merge Cond: (t1.c1 = t2.c1)
3329    ->  Sort
3330          Sort Key: t1.c1
3331          ->  Seq Scan on t1
3332    ->  Index Scan using t2_i1 on t2
3333 (6 rows)
3334
3335 -- No. A-12-1-2
3336 -- No. A-12-2-2
3337 SELECT name, setting FROM settings;
3338              name             |  setting  
3339 ------------------------------+-----------
3340  geqo                         | on
3341  geqo_effort                  | 5
3342  geqo_generations             | 0
3343  geqo_pool_size               | 0
3344  geqo_seed                    | 0
3345  geqo_selection_bias          | 2
3346  geqo_threshold               | 12
3347  constraint_exclusion         | partition
3348  cursor_tuple_fraction        | 0.1
3349  default_statistics_target    | 100
3350  force_parallel_mode          | off
3351  from_collapse_limit          | 8
3352  join_collapse_limit          | 8
3353  cpu_index_tuple_cost         | 0.005
3354  cpu_operator_cost            | 0.0025
3355  cpu_tuple_cost               | 0.01
3356  effective_cache_size         | 16384
3357  min_parallel_index_scan_size | 64
3358  min_parallel_table_scan_size | 1024
3359  parallel_setup_cost          | 1000
3360  parallel_tuple_cost          | 0.1
3361  random_page_cost             | 4
3362  seq_page_cost                | 1
3363  enable_bitmapscan            | on
3364  enable_gathermerge           | on
3365  enable_hashagg               | on
3366  enable_hashjoin              | on
3367  enable_indexonlyscan         | on
3368  enable_indexscan             | on
3369  enable_material              | on
3370  enable_mergejoin             | on
3371  enable_nestloop              | on
3372  enable_seqscan               | on
3373  enable_sort                  | on
3374  enable_tidscan               | on
3375  client_min_messages          | log
3376 (36 rows)
3377
3378 SET pg_hint_plan.parse_messages TO error;
3379 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
3380 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3381 ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
3382 DETAIL:  Relation name "t1" is duplicated.
3383 SELECT name, setting FROM settings;
3384              name             |  setting  
3385 ------------------------------+-----------
3386  geqo                         | on
3387  geqo_effort                  | 5
3388  geqo_generations             | 0
3389  geqo_pool_size               | 0
3390  geqo_seed                    | 0
3391  geqo_selection_bias          | 2
3392  geqo_threshold               | 12
3393  constraint_exclusion         | partition
3394  cursor_tuple_fraction        | 0.1
3395  default_statistics_target    | 100
3396  force_parallel_mode          | off
3397  from_collapse_limit          | 8
3398  join_collapse_limit          | 8
3399  cpu_index_tuple_cost         | 0.005
3400  cpu_operator_cost            | 0.0025
3401  cpu_tuple_cost               | 0.01
3402  effective_cache_size         | 16384
3403  min_parallel_index_scan_size | 64
3404  min_parallel_table_scan_size | 1024
3405  parallel_setup_cost          | 1000
3406  parallel_tuple_cost          | 0.1
3407  random_page_cost             | 4
3408  seq_page_cost                | 1
3409  enable_bitmapscan            | on
3410  enable_gathermerge           | on
3411  enable_hashagg               | on
3412  enable_hashjoin              | on
3413  enable_indexonlyscan         | on
3414  enable_indexscan             | on
3415  enable_material              | on
3416  enable_mergejoin             | on
3417  enable_nestloop              | on
3418  enable_seqscan               | on
3419  enable_sort                  | on
3420  enable_tidscan               | on
3421  client_min_messages          | log
3422 (36 rows)
3423
3424 EXPLAIN (COSTS false) EXECUTE p1;
3425              QUERY PLAN             
3426 ------------------------------------
3427  Merge Join
3428    Merge Cond: (t1.c1 = t2.c1)
3429    ->  Sort
3430          Sort Key: t1.c1
3431          ->  Seq Scan on t1
3432    ->  Index Scan using t2_i1 on t2
3433 (6 rows)
3434
3435 -- No. A-12-1-3
3436 -- No. A-12-2-3
3437 SELECT name, setting FROM settings;
3438              name             |  setting  
3439 ------------------------------+-----------
3440  geqo                         | on
3441  geqo_effort                  | 5
3442  geqo_generations             | 0
3443  geqo_pool_size               | 0
3444  geqo_seed                    | 0
3445  geqo_selection_bias          | 2
3446  geqo_threshold               | 12
3447  constraint_exclusion         | partition
3448  cursor_tuple_fraction        | 0.1
3449  default_statistics_target    | 100
3450  force_parallel_mode          | off
3451  from_collapse_limit          | 8
3452  join_collapse_limit          | 8
3453  cpu_index_tuple_cost         | 0.005
3454  cpu_operator_cost            | 0.0025
3455  cpu_tuple_cost               | 0.01
3456  effective_cache_size         | 16384
3457  min_parallel_index_scan_size | 64
3458  min_parallel_table_scan_size | 1024
3459  parallel_setup_cost          | 1000
3460  parallel_tuple_cost          | 0.1
3461  random_page_cost             | 4
3462  seq_page_cost                | 1
3463  enable_bitmapscan            | on
3464  enable_gathermerge           | on
3465  enable_hashagg               | on
3466  enable_hashjoin              | on
3467  enable_indexonlyscan         | on
3468  enable_indexscan             | on
3469  enable_material              | on
3470  enable_mergejoin             | on
3471  enable_nestloop              | on
3472  enable_seqscan               | on
3473  enable_sort                  | on
3474  enable_tidscan               | on
3475  client_min_messages          | log
3476 (36 rows)
3477
3478 SET pg_hint_plan.parse_messages TO error;
3479 EXPLAIN (COSTS false) EXECUTE p2;
3480 ERROR:  prepared statement "p2" does not exist
3481 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)*/
3482 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3483 LOG:  pg_hint_plan:
3484 used hint:
3485 SeqScan(t1)
3486 MergeJoin(t1 t2)
3487 Set(enable_seqscan off)
3488 Set(geqo_threshold 100)
3489 not used hint:
3490 duplication hint:
3491 error hint:
3492
3493              QUERY PLAN             
3494 ------------------------------------
3495  Merge Join
3496    Merge Cond: (t1.c1 = t2.c1)
3497    ->  Sort
3498          Sort Key: t1.c1
3499          ->  Seq Scan on t1
3500    ->  Index Scan using t2_i1 on t2
3501 (6 rows)
3502
3503 EXPLAIN (COSTS false) EXECUTE p1;
3504              QUERY PLAN             
3505 ------------------------------------
3506  Merge Join
3507    Merge Cond: (t1.c1 = t2.c1)
3508    ->  Sort
3509          Sort Key: t1.c1
3510          ->  Seq Scan on t1
3511    ->  Index Scan using t2_i1 on t2
3512 (6 rows)
3513
3514 SELECT name, setting FROM settings;
3515              name             |  setting  
3516 ------------------------------+-----------
3517  geqo                         | on
3518  geqo_effort                  | 5
3519  geqo_generations             | 0
3520  geqo_pool_size               | 0
3521  geqo_seed                    | 0
3522  geqo_selection_bias          | 2
3523  geqo_threshold               | 12
3524  constraint_exclusion         | partition
3525  cursor_tuple_fraction        | 0.1
3526  default_statistics_target    | 100
3527  force_parallel_mode          | off
3528  from_collapse_limit          | 8
3529  join_collapse_limit          | 8
3530  cpu_index_tuple_cost         | 0.005
3531  cpu_operator_cost            | 0.0025
3532  cpu_tuple_cost               | 0.01
3533  effective_cache_size         | 16384
3534  min_parallel_index_scan_size | 64
3535  min_parallel_table_scan_size | 1024
3536  parallel_setup_cost          | 1000
3537  parallel_tuple_cost          | 0.1
3538  random_page_cost             | 4
3539  seq_page_cost                | 1
3540  enable_bitmapscan            | on
3541  enable_gathermerge           | on
3542  enable_hashagg               | on
3543  enable_hashjoin              | on
3544  enable_indexonlyscan         | on
3545  enable_indexscan             | on
3546  enable_material              | on
3547  enable_mergejoin             | on
3548  enable_nestloop              | on
3549  enable_seqscan               | on
3550  enable_sort                  | on
3551  enable_tidscan               | on
3552  client_min_messages          | log
3553 (36 rows)
3554
3555 -- No. A-12-1-4
3556 -- No. A-12-2-4
3557 SELECT name, setting FROM settings;
3558              name             |  setting  
3559 ------------------------------+-----------
3560  geqo                         | on
3561  geqo_effort                  | 5
3562  geqo_generations             | 0
3563  geqo_pool_size               | 0
3564  geqo_seed                    | 0
3565  geqo_selection_bias          | 2
3566  geqo_threshold               | 12
3567  constraint_exclusion         | partition
3568  cursor_tuple_fraction        | 0.1
3569  default_statistics_target    | 100
3570  force_parallel_mode          | off
3571  from_collapse_limit          | 8
3572  join_collapse_limit          | 8
3573  cpu_index_tuple_cost         | 0.005
3574  cpu_operator_cost            | 0.0025
3575  cpu_tuple_cost               | 0.01
3576  effective_cache_size         | 16384
3577  min_parallel_index_scan_size | 64
3578  min_parallel_table_scan_size | 1024
3579  parallel_setup_cost          | 1000
3580  parallel_tuple_cost          | 0.1
3581  random_page_cost             | 4
3582  seq_page_cost                | 1
3583  enable_bitmapscan            | on
3584  enable_gathermerge           | on
3585  enable_hashagg               | on
3586  enable_hashjoin              | on
3587  enable_indexonlyscan         | on
3588  enable_indexscan             | on
3589  enable_material              | on
3590  enable_mergejoin             | on
3591  enable_nestloop              | on
3592  enable_seqscan               | on
3593  enable_sort                  | on
3594  enable_tidscan               | on
3595  client_min_messages          | log
3596 (36 rows)
3597
3598 SET pg_hint_plan.parse_messages TO error;
3599 EXPLAIN (COSTS false) EXECUTE p2;
3600 ERROR:  prepared statement "p2" does not exist
3601 EXPLAIN (COSTS false) EXECUTE p1;
3602              QUERY PLAN             
3603 ------------------------------------
3604  Merge Join
3605    Merge Cond: (t1.c1 = t2.c1)
3606    ->  Sort
3607          Sort Key: t1.c1
3608          ->  Seq Scan on t1
3609    ->  Index Scan using t2_i1 on t2
3610 (6 rows)
3611
3612 SELECT name, setting FROM settings;
3613              name             |  setting  
3614 ------------------------------+-----------
3615  geqo                         | on
3616  geqo_effort                  | 5
3617  geqo_generations             | 0
3618  geqo_pool_size               | 0
3619  geqo_seed                    | 0
3620  geqo_selection_bias          | 2
3621  geqo_threshold               | 12
3622  constraint_exclusion         | partition
3623  cursor_tuple_fraction        | 0.1
3624  default_statistics_target    | 100
3625  force_parallel_mode          | off
3626  from_collapse_limit          | 8
3627  join_collapse_limit          | 8
3628  cpu_index_tuple_cost         | 0.005
3629  cpu_operator_cost            | 0.0025
3630  cpu_tuple_cost               | 0.01
3631  effective_cache_size         | 16384
3632  min_parallel_index_scan_size | 64
3633  min_parallel_table_scan_size | 1024
3634  parallel_setup_cost          | 1000
3635  parallel_tuple_cost          | 0.1
3636  random_page_cost             | 4
3637  seq_page_cost                | 1
3638  enable_bitmapscan            | on
3639  enable_gathermerge           | on
3640  enable_hashagg               | on
3641  enable_hashjoin              | on
3642  enable_indexonlyscan         | on
3643  enable_indexscan             | on
3644  enable_material              | on
3645  enable_mergejoin             | on
3646  enable_nestloop              | on
3647  enable_seqscan               | on
3648  enable_sort                  | on
3649  enable_tidscan               | on
3650  client_min_messages          | log
3651 (36 rows)
3652
3653 DEALLOCATE p1;
3654 SET pg_hint_plan.parse_messages TO LOG;
3655 ----
3656 ---- No. A-12-3 effective range of the hint
3657 ----
3658 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3659              QUERY PLAN             
3660 ------------------------------------
3661  Merge Join
3662    Merge Cond: (t1.c1 = t2.c1)
3663    ->  Index Scan using t1_i1 on t1
3664    ->  Sort
3665          Sort Key: t2.c1
3666          ->  Seq Scan on t2
3667 (6 rows)
3668
3669 -- No. A-12-3-1
3670 SET enable_indexscan TO off;
3671 SET enable_mergejoin TO off;
3672 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3673           QUERY PLAN          
3674 ------------------------------
3675  Hash Join
3676    Hash Cond: (t1.c1 = t2.c1)
3677    ->  Seq Scan on t1
3678    ->  Hash
3679          ->  Seq Scan on t2
3680 (5 rows)
3681
3682 SELECT name, setting FROM settings;
3683              name             |  setting  
3684 ------------------------------+-----------
3685  geqo                         | on
3686  geqo_effort                  | 5
3687  geqo_generations             | 0
3688  geqo_pool_size               | 0
3689  geqo_seed                    | 0
3690  geqo_selection_bias          | 2
3691  geqo_threshold               | 12
3692  constraint_exclusion         | partition
3693  cursor_tuple_fraction        | 0.1
3694  default_statistics_target    | 100
3695  force_parallel_mode          | off
3696  from_collapse_limit          | 8
3697  join_collapse_limit          | 8
3698  cpu_index_tuple_cost         | 0.005
3699  cpu_operator_cost            | 0.0025
3700  cpu_tuple_cost               | 0.01
3701  effective_cache_size         | 16384
3702  min_parallel_index_scan_size | 64
3703  min_parallel_table_scan_size | 1024
3704  parallel_setup_cost          | 1000
3705  parallel_tuple_cost          | 0.1
3706  random_page_cost             | 4
3707  seq_page_cost                | 1
3708  enable_bitmapscan            | on
3709  enable_gathermerge           | on
3710  enable_hashagg               | on
3711  enable_hashjoin              | on
3712  enable_indexonlyscan         | on
3713  enable_indexscan             | off
3714  enable_material              | on
3715  enable_mergejoin             | off
3716  enable_nestloop              | on
3717  enable_seqscan               | on
3718  enable_sort                  | on
3719  enable_tidscan               | on
3720  client_min_messages          | log
3721 (36 rows)
3722
3723 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3724 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3725 LOG:  pg_hint_plan:
3726 used hint:
3727 IndexScan(t2)
3728 MergeJoin(t1 t2)
3729 Leading(t2 t1)
3730 Set(enable_indexscan on)
3731 Set(geqo_threshold 100)
3732 not used hint:
3733 duplication hint:
3734 error hint:
3735
3736              QUERY PLAN             
3737 ------------------------------------
3738  Merge Join
3739    Merge Cond: (t1.c1 = t2.c1)
3740    ->  Index Scan using t1_i1 on t1
3741    ->  Index Scan using t2_i1 on t2
3742 (4 rows)
3743
3744 SELECT name, setting FROM settings;
3745              name             |  setting  
3746 ------------------------------+-----------
3747  geqo                         | on
3748  geqo_effort                  | 5
3749  geqo_generations             | 0
3750  geqo_pool_size               | 0
3751  geqo_seed                    | 0
3752  geqo_selection_bias          | 2
3753  geqo_threshold               | 12
3754  constraint_exclusion         | partition
3755  cursor_tuple_fraction        | 0.1
3756  default_statistics_target    | 100
3757  force_parallel_mode          | off
3758  from_collapse_limit          | 8
3759  join_collapse_limit          | 8
3760  cpu_index_tuple_cost         | 0.005
3761  cpu_operator_cost            | 0.0025
3762  cpu_tuple_cost               | 0.01
3763  effective_cache_size         | 16384
3764  min_parallel_index_scan_size | 64
3765  min_parallel_table_scan_size | 1024
3766  parallel_setup_cost          | 1000
3767  parallel_tuple_cost          | 0.1
3768  random_page_cost             | 4
3769  seq_page_cost                | 1
3770  enable_bitmapscan            | on
3771  enable_gathermerge           | on
3772  enable_hashagg               | on
3773  enable_hashjoin              | on
3774  enable_indexonlyscan         | on
3775  enable_indexscan             | off
3776  enable_material              | on
3777  enable_mergejoin             | off
3778  enable_nestloop              | on
3779  enable_seqscan               | on
3780  enable_sort                  | on
3781  enable_tidscan               | on
3782  client_min_messages          | log
3783 (36 rows)
3784
3785 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3786           QUERY PLAN          
3787 ------------------------------
3788  Hash Join
3789    Hash Cond: (t1.c1 = t2.c1)
3790    ->  Seq Scan on t1
3791    ->  Hash
3792          ->  Seq Scan on t2
3793 (5 rows)
3794
3795 -- No. A-12-3-2
3796 SET enable_indexscan TO off;
3797 SET enable_mergejoin TO off;
3798 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3799           QUERY PLAN          
3800 ------------------------------
3801  Hash Join
3802    Hash Cond: (t1.c1 = t2.c1)
3803    ->  Seq Scan on t1
3804    ->  Hash
3805          ->  Seq Scan on t2
3806 (5 rows)
3807
3808 SELECT name, setting FROM settings;
3809              name             |  setting  
3810 ------------------------------+-----------
3811  geqo                         | on
3812  geqo_effort                  | 5
3813  geqo_generations             | 0
3814  geqo_pool_size               | 0
3815  geqo_seed                    | 0
3816  geqo_selection_bias          | 2
3817  geqo_threshold               | 12
3818  constraint_exclusion         | partition
3819  cursor_tuple_fraction        | 0.1
3820  default_statistics_target    | 100
3821  force_parallel_mode          | off
3822  from_collapse_limit          | 8
3823  join_collapse_limit          | 8
3824  cpu_index_tuple_cost         | 0.005
3825  cpu_operator_cost            | 0.0025
3826  cpu_tuple_cost               | 0.01
3827  effective_cache_size         | 16384
3828  min_parallel_index_scan_size | 64
3829  min_parallel_table_scan_size | 1024
3830  parallel_setup_cost          | 1000
3831  parallel_tuple_cost          | 0.1
3832  random_page_cost             | 4
3833  seq_page_cost                | 1
3834  enable_bitmapscan            | on
3835  enable_gathermerge           | on
3836  enable_hashagg               | on
3837  enable_hashjoin              | on
3838  enable_indexonlyscan         | on
3839  enable_indexscan             | off
3840  enable_material              | on
3841  enable_mergejoin             | off
3842  enable_nestloop              | on
3843  enable_seqscan               | on
3844  enable_sort                  | on
3845  enable_tidscan               | on
3846  client_min_messages          | log
3847 (36 rows)
3848
3849 BEGIN;
3850 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3851 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3852 LOG:  pg_hint_plan:
3853 used hint:
3854 IndexScan(t2)
3855 MergeJoin(t1 t2)
3856 Leading(t2 t1)
3857 Set(enable_indexscan on)
3858 Set(geqo_threshold 100)
3859 not used hint:
3860 duplication hint:
3861 error hint:
3862
3863              QUERY PLAN             
3864 ------------------------------------
3865  Merge Join
3866    Merge Cond: (t1.c1 = t2.c1)
3867    ->  Index Scan using t1_i1 on t1
3868    ->  Index Scan using t2_i1 on t2
3869 (4 rows)
3870
3871 COMMIT;
3872 BEGIN;
3873 SELECT name, setting FROM settings;
3874              name             |  setting  
3875 ------------------------------+-----------
3876  geqo                         | on
3877  geqo_effort                  | 5
3878  geqo_generations             | 0
3879  geqo_pool_size               | 0
3880  geqo_seed                    | 0
3881  geqo_selection_bias          | 2
3882  geqo_threshold               | 12
3883  constraint_exclusion         | partition
3884  cursor_tuple_fraction        | 0.1
3885  default_statistics_target    | 100
3886  force_parallel_mode          | off
3887  from_collapse_limit          | 8
3888  join_collapse_limit          | 8
3889  cpu_index_tuple_cost         | 0.005
3890  cpu_operator_cost            | 0.0025
3891  cpu_tuple_cost               | 0.01
3892  effective_cache_size         | 16384
3893  min_parallel_index_scan_size | 64
3894  min_parallel_table_scan_size | 1024
3895  parallel_setup_cost          | 1000
3896  parallel_tuple_cost          | 0.1
3897  random_page_cost             | 4
3898  seq_page_cost                | 1
3899  enable_bitmapscan            | on
3900  enable_gathermerge           | on
3901  enable_hashagg               | on
3902  enable_hashjoin              | on
3903  enable_indexonlyscan         | on
3904  enable_indexscan             | off
3905  enable_material              | on
3906  enable_mergejoin             | off
3907  enable_nestloop              | on
3908  enable_seqscan               | on
3909  enable_sort                  | on
3910  enable_tidscan               | on
3911  client_min_messages          | log
3912 (36 rows)
3913
3914 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3915           QUERY PLAN          
3916 ------------------------------
3917  Hash Join
3918    Hash Cond: (t1.c1 = t2.c1)
3919    ->  Seq Scan on t1
3920    ->  Hash
3921          ->  Seq Scan on t2
3922 (5 rows)
3923
3924 COMMIT;
3925 -- No. A-12-3-3
3926 SET enable_indexscan TO off;
3927 SET enable_mergejoin TO off;
3928 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3929           QUERY PLAN          
3930 ------------------------------
3931  Hash Join
3932    Hash Cond: (t1.c1 = t2.c1)
3933    ->  Seq Scan on t1
3934    ->  Hash
3935          ->  Seq Scan on t2
3936 (5 rows)
3937
3938 SELECT name, setting FROM settings;
3939              name             |  setting  
3940 ------------------------------+-----------
3941  geqo                         | on
3942  geqo_effort                  | 5
3943  geqo_generations             | 0
3944  geqo_pool_size               | 0
3945  geqo_seed                    | 0
3946  geqo_selection_bias          | 2
3947  geqo_threshold               | 12
3948  constraint_exclusion         | partition
3949  cursor_tuple_fraction        | 0.1
3950  default_statistics_target    | 100
3951  force_parallel_mode          | off
3952  from_collapse_limit          | 8
3953  join_collapse_limit          | 8
3954  cpu_index_tuple_cost         | 0.005
3955  cpu_operator_cost            | 0.0025
3956  cpu_tuple_cost               | 0.01
3957  effective_cache_size         | 16384
3958  min_parallel_index_scan_size | 64
3959  min_parallel_table_scan_size | 1024
3960  parallel_setup_cost          | 1000
3961  parallel_tuple_cost          | 0.1
3962  random_page_cost             | 4
3963  seq_page_cost                | 1
3964  enable_bitmapscan            | on
3965  enable_gathermerge           | on
3966  enable_hashagg               | on
3967  enable_hashjoin              | on
3968  enable_indexonlyscan         | on
3969  enable_indexscan             | off
3970  enable_material              | on
3971  enable_mergejoin             | off
3972  enable_nestloop              | on
3973  enable_seqscan               | on
3974  enable_sort                  | on
3975  enable_tidscan               | on
3976  client_min_messages          | log
3977 (36 rows)
3978
3979 /*+Set(enable_indexscan on)Set(geqo_threshold 100)IndexScan(t2)MergeJoin(t1 t2)Leading(t2 t1)*/
3980 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
3981 LOG:  pg_hint_plan:
3982 used hint:
3983 IndexScan(t2)
3984 MergeJoin(t1 t2)
3985 Leading(t2 t1)
3986 Set(enable_indexscan on)
3987 Set(geqo_threshold 100)
3988 not used hint:
3989 duplication hint:
3990 error hint:
3991
3992              QUERY PLAN             
3993 ------------------------------------
3994  Merge Join
3995    Merge Cond: (t1.c1 = t2.c1)
3996    ->  Index Scan using t1_i1 on t1
3997    ->  Index Scan using t2_i1 on t2
3998 (4 rows)
3999
4000 \connect
4001 SET enable_indexscan TO off;
4002 SET enable_mergejoin TO off;
4003 LOAD 'pg_hint_plan';
4004 SELECT name, setting FROM settings;
4005              name             |  setting  
4006 ------------------------------+-----------
4007  geqo                         | on
4008  geqo_effort                  | 5
4009  geqo_generations             | 0
4010  geqo_pool_size               | 0
4011  geqo_seed                    | 0
4012  geqo_selection_bias          | 2
4013  geqo_threshold               | 12
4014  constraint_exclusion         | partition
4015  cursor_tuple_fraction        | 0.1
4016  default_statistics_target    | 100
4017  force_parallel_mode          | off
4018  from_collapse_limit          | 8
4019  join_collapse_limit          | 8
4020  cpu_index_tuple_cost         | 0.005
4021  cpu_operator_cost            | 0.0025
4022  cpu_tuple_cost               | 0.01
4023  effective_cache_size         | 16384
4024  min_parallel_index_scan_size | 64
4025  min_parallel_table_scan_size | 1024
4026  parallel_setup_cost          | 1000
4027  parallel_tuple_cost          | 0.1
4028  random_page_cost             | 4
4029  seq_page_cost                | 1
4030  enable_bitmapscan            | on
4031  enable_gathermerge           | on
4032  enable_hashagg               | on
4033  enable_hashjoin              | on
4034  enable_indexonlyscan         | on
4035  enable_indexscan             | off
4036  enable_material              | on
4037  enable_mergejoin             | off
4038  enable_nestloop              | on
4039  enable_seqscan               | on
4040  enable_sort                  | on
4041  enable_tidscan               | on
4042  client_min_messages          | notice
4043 (36 rows)
4044
4045 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
4046           QUERY PLAN          
4047 ------------------------------
4048  Hash Join
4049    Hash Cond: (t1.c1 = t2.c1)
4050    ->  Seq Scan on t1
4051    ->  Hash
4052          ->  Seq Scan on t2
4053 (5 rows)
4054
4055 SET pg_hint_plan.enable_hint TO on;
4056 SET pg_hint_plan.debug_print TO on;
4057 SET client_min_messages TO LOG;
4058 SET search_path TO public;
4059 RESET enable_indexscan;
4060 RESET enable_mergejoin;
4061 ----
4062 ---- No. A-13 call planner recursively
4063 ----
4064 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4065 DECLARE
4066     new_cnt int;
4067 BEGIN
4068     RAISE NOTICE 'nested_planner(%)', cnt;
4069
4070     /* 再帰終了の判断 */
4071     IF cnt <= 1 THEN
4072         RETURN 0;
4073     END IF;
4074
4075         SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4076           FROM s1.t1 t_1
4077           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4078          ORDER BY t_1.c1 LIMIT 1;
4079
4080     RETURN new_cnt;
4081 END;
4082 $$ LANGUAGE plpgsql IMMUTABLE;
4083 ----
4084 ---- No. A-13-2 use hint of main query
4085 ----
4086 --No.13-2-1
4087 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4088 NOTICE:  nested_planner(1)
4089               QUERY PLAN               
4090 ---------------------------------------
4091  Index Only Scan using t1_i1 on t1 t_1
4092 (1 row)
4093
4094 /*+SeqScan(t_1)*/
4095 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4096 NOTICE:  nested_planner(1)
4097 LOG:  pg_hint_plan:
4098 used hint:
4099 SeqScan(t_1)
4100 not used hint:
4101 duplication hint:
4102 error hint:
4103
4104         QUERY PLAN        
4105 --------------------------
4106  Sort
4107    Sort Key: c1
4108    ->  Seq Scan on t1 t_1
4109 (3 rows)
4110
4111 ----
4112 ---- No. A-13-3 output number of times of debugging log
4113 ----
4114 --No.13-3-1
4115 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4116 NOTICE:  nested_planner(1)
4117               QUERY PLAN               
4118 ---------------------------------------
4119  Index Only Scan using t1_i1 on t1 t_1
4120 (1 row)
4121
4122 /*+SeqScan(t_2)*/
4123 EXPLAIN (COSTS false) SELECT nested_planner(1) FROM s1.t1 t_1 ORDER BY t_1.c1;
4124 NOTICE:  nested_planner(1)
4125 LOG:  pg_hint_plan:
4126 used hint:
4127 not used hint:
4128 SeqScan(t_2)
4129 duplication hint:
4130 error hint:
4131
4132               QUERY PLAN               
4133 ---------------------------------------
4134  Index Only Scan using t1_i1 on t1 t_1
4135 (1 row)
4136
4137 --No.13-3-2
4138 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4139 NOTICE:  nested_planner(2)
4140 NOTICE:  nested_planner(1)
4141 LOG:  pg_hint_plan:
4142 used hint:
4143 IndexScan(t_1)
4144 not used hint:
4145 duplication hint:
4146 error hint:
4147
4148               QUERY PLAN               
4149 ---------------------------------------
4150  Index Only Scan using t1_i1 on t1 t_1
4151 (1 row)
4152
4153 /*+SeqScan(t_2)*/
4154 EXPLAIN (COSTS false) SELECT nested_planner(2) FROM s1.t1 t_1 ORDER BY t_1.c1;
4155 NOTICE:  nested_planner(2)
4156 NOTICE:  nested_planner(1)
4157 LOG:  pg_hint_plan:
4158 used hint:
4159 IndexScan(t_1)
4160 not used hint:
4161 duplication hint:
4162 error hint:
4163
4164 LOG:  pg_hint_plan:
4165 used hint:
4166 not used hint:
4167 SeqScan(t_2)
4168 duplication hint:
4169 error hint:
4170
4171               QUERY PLAN               
4172 ---------------------------------------
4173  Index Only Scan using t1_i1 on t1 t_1
4174 (1 row)
4175
4176 --No.13-3-3
4177 --
4178 -- Redefine not to use cached plan
4179 --
4180 CREATE OR REPLACE FUNCTION nested_planner(cnt int) RETURNS int AS $$
4181 DECLARE
4182     new_cnt int;
4183 BEGIN
4184     RAISE NOTICE 'nested_planner(%)', cnt;
4185
4186     /* 再帰終了の判断 */
4187     IF cnt <= 1 THEN
4188         RETURN 0;
4189     END IF;
4190
4191         SELECT /*+ IndexScan(t_1) */ nested_planner(cnt - 1) INTO new_cnt
4192           FROM s1.t1 t_1
4193           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4194          ORDER BY t_1.c1 LIMIT 1;
4195
4196     RETURN new_cnt;
4197 END;
4198 $$ LANGUAGE plpgsql IMMUTABLE;
4199 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4200 NOTICE:  nested_planner(5)
4201 NOTICE:  nested_planner(4)
4202 NOTICE:  nested_planner(3)
4203 NOTICE:  nested_planner(2)
4204 NOTICE:  nested_planner(1)
4205 LOG:  pg_hint_plan:
4206 no hint
4207 LOG:  pg_hint_plan:
4208 used hint:
4209 IndexScan(t_1)
4210 not used hint:
4211 duplication hint:
4212 error hint:
4213
4214 LOG:  pg_hint_plan:
4215 used hint:
4216 IndexScan(t_1)
4217 not used hint:
4218 duplication hint:
4219 error hint:
4220
4221 LOG:  pg_hint_plan:
4222 used hint:
4223 IndexScan(t_1)
4224 not used hint:
4225 duplication hint:
4226 error hint:
4227
4228               QUERY PLAN               
4229 ---------------------------------------
4230  Index Only Scan using t1_i1 on t1 t_1
4231 (1 row)
4232
4233 /*+SeqScan(t_2)*/
4234 EXPLAIN (COSTS false) SELECT nested_planner(5) FROM s1.t1 t_1 ORDER BY t_1.c1;
4235 NOTICE:  nested_planner(5)
4236 NOTICE:  nested_planner(4)
4237 NOTICE:  nested_planner(3)
4238 NOTICE:  nested_planner(2)
4239 NOTICE:  nested_planner(1)
4240 LOG:  pg_hint_plan:
4241 used hint:
4242 IndexScan(t_1)
4243 not used hint:
4244 duplication hint:
4245 error hint:
4246
4247 LOG:  pg_hint_plan:
4248 used hint:
4249 IndexScan(t_1)
4250 not used hint:
4251 duplication hint:
4252 error hint:
4253
4254 LOG:  pg_hint_plan:
4255 used hint:
4256 IndexScan(t_1)
4257 not used hint:
4258 duplication hint:
4259 error hint:
4260
4261 LOG:  pg_hint_plan:
4262 used hint:
4263 IndexScan(t_1)
4264 not used hint:
4265 duplication hint:
4266 error hint:
4267
4268 LOG:  pg_hint_plan:
4269 used hint:
4270 not used hint:
4271 SeqScan(t_2)
4272 duplication hint:
4273 error hint:
4274
4275               QUERY PLAN               
4276 ---------------------------------------
4277  Index Only Scan using t1_i1 on t1 t_1
4278 (1 row)
4279
4280 ----
4281 ---- No. A-13-4 output of debugging log on hint status
4282 ----
4283 CREATE OR REPLACE FUNCTION recall_planner() RETURNS int AS $$
4284         SELECT /*+ IndexScan(t_1) */t_1.c1
4285           FROM s1.t1 t_1
4286           JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4287          ORDER BY t_1.c1 LIMIT 1;
4288 $$ LANGUAGE SQL IMMUTABLE;
4289 --No.13-4-1
4290 /*+HashJoin(t_1 t_2)*/
4291 EXPLAIN (COSTS false)
4292  SELECT recall_planner() FROM s1.t1 t_1
4293    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4294   ORDER BY t_1.c1;
4295 LOG:  pg_hint_plan:
4296 used hint:
4297 HashJoin(t_1 t_2)
4298 not used hint:
4299 duplication hint:
4300 error hint:
4301
4302 LOG:  pg_hint_plan:
4303 used hint:
4304 HashJoin(t_1 t_2)
4305 not used hint:
4306 duplication hint:
4307 error hint:
4308
4309               QUERY PLAN              
4310 --------------------------------------
4311  Sort
4312    Sort Key: t_1.c1
4313    ->  Hash Join
4314          Hash Cond: (t_1.c1 = t_2.c1)
4315          ->  Seq Scan on t1 t_1
4316          ->  Hash
4317                ->  Seq Scan on t2 t_2
4318 (7 rows)
4319
4320 --No.13-4-2
4321 /*+HashJoin(st_1 st_2)*/
4322 EXPLAIN (COSTS false)
4323  SELECT recall_planner() FROM s1.t1 st_1
4324    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4325   ORDER BY st_1.c1;
4326 LOG:  pg_hint_plan:
4327 used hint:
4328 not used hint:
4329 HashJoin(st_1 st_2)
4330 duplication hint:
4331 error hint:
4332
4333 LOG:  pg_hint_plan:
4334 used hint:
4335 HashJoin(st_1 st_2)
4336 not used hint:
4337 duplication hint:
4338 error hint:
4339
4340                QUERY PLAN               
4341 ----------------------------------------
4342  Sort
4343    Sort Key: st_1.c1
4344    ->  Hash Join
4345          Hash Cond: (st_1.c1 = st_2.c1)
4346          ->  Seq Scan on t1 st_1
4347          ->  Hash
4348                ->  Seq Scan on t2 st_2
4349 (7 rows)
4350
4351 --No.13-4-3
4352 /*+HashJoin(t_1 t_2)*/
4353 EXPLAIN (COSTS false)
4354  SELECT recall_planner() FROM s1.t1 st_1
4355    JOIN s1.t2 st_2 ON (st_1.c1 = st_2.c1)
4356   ORDER BY st_1.c1;
4357 LOG:  pg_hint_plan:
4358 used hint:
4359 HashJoin(t_1 t_2)
4360 not used hint:
4361 duplication hint:
4362 error hint:
4363
4364 LOG:  pg_hint_plan:
4365 used hint:
4366 not used hint:
4367 HashJoin(t_1 t_2)
4368 duplication hint:
4369 error hint:
4370
4371                   QUERY PLAN                  
4372 ----------------------------------------------
4373  Merge Join
4374    Merge Cond: (st_1.c1 = st_2.c1)
4375    ->  Index Only Scan using t1_i1 on t1 st_1
4376    ->  Sort
4377          Sort Key: st_2.c1
4378          ->  Seq Scan on t2 st_2
4379 (6 rows)
4380
4381 --No.13-4-4
4382 /*+HashJoin(st_1 st_2)*/
4383 EXPLAIN (COSTS false)
4384  SELECT recall_planner() FROM s1.t1 t_1
4385    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4386   ORDER BY t_1.c1;
4387 LOG:  pg_hint_plan:
4388 used hint:
4389 not used hint:
4390 HashJoin(st_1 st_2)
4391 duplication hint:
4392 error hint:
4393
4394 LOG:  pg_hint_plan:
4395 used hint:
4396 not used hint:
4397 HashJoin(st_1 st_2)
4398 duplication hint:
4399 error hint:
4400
4401                  QUERY PLAN                  
4402 ---------------------------------------------
4403  Merge Join
4404    Merge Cond: (t_1.c1 = t_2.c1)
4405    ->  Index Only Scan using t1_i1 on t1 t_1
4406    ->  Sort
4407          Sort Key: t_2.c1
4408          ->  Seq Scan on t2 t_2
4409 (6 rows)
4410
4411 --No.13-4-5
4412 /*+HashJoin(t_1 t_1)*/
4413 EXPLAIN (COSTS false)
4414  SELECT recall_planner() FROM s1.t1 t_1
4415   ORDER BY t_1.c1;
4416 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4417 DETAIL:  Relation name "t_1" is duplicated.
4418 LOG:  pg_hint_plan:
4419 used hint:
4420 not used hint:
4421 duplication hint:
4422 error hint:
4423 HashJoin(t_1 t_1)
4424
4425 LOG:  pg_hint_plan:
4426 used hint:
4427 not used hint:
4428 HashJoin(t_1 t_1)
4429 duplication hint:
4430 error hint:
4431
4432               QUERY PLAN               
4433 ---------------------------------------
4434  Index Only Scan using t1_i1 on t1 t_1
4435 (1 row)
4436
4437 --No.13-4-6
4438 CREATE OR REPLACE FUNCTION recall_planner_one_t() RETURNS int AS $$
4439         SELECT /*+ IndexScan(t_1) */t_1.c1
4440           FROM s1.t1 t_1
4441          ORDER BY t_1.c1 LIMIT 1;
4442 $$ LANGUAGE SQL IMMUTABLE;
4443 EXPLAIN (COSTS false)
4444  SELECT recall_planner_one_t() FROM s1.t1 t_1
4445    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4446   ORDER BY t_1.c1;
4447                  QUERY PLAN                  
4448 ---------------------------------------------
4449  Merge Join
4450    Merge Cond: (t_1.c1 = t_2.c1)
4451    ->  Index Only Scan using t1_i1 on t1 t_1
4452    ->  Sort
4453          Sort Key: t_2.c1
4454          ->  Seq Scan on t2 t_2
4455 (6 rows)
4456
4457 /*+HashJoin(t_1 t_1)*/
4458 EXPLAIN (COSTS false)
4459  SELECT recall_planner_one_t() FROM s1.t1 t_1
4460    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4461   ORDER BY t_1.c1;
4462 LOG:  pg_hint_plan:
4463 used hint:
4464 not used hint:
4465 HashJoin(t_1 t_1)
4466 duplication hint:
4467 error hint:
4468
4469 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4470 DETAIL:  Relation name "t_1" is duplicated.
4471 LOG:  pg_hint_plan:
4472 used hint:
4473 not used hint:
4474 duplication hint:
4475 error hint:
4476 HashJoin(t_1 t_1)
4477
4478                  QUERY PLAN                  
4479 ---------------------------------------------
4480  Merge Join
4481    Merge Cond: (t_1.c1 = t_2.c1)
4482    ->  Index Only Scan using t1_i1 on t1 t_1
4483    ->  Sort
4484          Sort Key: t_2.c1
4485          ->  Seq Scan on t2 t_2
4486 (6 rows)
4487
4488 DROP FUNCTION recall_planner_one_t(int);
4489 ERROR:  function recall_planner_one_t(integer) does not exist
4490 --No.13-4-7
4491 /*+HashJoin(t_1 t_1)*/
4492 EXPLAIN (COSTS false)
4493  SELECT recall_planner() FROM s1.t1 t_1
4494    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4495   ORDER BY t_1.c1;
4496 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4497 DETAIL:  Relation name "t_1" is duplicated.
4498 LOG:  pg_hint_plan:
4499 used hint:
4500 not used hint:
4501 duplication hint:
4502 error hint:
4503 HashJoin(t_1 t_1)
4504
4505 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
4506 DETAIL:  Relation name "t_1" is duplicated.
4507 LOG:  pg_hint_plan:
4508 used hint:
4509 not used hint:
4510 duplication hint:
4511 error hint:
4512 HashJoin(t_1 t_1)
4513
4514                  QUERY PLAN                  
4515 ---------------------------------------------
4516  Merge Join
4517    Merge Cond: (t_1.c1 = t_2.c1)
4518    ->  Index Only Scan using t1_i1 on t1 t_1
4519    ->  Sort
4520          Sort Key: t_2.c1
4521          ->  Seq Scan on t2 t_2
4522 (6 rows)
4523
4524 --No.13-4-8
4525 /*+MergeJoin(t_1 t_2)HashJoin(t_1 t_2)*/
4526 EXPLAIN (COSTS false)
4527  SELECT recall_planner() FROM s1.t1 t_1
4528    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
4529   ORDER BY t_1.c1;
4530 INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4531 DETAIL:  Conflict join method hint.
4532 INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
4533 DETAIL:  Conflict join method hint.
4534 LOG:  pg_hint_plan:
4535 used hint:
4536 HashJoin(t_1 t_2)
4537 not used hint:
4538 duplication hint:
4539 MergeJoin(t_1 t_2)
4540 error hint:
4541
4542 LOG:  pg_hint_plan:
4543 used hint:
4544 HashJoin(t_1 t_2)
4545 not used hint:
4546 duplication hint:
4547 MergeJoin(t_1 t_2)
4548 error hint:
4549
4550               QUERY PLAN              
4551 --------------------------------------
4552  Sort
4553    Sort Key: t_1.c1
4554    ->  Hash Join
4555          Hash Cond: (t_1.c1 = t_2.c1)
4556          ->  Seq Scan on t1 t_1
4557          ->  Hash
4558                ->  Seq Scan on t2 t_2
4559 (7 rows)
4560