OSDN Git Service

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