OSDN Git Service

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