OSDN Git Service

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