OSDN Git Service

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