OSDN Git Service

Fix debug output level control
[pghintplan/pg_hint_plan.git] / expected / pg_hint_plan.out
1 SET search_path TO public;
2 SET client_min_messages TO log;
3 \set SHOW_CONTEXT always
4 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
5               QUERY PLAN              
6 --------------------------------------
7  Merge Join
8    Merge Cond: (t1.id = t2.id)
9    ->  Index Scan using t1_pkey on t1
10    ->  Index Scan using t2_pkey on t2
11 (4 rows)
12
13 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
14                 QUERY PLAN                 
15 -------------------------------------------
16  Merge Join
17    Merge Cond: (t2.val = t1.val)
18    ->  Index Scan using t2_val on t2
19    ->  Materialize
20          ->  Index Scan using t1_val on t1
21 (5 rows)
22
23 LOAD 'pg_hint_plan';
24 SET pg_hint_plan.debug_print TO on;
25 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
26               QUERY PLAN              
27 --------------------------------------
28  Merge Join
29    Merge Cond: (t1.id = t2.id)
30    ->  Index Scan using t1_pkey on t1
31    ->  Index Scan using t2_pkey on t2
32 (4 rows)
33
34 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
35                 QUERY PLAN                 
36 -------------------------------------------
37  Merge Join
38    Merge Cond: (t2.val = t1.val)
39    ->  Index Scan using t2_val on t2
40    ->  Materialize
41          ->  Index Scan using t1_val on t1
42 (5 rows)
43
44 /*+ Test (t1 t2) */
45 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
46 INFO:  pg_hint_plan: hint syntax error at or near "Test (t1 t2) "
47 DETAIL:  Unrecognized hint keyword "Test".
48               QUERY PLAN              
49 --------------------------------------
50  Merge Join
51    Merge Cond: (t1.id = t2.id)
52    ->  Index Scan using t1_pkey on t1
53    ->  Index Scan using t2_pkey on t2
54 (4 rows)
55
56 SET pg_hint_plan.enable_hint TO off;
57 /*+ Test (t1 t2) */
58 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
59               QUERY PLAN              
60 --------------------------------------
61  Merge Join
62    Merge Cond: (t1.id = t2.id)
63    ->  Index Scan using t1_pkey on t1
64    ->  Index Scan using t2_pkey on t2
65 (4 rows)
66
67 SET pg_hint_plan.enable_hint TO on;
68 /*Set(enable_indexscan off)*/
69 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
70               QUERY PLAN              
71 --------------------------------------
72  Merge Join
73    Merge Cond: (t1.id = t2.id)
74    ->  Index Scan using t1_pkey on t1
75    ->  Index Scan using t2_pkey on t2
76 (4 rows)
77
78 --+Set(enable_indexscan off)
79 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
80               QUERY PLAN              
81 --------------------------------------
82  Merge Join
83    Merge Cond: (t1.id = t2.id)
84    ->  Index Scan using t1_pkey on t1
85    ->  Index Scan using t2_pkey on t2
86 (4 rows)
87
88 /*+Set(enable_indexscan off) /* nest comment */ */
89 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
90 INFO:  pg_hint_plan: hint syntax error at or near "/* nest comment */ */
91 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;"
92 DETAIL:  Nested block comments are not supported.
93               QUERY PLAN              
94 --------------------------------------
95  Merge Join
96    Merge Cond: (t1.id = t2.id)
97    ->  Index Scan using t1_pkey on t1
98    ->  Index Scan using t2_pkey on t2
99 (4 rows)
100
101 /*+Set(enable_indexscan off)*/
102 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
103 LOG:  pg_hint_plan:
104 used hint:
105 Set(enable_indexscan off)
106 not used hint:
107 duplication hint:
108 error hint:
109
110           QUERY PLAN          
111 ------------------------------
112  Hash Join
113    Hash Cond: (t1.id = t2.id)
114    ->  Seq Scan on t1
115    ->  Hash
116          ->  Seq Scan on t2
117 (5 rows)
118
119 EXPLAIN (COSTS false) /*+Set(enable_indexscan off)*/
120  SELECT * FROM t1, t2 WHERE t1.id = t2.id;
121 LOG:  pg_hint_plan:
122 used hint:
123 Set(enable_indexscan off)
124 not used hint:
125 duplication hint:
126 error hint:
127
128           QUERY PLAN          
129 ------------------------------
130  Hash Join
131    Hash Cond: (t1.id = t2.id)
132    ->  Seq Scan on t1
133    ->  Hash
134          ->  Seq Scan on t2
135 (5 rows)
136
137 /*+ Set(enable_indexscan off) Set(enable_hashjoin off) */
138 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
139 LOG:  pg_hint_plan:
140 used hint:
141 Set(enable_hashjoin off)
142 Set(enable_indexscan off)
143 not used hint:
144 duplication hint:
145 error hint:
146
147           QUERY PLAN           
148 -------------------------------
149  Merge Join
150    Merge Cond: (t1.id = t2.id)
151    ->  Sort
152          Sort Key: t1.id
153          ->  Seq Scan on t1
154    ->  Sort
155          Sort Key: t2.id
156          ->  Seq Scan on t2
157 (8 rows)
158
159 /*+      Set     (       enable_indexscan        off     )       */
160 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
161 LOG:  pg_hint_plan:
162 used hint:
163 Set(enable_indexscan off)
164 not used hint:
165 duplication hint:
166 error hint:
167
168           QUERY PLAN          
169 ------------------------------
170  Hash Join
171    Hash Cond: (t1.id = t2.id)
172    ->  Seq Scan on t1
173    ->  Hash
174          ->  Seq Scan on t2
175 (5 rows)
176
177 /*+      
178                 Set      
179                 (        
180                 enable_indexscan         
181                 off      
182                 )        
183                 */              
184 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
185 LOG:  pg_hint_plan:
186 used hint:
187 Set(enable_indexscan off)
188 not used hint:
189 duplication hint:
190 error hint:
191
192           QUERY PLAN          
193 ------------------------------
194  Hash Join
195    Hash Cond: (t1.id = t2.id)
196    ->  Seq Scan on t1
197    ->  Hash
198          ->  Seq Scan on t2
199 (5 rows)
200
201 /*+ Set(enable_indexscan off)Set(enable_nestloop off)Set(enable_mergejoin off)          
202                 Set(enable_seqscan off)
203                 */
204 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
205 LOG:  pg_hint_plan:
206 used hint:
207 Set(enable_indexscan off)
208 Set(enable_mergejoin off)
209 Set(enable_nestloop off)
210 Set(enable_seqscan off)
211 not used hint:
212 duplication hint:
213 error hint:
214
215                  QUERY PLAN                 
216 --------------------------------------------
217  Hash Join
218    Hash Cond: (t1.id = t2.id)
219    ->  Index Scan using t1_pkey on t1
220    ->  Hash
221          ->  Index Scan using t2_pkey on t2
222 (5 rows)
223
224 /*+Set(work_mem "1M")*/
225 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
226 INFO:  invalid value for parameter "work_mem": "1M"
227 HINT:  Valid units for this parameter are "kB", "MB", "GB", and "TB".
228 LOG:  pg_hint_plan:
229 used hint:
230 not used hint:
231 duplication hint:
232 error hint:
233 Set(work_mem 1M)
234
235               QUERY PLAN              
236 --------------------------------------
237  Merge Join
238    Merge Cond: (t1.id = t2.id)
239    ->  Index Scan using t1_pkey on t1
240    ->  Index Scan using t2_pkey on t2
241 (4 rows)
242
243 /*+Set(work_mem "1MB")*/
244 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
245 LOG:  pg_hint_plan:
246 used hint:
247 Set(work_mem 1MB)
248 not used hint:
249 duplication hint:
250 error hint:
251
252               QUERY PLAN              
253 --------------------------------------
254  Merge Join
255    Merge Cond: (t1.id = t2.id)
256    ->  Index Scan using t1_pkey on t1
257    ->  Index Scan using t2_pkey on t2
258 (4 rows)
259
260 /*+Set(work_mem TO "1MB")*/
261 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
262 INFO:  pg_hint_plan: hint syntax error at or near "Set(work_mem TO "1MB")"
263 DETAIL:  Set hint requires name and value of GUC parameter.
264 LOG:  pg_hint_plan:
265 used hint:
266 not used hint:
267 duplication hint:
268 error hint:
269 Set(work_mem TO 1MB)
270
271               QUERY PLAN              
272 --------------------------------------
273  Merge Join
274    Merge Cond: (t1.id = t2.id)
275    ->  Index Scan using t1_pkey on t1
276    ->  Index Scan using t2_pkey on t2
277 (4 rows)
278
279 /*+SeqScan(t1 t2)*/
280 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
281 INFO:  pg_hint_plan: hint syntax error at or near ""
282 DETAIL:  SeqScan hint accepts only one relation.
283 LOG:  pg_hint_plan:
284 used hint:
285 not used hint:
286 duplication hint:
287 error hint:
288 SeqScan(t1 t2)
289
290               QUERY PLAN              
291 --------------------------------------
292  Merge Join
293    Merge Cond: (t1.id = t2.id)
294    ->  Index Scan using t1_pkey on t1
295    ->  Index Scan using t2_pkey on t2
296 (4 rows)
297
298 /*+SeqScan(t1)*/
299 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
300 LOG:  pg_hint_plan:
301 used hint:
302 SeqScan(t1)
303 not used hint:
304 duplication hint:
305 error hint:
306
307           QUERY PLAN          
308 ------------------------------
309  Hash Join
310    Hash Cond: (t1.id = t2.id)
311    ->  Seq Scan on t1
312    ->  Hash
313          ->  Seq Scan on t2
314 (5 rows)
315
316 /*+SeqScan(t1)IndexScan(t2)*/
317 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
318 LOG:  pg_hint_plan:
319 used hint:
320 SeqScan(t1)
321 IndexScan(t2)
322 not used hint:
323 duplication hint:
324 error hint:
325
326                  QUERY PLAN                 
327 --------------------------------------------
328  Hash Join
329    Hash Cond: (t1.id = t2.id)
330    ->  Seq Scan on t1
331    ->  Hash
332          ->  Index Scan using t2_pkey on t2
333 (5 rows)
334
335 /*+BitmapScan(t2)*/
336 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
337 LOG:  pg_hint_plan:
338 used hint:
339 BitmapScan(t2)
340 not used hint:
341 duplication hint:
342 error hint:
343
344                 QUERY PLAN                
345 ------------------------------------------
346  Nested Loop
347    ->  Seq Scan on t1
348    ->  Bitmap Heap Scan on t2
349          Recheck Cond: (id = t1.id)
350          ->  Bitmap Index Scan on t2_pkey
351                Index Cond: (id = t1.id)
352 (6 rows)
353
354 /*+BitmapScan(t2)NoSeqScan(t1)*/
355 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
356 LOG:  pg_hint_plan:
357 used hint:
358 NoSeqScan(t1)
359 BitmapScan(t2)
360 not used hint:
361 duplication hint:
362 error hint:
363
364                 QUERY PLAN                
365 ------------------------------------------
366  Nested Loop
367    ->  Index Scan using t1_pkey on t1
368    ->  Bitmap Heap Scan on t2
369          Recheck Cond: (id = t1.id)
370          ->  Bitmap Index Scan on t2_pkey
371                Index Cond: (id = t1.id)
372 (6 rows)
373
374 /*+NoIndexScan(t1)*/
375 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
376 LOG:  pg_hint_plan:
377 used hint:
378 NoIndexScan(t1)
379 not used hint:
380 duplication hint:
381 error hint:
382
383           QUERY PLAN          
384 ------------------------------
385  Hash Join
386    Hash Cond: (t1.id = t2.id)
387    ->  Seq Scan on t1
388    ->  Hash
389          ->  Seq Scan on t2
390 (5 rows)
391
392 /*+NoBitmapScan(t1)*/
393 EXPLAIN (COSTS false) SELECT * FROM t1, t4 WHERE t1.val < 10;
394 LOG:  pg_hint_plan:
395 used hint:
396 NoBitmapScan(t1)
397 not used hint:
398 duplication hint:
399 error hint:
400
401          QUERY PLAN         
402 ----------------------------
403  Nested Loop
404    ->  Seq Scan on t1
405          Filter: (val < 10)
406    ->  Materialize
407          ->  Seq Scan on t4
408 (5 rows)
409
410 /*+TidScan(t4)*/
411 EXPLAIN (COSTS false) SELECT * FROM t3, t4 WHERE t3.id = t4.id AND t4.ctid = '(1,1)';
412 LOG:  pg_hint_plan:
413 used hint:
414 TidScan(t4)
415 not used hint:
416 duplication hint:
417 error hint:
418
419                   QUERY PLAN                   
420 -----------------------------------------------
421  Merge Join
422    Merge Cond: (t3.id = t4.id)
423    ->  Index Scan using t3_pkey on t3
424    ->  Sort
425          Sort Key: t4.id
426          ->  Tid Scan on t4
427                TID Cond: (ctid = '(1,1)'::tid)
428 (7 rows)
429
430 /*+NoTidScan(t1)*/
431 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)';
432 LOG:  pg_hint_plan:
433 used hint:
434 NoTidScan(t1)
435 not used hint:
436 duplication hint:
437 error hint:
438
439               QUERY PLAN               
440 ---------------------------------------
441  Nested Loop
442    ->  Seq Scan on t1
443          Filter: (ctid = '(1,1)'::tid)
444    ->  Index Scan using t2_pkey on t2
445          Index Cond: (id = t1.id)
446 (5 rows)
447
448 /*+HashJoin(t1 t2)*/
449 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
450 LOG:  pg_hint_plan:
451 used hint:
452 HashJoin(t1 t2)
453 not used hint:
454 duplication hint:
455 error hint:
456
457           QUERY PLAN          
458 ------------------------------
459  Hash Join
460    Hash Cond: (t1.id = t2.id)
461    ->  Seq Scan on t1
462    ->  Hash
463          ->  Seq Scan on t2
464 (5 rows)
465
466 /*+NestLoop(t1 t2)*/
467 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
468 LOG:  pg_hint_plan:
469 used hint:
470 NestLoop(t1 t2)
471 not used hint:
472 duplication hint:
473 error hint:
474
475               QUERY PLAN              
476 --------------------------------------
477  Nested Loop
478    ->  Seq Scan on t2
479    ->  Index Scan using t1_pkey on t1
480          Index Cond: (id = t2.id)
481 (4 rows)
482
483 /*+NoMergeJoin(t1 t2)*/
484 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
485 LOG:  pg_hint_plan:
486 used hint:
487 NoMergeJoin(t1 t2)
488 not used hint:
489 duplication hint:
490 error hint:
491
492           QUERY PLAN          
493 ------------------------------
494  Hash Join
495    Hash Cond: (t1.id = t2.id)
496    ->  Seq Scan on t1
497    ->  Hash
498          ->  Seq Scan on t2
499 (5 rows)
500
501 /*+MergeJoin(t1 t3)*/
502 EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
503 LOG:  pg_hint_plan:
504 used hint:
505 MergeJoin(t1 t3)
506 not used hint:
507 duplication hint:
508 error hint:
509
510              QUERY PLAN              
511 -------------------------------------
512  Merge Join
513    Merge Cond: (t1.val = t3.val)
514    ->  Index Scan using t1_val on t1
515    ->  Sort
516          Sort Key: t3.val
517          ->  Seq Scan on t3
518 (6 rows)
519
520 /*+NestLoop(t1 t3)*/
521 EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
522 LOG:  pg_hint_plan:
523 used hint:
524 NestLoop(t1 t3)
525 not used hint:
526 duplication hint:
527 error hint:
528
529              QUERY PLAN              
530 -------------------------------------
531  Nested Loop
532    ->  Seq Scan on t3
533    ->  Index Scan using t1_val on t1
534          Index Cond: (val = t3.val)
535 (4 rows)
536
537 /*+NoHashJoin(t1 t3)*/
538 EXPLAIN (COSTS false) SELECT * FROM t1, t3 WHERE t1.val = t3.val;
539 LOG:  pg_hint_plan:
540 used hint:
541 NoHashJoin(t1 t3)
542 not used hint:
543 duplication hint:
544 error hint:
545
546              QUERY PLAN              
547 -------------------------------------
548  Nested Loop
549    ->  Seq Scan on t3
550    ->  Index Scan using t1_val on t1
551          Index Cond: (val = t3.val)
552 (4 rows)
553
554 /*+MergeJoin(t4 t1 t2 t3)*/
555 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
556 LOG:  pg_hint_plan:
557 used hint:
558 MergeJoin(t1 t2 t3 t4)
559 not used hint:
560 duplication hint:
561 error hint:
562
563                     QUERY PLAN                    
564 --------------------------------------------------
565  Merge Join
566    Merge Cond: (t1.id = t3.id)
567    ->  Merge Join
568          Merge Cond: (t1.id = t2.id)
569          ->  Index Scan using t1_pkey on t1
570          ->  Index Scan using t2_pkey on t2
571    ->  Materialize
572          ->  Merge Join
573                Merge Cond: (t3.id = t4.id)
574                ->  Index Scan using t3_pkey on t3
575                ->  Sort
576                      Sort Key: t4.id
577                      ->  Seq Scan on t4
578 (13 rows)
579
580 /*+HashJoin(t3 t4 t1 t2)*/
581 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
582 LOG:  pg_hint_plan:
583 used hint:
584 HashJoin(t1 t2 t3 t4)
585 not used hint:
586 duplication hint:
587 error hint:
588
589                        QUERY PLAN                       
590 --------------------------------------------------------
591  Hash Join
592    Hash Cond: (t3.id = t1.id)
593    ->  Seq Scan on t3
594    ->  Hash
595          ->  Merge Join
596                Merge Cond: (t1.id = t4.id)
597                ->  Merge Join
598                      Merge Cond: (t1.id = t2.id)
599                      ->  Index Scan using t1_pkey on t1
600                      ->  Index Scan using t2_pkey on t2
601                ->  Sort
602                      Sort Key: t4.id
603                      ->  Seq Scan on t4
604 (13 rows)
605
606 /*+NestLoop(t2 t3 t4 t1) IndexScan(t3)*/
607 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
608 LOG:  pg_hint_plan:
609 used hint:
610 IndexScan(t3)
611 NestLoop(t1 t2 t3 t4)
612 not used hint:
613 duplication hint:
614 error hint:
615
616                     QUERY PLAN                    
617 --------------------------------------------------
618  Nested Loop
619    ->  Merge Join
620          Merge Cond: (t1.id = t4.id)
621          ->  Merge Join
622                Merge Cond: (t1.id = t2.id)
623                ->  Index Scan using t1_pkey on t1
624                ->  Index Scan using t2_pkey on t2
625          ->  Sort
626                Sort Key: t4.id
627                ->  Seq Scan on t4
628    ->  Index Scan using t3_pkey on t3
629          Index Cond: (id = t1.id)
630 (12 rows)
631
632 /*+NoNestLoop(t4 t1 t3 t2)*/
633 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
634 LOG:  pg_hint_plan:
635 used hint:
636 NoNestLoop(t1 t2 t3 t4)
637 not used hint:
638 duplication hint:
639 error hint:
640
641                     QUERY PLAN                    
642 --------------------------------------------------
643  Merge Join
644    Merge Cond: (t1.id = t3.id)
645    ->  Merge Join
646          Merge Cond: (t1.id = t2.id)
647          ->  Index Scan using t1_pkey on t1
648          ->  Index Scan using t2_pkey on t2
649    ->  Materialize
650          ->  Merge Join
651                Merge Cond: (t3.id = t4.id)
652                ->  Index Scan using t3_pkey on t3
653                ->  Sort
654                      Sort Key: t4.id
655                      ->  Seq Scan on t4
656 (13 rows)
657
658 /*+Leading( */
659 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
660 INFO:  pg_hint_plan: hint syntax error at or near ""
661 DETAIL:  Closing parenthesis is necessary.
662                     QUERY PLAN                    
663 --------------------------------------------------
664  Nested Loop
665    ->  Merge Join
666          Merge Cond: (t1.id = t4.id)
667          ->  Merge Join
668                Merge Cond: (t1.id = t2.id)
669                ->  Index Scan using t1_pkey on t1
670                ->  Index Scan using t2_pkey on t2
671          ->  Sort
672                Sort Key: t4.id
673                ->  Seq Scan on t4
674    ->  Index Scan using t3_pkey on t3
675          Index Cond: (id = t1.id)
676 (12 rows)
677
678 /*+Leading( )*/
679 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
680 INFO:  pg_hint_plan: hint syntax error at or near "Leading( )"
681 DETAIL:  Leading hint requires at least two relations.
682 LOG:  pg_hint_plan:
683 used hint:
684 not used hint:
685 duplication hint:
686 error hint:
687 Leading()
688
689                     QUERY PLAN                    
690 --------------------------------------------------
691  Nested Loop
692    ->  Merge Join
693          Merge Cond: (t1.id = t4.id)
694          ->  Merge Join
695                Merge Cond: (t1.id = t2.id)
696                ->  Index Scan using t1_pkey on t1
697                ->  Index Scan using t2_pkey on t2
698          ->  Sort
699                Sort Key: t4.id
700                ->  Seq Scan on t4
701    ->  Index Scan using t3_pkey on t3
702          Index Cond: (id = t1.id)
703 (12 rows)
704
705 /*+Leading( t3 )*/
706 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
707 INFO:  pg_hint_plan: hint syntax error at or near "Leading( t3 )"
708 DETAIL:  Leading hint requires at least two relations.
709 LOG:  pg_hint_plan:
710 used hint:
711 not used hint:
712 duplication hint:
713 error hint:
714 Leading(t3)
715
716                     QUERY PLAN                    
717 --------------------------------------------------
718  Nested Loop
719    ->  Merge Join
720          Merge Cond: (t1.id = t4.id)
721          ->  Merge Join
722                Merge Cond: (t1.id = t2.id)
723                ->  Index Scan using t1_pkey on t1
724                ->  Index Scan using t2_pkey on t2
725          ->  Sort
726                Sort Key: t4.id
727                ->  Seq Scan on t4
728    ->  Index Scan using t3_pkey on t3
729          Index Cond: (id = t1.id)
730 (12 rows)
731
732 /*+Leading( t3 t4 )*/
733 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
734 LOG:  pg_hint_plan:
735 used hint:
736 Leading(t3 t4)
737 not used hint:
738 duplication hint:
739 error hint:
740
741                     QUERY PLAN                    
742 --------------------------------------------------
743  Nested Loop
744    ->  Nested Loop
745          ->  Merge Join
746                Merge Cond: (t3.id = t4.id)
747                ->  Index Scan using t3_pkey on t3
748                ->  Sort
749                      Sort Key: t4.id
750                      ->  Seq Scan on t4
751          ->  Index Scan using t2_pkey on t2
752                Index Cond: (id = t3.id)
753    ->  Index Scan using t1_pkey on t1
754          Index Cond: (id = t2.id)
755 (12 rows)
756
757 /*+Leading(t3 t4 t1)*/
758 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
759 LOG:  pg_hint_plan:
760 used hint:
761 Leading(t3 t4 t1)
762 not used hint:
763 duplication hint:
764 error hint:
765
766                     QUERY PLAN                    
767 --------------------------------------------------
768  Nested Loop
769    ->  Merge Join
770          Merge Cond: (t3.id = t1.id)
771          ->  Merge Join
772                Merge Cond: (t3.id = t4.id)
773                ->  Index Scan using t3_pkey on t3
774                ->  Sort
775                      Sort Key: t4.id
776                      ->  Seq Scan on t4
777          ->  Index Scan using t1_pkey on t1
778    ->  Index Scan using t2_pkey on t2
779          Index Cond: (id = t1.id)
780 (12 rows)
781
782 /*+Leading(t3 t4 t1 t2)*/
783 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
784 LOG:  pg_hint_plan:
785 used hint:
786 Leading(t3 t4 t1 t2)
787 not used hint:
788 duplication hint:
789 error hint:
790
791                     QUERY PLAN                    
792 --------------------------------------------------
793  Nested Loop
794    ->  Merge Join
795          Merge Cond: (t3.id = t1.id)
796          ->  Merge Join
797                Merge Cond: (t3.id = t4.id)
798                ->  Index Scan using t3_pkey on t3
799                ->  Sort
800                      Sort Key: t4.id
801                      ->  Seq Scan on t4
802          ->  Index Scan using t1_pkey on t1
803    ->  Index Scan using t2_pkey on t2
804          Index Cond: (id = t1.id)
805 (12 rows)
806
807 /*+Leading(t3 t4 t1 t2 t1)*/
808 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
809 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t4 t1 t2 t1)"
810 DETAIL:  Relation name "t1" is duplicated.
811 LOG:  pg_hint_plan:
812 used hint:
813 not used hint:
814 duplication hint:
815 error hint:
816 Leading(t3 t4 t1 t2 t1)
817
818                     QUERY PLAN                    
819 --------------------------------------------------
820  Nested Loop
821    ->  Merge Join
822          Merge Cond: (t1.id = t4.id)
823          ->  Merge Join
824                Merge Cond: (t1.id = t2.id)
825                ->  Index Scan using t1_pkey on t1
826                ->  Index Scan using t2_pkey on t2
827          ->  Sort
828                Sort Key: t4.id
829                ->  Seq Scan on t4
830    ->  Index Scan using t3_pkey on t3
831          Index Cond: (id = t1.id)
832 (12 rows)
833
834 /*+Leading(t3 t4 t4)*/
835 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
836 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t4 t4)"
837 DETAIL:  Relation name "t4" is duplicated.
838 LOG:  pg_hint_plan:
839 used hint:
840 not used hint:
841 duplication hint:
842 error hint:
843 Leading(t3 t4 t4)
844
845                     QUERY PLAN                    
846 --------------------------------------------------
847  Nested Loop
848    ->  Merge Join
849          Merge Cond: (t1.id = t4.id)
850          ->  Merge Join
851                Merge Cond: (t1.id = t2.id)
852                ->  Index Scan using t1_pkey on t1
853                ->  Index Scan using t2_pkey on t2
854          ->  Sort
855                Sort Key: t4.id
856                ->  Seq Scan on t4
857    ->  Index Scan using t3_pkey on t3
858          Index Cond: (id = t1.id)
859 (12 rows)
860
861 EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
862                   QUERY PLAN                   
863 -----------------------------------------------
864  Nested Loop
865    ->  Values Scan on "*VALUES*"
866    ->  Index Scan using t1_pkey on t1
867          Index Cond: (id = "*VALUES*".column1)
868 (4 rows)
869
870 /*+HashJoin(t1 t2)*/
871 EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
872 LOG:  pg_hint_plan:
873 used hint:
874 not used hint:
875 HashJoin(t1 t2)
876 duplication hint:
877 error hint:
878
879                   QUERY PLAN                   
880 -----------------------------------------------
881  Nested Loop
882    ->  Values Scan on "*VALUES*"
883    ->  Index Scan using t1_pkey on t1
884          Index Cond: (id = "*VALUES*".column1)
885 (4 rows)
886
887 /*+HashJoin(t1 *VALUES*)*/
888 EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
889 LOG:  pg_hint_plan:
890 used hint:
891 HashJoin(*VALUES* t1)
892 not used hint:
893 duplication hint:
894 error hint:
895
896                 QUERY PLAN                 
897 -------------------------------------------
898  Hash Join
899    Hash Cond: (t1.id = "*VALUES*".column1)
900    ->  Seq Scan on t1
901    ->  Hash
902          ->  Values Scan on "*VALUES*"
903 (5 rows)
904
905 /*+HashJoin(t1 *VALUES*) IndexScan(t1) IndexScan(*VALUES*)*/
906 EXPLAIN (COSTS false) SELECT * FROM t1, (VALUES(1,1),(2,2),(3,3)) AS t2(id,val) WHERE t1.id = t2.id;
907 LOG:  pg_hint_plan:
908 used hint:
909 IndexScan(t1)
910 HashJoin(*VALUES* t1)
911 not used hint:
912 IndexScan(*VALUES*)
913 duplication hint:
914 error hint:
915
916                 QUERY PLAN                 
917 -------------------------------------------
918  Hash Join
919    Hash Cond: (t1.id = "*VALUES*".column1)
920    ->  Index Scan using t1_pkey on t1
921    ->  Hash
922          ->  Values Scan on "*VALUES*"
923 (5 rows)
924
925 -- single table scan hint test
926 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
927                                QUERY PLAN                               
928 ------------------------------------------------------------------------
929  Index Only Scan using t1_pkey on t1
930    Index Cond: (id = $3)
931    InitPlan 2 (returns $1)
932      ->  Result
933            InitPlan 1 (returns $0)
934              ->  Limit
935                    ->  Index Only Scan Backward using t1_pkey on t1 v_1
936                          Index Cond: ((id IS NOT NULL) AND (id < 10))
937    InitPlan 4 (returns $3)
938      ->  Result
939            InitPlan 3 (returns $2)
940              ->  Limit
941                    ->  Index Only Scan Backward using t1_pkey on t1 v_2
942                          Index Cond: ((id IS NOT NULL) AND (id < 10))
943 (14 rows)
944
945 /*+BitmapScan(v_1)*/
946 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
947 LOG:  pg_hint_plan:
948 used hint:
949 BitmapScan(v_1)
950 not used hint:
951 duplication hint:
952 error hint:
953
954                                QUERY PLAN                               
955 ------------------------------------------------------------------------
956  Index Only Scan using t1_pkey on t1
957    Index Cond: (id = $3)
958    InitPlan 1 (returns $1)
959      ->  Aggregate
960            ->  Bitmap Heap Scan on t1 v_1
961                  Recheck Cond: (id < 10)
962                  ->  Bitmap Index Scan on t1_pkey
963                        Index Cond: (id < 10)
964    InitPlan 3 (returns $3)
965      ->  Result
966            InitPlan 2 (returns $2)
967              ->  Limit
968                    ->  Index Only Scan Backward using t1_pkey on t1 v_2
969                          Index Cond: ((id IS NOT NULL) AND (id < 10))
970 (14 rows)
971
972 /*+BitmapScan(v_2)*/
973 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
974 LOG:  pg_hint_plan:
975 used hint:
976 BitmapScan(v_2)
977 not used hint:
978 duplication hint:
979 error hint:
980
981                                QUERY PLAN                               
982 ------------------------------------------------------------------------
983  Index Only Scan using t1_pkey on t1
984    Index Cond: (id = $3)
985    InitPlan 2 (returns $1)
986      ->  Result
987            InitPlan 1 (returns $0)
988              ->  Limit
989                    ->  Index Only Scan Backward using t1_pkey on t1 v_1
990                          Index Cond: ((id IS NOT NULL) AND (id < 10))
991    InitPlan 3 (returns $3)
992      ->  Aggregate
993            ->  Bitmap Heap Scan on t1 v_2
994                  Recheck Cond: (id < 10)
995                  ->  Bitmap Index Scan on t1_pkey
996                        Index Cond: (id < 10)
997 (14 rows)
998
999 /*+BitmapScan(t1)*/
1000 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
1001 LOG:  pg_hint_plan:
1002 used hint:
1003 BitmapScan(t1)
1004 not used hint:
1005 duplication hint:
1006 error hint:
1007
1008                                QUERY PLAN                               
1009 ------------------------------------------------------------------------
1010  Bitmap Heap Scan on t1
1011    Recheck Cond: (id = $3)
1012    InitPlan 2 (returns $1)
1013      ->  Result
1014            InitPlan 1 (returns $0)
1015              ->  Limit
1016                    ->  Index Only Scan Backward using t1_pkey on t1 v_1
1017                          Index Cond: ((id IS NOT NULL) AND (id < 10))
1018    InitPlan 4 (returns $3)
1019      ->  Result
1020            InitPlan 3 (returns $2)
1021              ->  Limit
1022                    ->  Index Only Scan Backward using t1_pkey on t1 v_2
1023                          Index Cond: ((id IS NOT NULL) AND (id < 10))
1024    ->  Bitmap Index Scan on t1_pkey
1025          Index Cond: (id = $3)
1026 (16 rows)
1027
1028 /*+BitmapScan(v_1)BitmapScan(v_2)*/
1029 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
1030 LOG:  pg_hint_plan:
1031 used hint:
1032 BitmapScan(v_1)
1033 BitmapScan(v_2)
1034 not used hint:
1035 duplication hint:
1036 error hint:
1037
1038                     QUERY PLAN                    
1039 --------------------------------------------------
1040  Index Only Scan using t1_pkey on t1
1041    Index Cond: (id = $3)
1042    InitPlan 1 (returns $1)
1043      ->  Aggregate
1044            ->  Bitmap Heap Scan on t1 v_1
1045                  Recheck Cond: (id < 10)
1046                  ->  Bitmap Index Scan on t1_pkey
1047                        Index Cond: (id < 10)
1048    InitPlan 2 (returns $3)
1049      ->  Aggregate
1050            ->  Bitmap Heap Scan on t1 v_2
1051                  Recheck Cond: (id < 10)
1052                  ->  Bitmap Index Scan on t1_pkey
1053                        Index Cond: (id < 10)
1054 (14 rows)
1055
1056 /*+BitmapScan(v_1)BitmapScan(t1)*/
1057 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
1058 LOG:  pg_hint_plan:
1059 used hint:
1060 BitmapScan(t1)
1061 BitmapScan(v_1)
1062 not used hint:
1063 duplication hint:
1064 error hint:
1065
1066                                QUERY PLAN                               
1067 ------------------------------------------------------------------------
1068  Bitmap Heap Scan on t1
1069    Recheck Cond: (id = $3)
1070    InitPlan 1 (returns $1)
1071      ->  Aggregate
1072            ->  Bitmap Heap Scan on t1 v_1
1073                  Recheck Cond: (id < 10)
1074                  ->  Bitmap Index Scan on t1_pkey
1075                        Index Cond: (id < 10)
1076    InitPlan 3 (returns $3)
1077      ->  Result
1078            InitPlan 2 (returns $2)
1079              ->  Limit
1080                    ->  Index Only Scan Backward using t1_pkey on t1 v_2
1081                          Index Cond: ((id IS NOT NULL) AND (id < 10))
1082    ->  Bitmap Index Scan on t1_pkey
1083          Index Cond: (id = $3)
1084 (16 rows)
1085
1086 /*+BitmapScan(v_2)BitmapScan(t1)*/
1087 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
1088 LOG:  pg_hint_plan:
1089 used hint:
1090 BitmapScan(t1)
1091 BitmapScan(v_2)
1092 not used hint:
1093 duplication hint:
1094 error hint:
1095
1096                                QUERY PLAN                               
1097 ------------------------------------------------------------------------
1098  Bitmap Heap Scan on t1
1099    Recheck Cond: (id = $3)
1100    InitPlan 2 (returns $1)
1101      ->  Result
1102            InitPlan 1 (returns $0)
1103              ->  Limit
1104                    ->  Index Only Scan Backward using t1_pkey on t1 v_1
1105                          Index Cond: ((id IS NOT NULL) AND (id < 10))
1106    InitPlan 3 (returns $3)
1107      ->  Aggregate
1108            ->  Bitmap Heap Scan on t1 v_2
1109                  Recheck Cond: (id < 10)
1110                  ->  Bitmap Index Scan on t1_pkey
1111                        Index Cond: (id < 10)
1112    ->  Bitmap Index Scan on t1_pkey
1113          Index Cond: (id = $3)
1114 (16 rows)
1115
1116 /*+BitmapScan(v_1)BitmapScan(v_2)BitmapScan(t1)*/
1117 EXPLAIN (COSTS false) SELECT (SELECT max(id) FROM t1 v_1 WHERE id < 10), id FROM v1 WHERE v1.id = (SELECT max(id) FROM t1 v_2 WHERE id < 10);
1118 LOG:  pg_hint_plan:
1119 used hint:
1120 BitmapScan(t1)
1121 BitmapScan(v_1)
1122 BitmapScan(v_2)
1123 not used hint:
1124 duplication hint:
1125 error hint:
1126
1127                     QUERY PLAN                    
1128 --------------------------------------------------
1129  Bitmap Heap Scan on t1
1130    Recheck Cond: (id = $3)
1131    InitPlan 1 (returns $1)
1132      ->  Aggregate
1133            ->  Bitmap Heap Scan on t1 v_1
1134                  Recheck Cond: (id < 10)
1135                  ->  Bitmap Index Scan on t1_pkey
1136                        Index Cond: (id < 10)
1137    InitPlan 2 (returns $3)
1138      ->  Aggregate
1139            ->  Bitmap Heap Scan on t1 v_2
1140                  Recheck Cond: (id < 10)
1141                  ->  Bitmap Index Scan on t1_pkey
1142                        Index Cond: (id < 10)
1143    ->  Bitmap Index Scan on t1_pkey
1144          Index Cond: (id = $3)
1145 (16 rows)
1146
1147 -- full scan hint pattern test
1148 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1149             QUERY PLAN             
1150 -----------------------------------
1151  Tid Scan on t1
1152    TID Cond: (ctid = '(1,1)'::tid)
1153    Filter: (id < 10)
1154 (3 rows)
1155
1156 /*+SeqScan(t1)*/
1157 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1158 LOG:  pg_hint_plan:
1159 used hint:
1160 SeqScan(t1)
1161 not used hint:
1162 duplication hint:
1163 error hint:
1164
1165                    QUERY PLAN                    
1166 -------------------------------------------------
1167  Seq Scan on t1
1168    Filter: ((id < 10) AND (ctid = '(1,1)'::tid))
1169 (2 rows)
1170
1171 /*+IndexScan(t1)*/
1172 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1173 LOG:  pg_hint_plan:
1174 used hint:
1175 IndexScan(t1)
1176 not used hint:
1177 duplication hint:
1178 error hint:
1179
1180            QUERY PLAN            
1181 ---------------------------------
1182  Index Scan using t1_pkey on t1
1183    Index Cond: (id < 10)
1184    Filter: (ctid = '(1,1)'::tid)
1185 (3 rows)
1186
1187 /*+BitmapScan(t1)*/
1188 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1189 LOG:  pg_hint_plan:
1190 used hint:
1191 BitmapScan(t1)
1192 not used hint:
1193 duplication hint:
1194 error hint:
1195
1196              QUERY PLAN             
1197 ------------------------------------
1198  Bitmap Heap Scan on t1
1199    Recheck Cond: (id < 10)
1200    Filter: (ctid = '(1,1)'::tid)
1201    ->  Bitmap Index Scan on t1_pkey
1202          Index Cond: (id < 10)
1203 (5 rows)
1204
1205 /*+TidScan(t1)*/
1206 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1207 LOG:  pg_hint_plan:
1208 used hint:
1209 TidScan(t1)
1210 not used hint:
1211 duplication hint:
1212 error hint:
1213
1214             QUERY PLAN             
1215 -----------------------------------
1216  Tid Scan on t1
1217    TID Cond: (ctid = '(1,1)'::tid)
1218    Filter: (id < 10)
1219 (3 rows)
1220
1221 /*+NoSeqScan(t1)*/
1222 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1223 LOG:  pg_hint_plan:
1224 used hint:
1225 NoSeqScan(t1)
1226 not used hint:
1227 duplication hint:
1228 error hint:
1229
1230             QUERY PLAN             
1231 -----------------------------------
1232  Tid Scan on t1
1233    TID Cond: (ctid = '(1,1)'::tid)
1234    Filter: (id < 10)
1235 (3 rows)
1236
1237 /*+NoIndexScan(t1)*/
1238 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1239 LOG:  pg_hint_plan:
1240 used hint:
1241 NoIndexScan(t1)
1242 not used hint:
1243 duplication hint:
1244 error hint:
1245
1246             QUERY PLAN             
1247 -----------------------------------
1248  Tid Scan on t1
1249    TID Cond: (ctid = '(1,1)'::tid)
1250    Filter: (id < 10)
1251 (3 rows)
1252
1253 /*+NoBitmapScan(t1)*/
1254 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1255 LOG:  pg_hint_plan:
1256 used hint:
1257 NoBitmapScan(t1)
1258 not used hint:
1259 duplication hint:
1260 error hint:
1261
1262             QUERY PLAN             
1263 -----------------------------------
1264  Tid Scan on t1
1265    TID Cond: (ctid = '(1,1)'::tid)
1266    Filter: (id < 10)
1267 (3 rows)
1268
1269 /*+NoTidScan(t1)*/
1270 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE id < 10 AND ctid = '(1,1)';
1271 LOG:  pg_hint_plan:
1272 used hint:
1273 NoTidScan(t1)
1274 not used hint:
1275 duplication hint:
1276 error hint:
1277
1278            QUERY PLAN            
1279 ---------------------------------
1280  Index Scan using t1_pkey on t1
1281    Index Cond: (id < 10)
1282    Filter: (ctid = '(1,1)'::tid)
1283 (3 rows)
1284
1285 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1286                QUERY PLAN                
1287 -----------------------------------------
1288  Nested Loop
1289    Join Filter: (t1.id = t2.id)
1290    ->  Tid Scan on t1
1291          TID Cond: (ctid = '(1,1)'::tid)
1292    ->  Tid Scan on t2
1293          TID Cond: (ctid = '(1,1)'::tid)
1294 (6 rows)
1295
1296 /*+SeqScan(t1)*/
1297 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1298 LOG:  pg_hint_plan:
1299 used hint:
1300 SeqScan(t1)
1301 not used hint:
1302 duplication hint:
1303 error hint:
1304
1305                QUERY PLAN                
1306 -----------------------------------------
1307  Nested Loop
1308    Join Filter: (t1.id = t2.id)
1309    ->  Seq Scan on t1
1310          Filter: (ctid = '(1,1)'::tid)
1311    ->  Tid Scan on t2
1312          TID Cond: (ctid = '(1,1)'::tid)
1313 (6 rows)
1314
1315 /*+SeqScan(t2)*/
1316 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1317 LOG:  pg_hint_plan:
1318 used hint:
1319 SeqScan(t2)
1320 not used hint:
1321 duplication hint:
1322 error hint:
1323
1324                QUERY PLAN                
1325 -----------------------------------------
1326  Nested Loop
1327    Join Filter: (t1.id = t2.id)
1328    ->  Tid Scan on t1
1329          TID Cond: (ctid = '(1,1)'::tid)
1330    ->  Seq Scan on t2
1331          Filter: (ctid = '(1,1)'::tid)
1332 (6 rows)
1333
1334 /*+SeqScan(t1) SeqScan(t2)*/
1335 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1336 LOG:  pg_hint_plan:
1337 used hint:
1338 SeqScan(t1)
1339 SeqScan(t2)
1340 not used hint:
1341 duplication hint:
1342 error hint:
1343
1344               QUERY PLAN               
1345 ---------------------------------------
1346  Nested Loop
1347    Join Filter: (t1.id = t2.id)
1348    ->  Seq Scan on t1
1349          Filter: (ctid = '(1,1)'::tid)
1350    ->  Seq Scan on t2
1351          Filter: (ctid = '(1,1)'::tid)
1352 (6 rows)
1353
1354 /*+SeqScan(t1) IndexScan(t2)*/
1355 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1356 LOG:  pg_hint_plan:
1357 used hint:
1358 SeqScan(t1)
1359 IndexScan(t2)
1360 not used hint:
1361 duplication hint:
1362 error hint:
1363
1364               QUERY PLAN               
1365 ---------------------------------------
1366  Nested Loop
1367    ->  Seq Scan on t1
1368          Filter: (ctid = '(1,1)'::tid)
1369    ->  Index Scan using t2_pkey on t2
1370          Index Cond: (id = t1.id)
1371          Filter: (ctid = '(1,1)'::tid)
1372 (6 rows)
1373
1374 /*+SeqScan(t1) BitmapScan(t2)*/
1375 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1376 LOG:  pg_hint_plan:
1377 used hint:
1378 SeqScan(t1)
1379 BitmapScan(t2)
1380 not used hint:
1381 duplication hint:
1382 error hint:
1383
1384                 QUERY PLAN                
1385 ------------------------------------------
1386  Nested Loop
1387    ->  Seq Scan on t1
1388          Filter: (ctid = '(1,1)'::tid)
1389    ->  Bitmap Heap Scan on t2
1390          Recheck Cond: (id = t1.id)
1391          Filter: (ctid = '(1,1)'::tid)
1392          ->  Bitmap Index Scan on t2_pkey
1393                Index Cond: (id = t1.id)
1394 (8 rows)
1395
1396 /*+SeqScan(t1) TidScan(t2)*/
1397 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1398 LOG:  pg_hint_plan:
1399 used hint:
1400 SeqScan(t1)
1401 TidScan(t2)
1402 not used hint:
1403 duplication hint:
1404 error hint:
1405
1406                QUERY PLAN                
1407 -----------------------------------------
1408  Nested Loop
1409    Join Filter: (t1.id = t2.id)
1410    ->  Seq Scan on t1
1411          Filter: (ctid = '(1,1)'::tid)
1412    ->  Tid Scan on t2
1413          TID Cond: (ctid = '(1,1)'::tid)
1414 (6 rows)
1415
1416 /*+SeqScan(t1) NoSeqScan(t2)*/
1417 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1418 LOG:  pg_hint_plan:
1419 used hint:
1420 SeqScan(t1)
1421 NoSeqScan(t2)
1422 not used hint:
1423 duplication hint:
1424 error hint:
1425
1426                QUERY PLAN                
1427 -----------------------------------------
1428  Nested Loop
1429    Join Filter: (t1.id = t2.id)
1430    ->  Seq Scan on t1
1431          Filter: (ctid = '(1,1)'::tid)
1432    ->  Tid Scan on t2
1433          TID Cond: (ctid = '(1,1)'::tid)
1434 (6 rows)
1435
1436 /*+SeqScan(t1) NoIndexScan(t2)*/
1437 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1438 LOG:  pg_hint_plan:
1439 used hint:
1440 SeqScan(t1)
1441 NoIndexScan(t2)
1442 not used hint:
1443 duplication hint:
1444 error hint:
1445
1446                QUERY PLAN                
1447 -----------------------------------------
1448  Nested Loop
1449    Join Filter: (t1.id = t2.id)
1450    ->  Seq Scan on t1
1451          Filter: (ctid = '(1,1)'::tid)
1452    ->  Tid Scan on t2
1453          TID Cond: (ctid = '(1,1)'::tid)
1454 (6 rows)
1455
1456 /*+SeqScan(t1) NoBitmapScan(t2)*/
1457 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1458 LOG:  pg_hint_plan:
1459 used hint:
1460 SeqScan(t1)
1461 NoBitmapScan(t2)
1462 not used hint:
1463 duplication hint:
1464 error hint:
1465
1466                QUERY PLAN                
1467 -----------------------------------------
1468  Nested Loop
1469    Join Filter: (t1.id = t2.id)
1470    ->  Seq Scan on t1
1471          Filter: (ctid = '(1,1)'::tid)
1472    ->  Tid Scan on t2
1473          TID Cond: (ctid = '(1,1)'::tid)
1474 (6 rows)
1475
1476 /*+SeqScan(t1) NoTidScan(t2)*/
1477 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1478 LOG:  pg_hint_plan:
1479 used hint:
1480 SeqScan(t1)
1481 NoTidScan(t2)
1482 not used hint:
1483 duplication hint:
1484 error hint:
1485
1486               QUERY PLAN               
1487 ---------------------------------------
1488  Nested Loop
1489    Join Filter: (t1.id = t2.id)
1490    ->  Seq Scan on t1
1491          Filter: (ctid = '(1,1)'::tid)
1492    ->  Seq Scan on t2
1493          Filter: (ctid = '(1,1)'::tid)
1494 (6 rows)
1495
1496 /*+IndexScan(t1)*/
1497 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1498 LOG:  pg_hint_plan:
1499 used hint:
1500 IndexScan(t1)
1501 not used hint:
1502 duplication hint:
1503 error hint:
1504
1505                QUERY PLAN                
1506 -----------------------------------------
1507  Nested Loop
1508    ->  Tid Scan on t2
1509          TID Cond: (ctid = '(1,1)'::tid)
1510    ->  Index Scan using t1_pkey on t1
1511          Index Cond: (id = t2.id)
1512          Filter: (ctid = '(1,1)'::tid)
1513 (6 rows)
1514
1515 /*+IndexScan(t2)*/
1516 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1517 LOG:  pg_hint_plan:
1518 used hint:
1519 IndexScan(t2)
1520 not used hint:
1521 duplication hint:
1522 error hint:
1523
1524                QUERY PLAN                
1525 -----------------------------------------
1526  Nested Loop
1527    ->  Tid Scan on t1
1528          TID Cond: (ctid = '(1,1)'::tid)
1529    ->  Index Scan using t2_pkey on t2
1530          Index Cond: (id = t1.id)
1531          Filter: (ctid = '(1,1)'::tid)
1532 (6 rows)
1533
1534 /*+IndexScan(t1) SeqScan(t2)*/
1535 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1536 LOG:  pg_hint_plan:
1537 used hint:
1538 IndexScan(t1)
1539 SeqScan(t2)
1540 not used hint:
1541 duplication hint:
1542 error hint:
1543
1544               QUERY PLAN               
1545 ---------------------------------------
1546  Nested Loop
1547    ->  Seq Scan on t2
1548          Filter: (ctid = '(1,1)'::tid)
1549    ->  Index Scan using t1_pkey on t1
1550          Index Cond: (id = t2.id)
1551          Filter: (ctid = '(1,1)'::tid)
1552 (6 rows)
1553
1554 /*+IndexScan(t1) IndexScan(t2)*/
1555 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1556 LOG:  pg_hint_plan:
1557 used hint:
1558 IndexScan(t1)
1559 IndexScan(t2)
1560 not used hint:
1561 duplication hint:
1562 error hint:
1563
1564               QUERY PLAN               
1565 ---------------------------------------
1566  Nested Loop
1567    ->  Index Scan using t2_pkey on t2
1568          Filter: (ctid = '(1,1)'::tid)
1569    ->  Index Scan using t1_pkey on t1
1570          Index Cond: (id = t2.id)
1571          Filter: (ctid = '(1,1)'::tid)
1572 (6 rows)
1573
1574 /*+IndexScan(t1) BitmapScan(t2)*/
1575 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1576 LOG:  pg_hint_plan:
1577 used hint:
1578 IndexScan(t1)
1579 BitmapScan(t2)
1580 not used hint:
1581 duplication hint:
1582 error hint:
1583
1584                 QUERY PLAN                
1585 ------------------------------------------
1586  Nested Loop
1587    ->  Index Scan using t1_pkey on t1
1588          Filter: (ctid = '(1,1)'::tid)
1589    ->  Bitmap Heap Scan on t2
1590          Recheck Cond: (id = t1.id)
1591          Filter: (ctid = '(1,1)'::tid)
1592          ->  Bitmap Index Scan on t2_pkey
1593                Index Cond: (id = t1.id)
1594 (8 rows)
1595
1596 /*+IndexScan(t1) TidScan(t2)*/
1597 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1598 LOG:  pg_hint_plan:
1599 used hint:
1600 IndexScan(t1)
1601 TidScan(t2)
1602 not used hint:
1603 duplication hint:
1604 error hint:
1605
1606                QUERY PLAN                
1607 -----------------------------------------
1608  Nested Loop
1609    ->  Tid Scan on t2
1610          TID Cond: (ctid = '(1,1)'::tid)
1611    ->  Index Scan using t1_pkey on t1
1612          Index Cond: (id = t2.id)
1613          Filter: (ctid = '(1,1)'::tid)
1614 (6 rows)
1615
1616 /*+IndexScan(t1) NoSeqScan(t2)*/
1617 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1618 LOG:  pg_hint_plan:
1619 used hint:
1620 IndexScan(t1)
1621 NoSeqScan(t2)
1622 not used hint:
1623 duplication hint:
1624 error hint:
1625
1626                QUERY PLAN                
1627 -----------------------------------------
1628  Nested Loop
1629    ->  Tid Scan on t2
1630          TID Cond: (ctid = '(1,1)'::tid)
1631    ->  Index Scan using t1_pkey on t1
1632          Index Cond: (id = t2.id)
1633          Filter: (ctid = '(1,1)'::tid)
1634 (6 rows)
1635
1636 /*+IndexScan(t1) NoIndexScan(t2)*/
1637 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1638 LOG:  pg_hint_plan:
1639 used hint:
1640 IndexScan(t1)
1641 NoIndexScan(t2)
1642 not used hint:
1643 duplication hint:
1644 error hint:
1645
1646                QUERY PLAN                
1647 -----------------------------------------
1648  Nested Loop
1649    ->  Tid Scan on t2
1650          TID Cond: (ctid = '(1,1)'::tid)
1651    ->  Index Scan using t1_pkey on t1
1652          Index Cond: (id = t2.id)
1653          Filter: (ctid = '(1,1)'::tid)
1654 (6 rows)
1655
1656 /*+IndexScan(t1) NoBitmapScan(t2)*/
1657 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1658 LOG:  pg_hint_plan:
1659 used hint:
1660 IndexScan(t1)
1661 NoBitmapScan(t2)
1662 not used hint:
1663 duplication hint:
1664 error hint:
1665
1666                QUERY PLAN                
1667 -----------------------------------------
1668  Nested Loop
1669    ->  Tid Scan on t2
1670          TID Cond: (ctid = '(1,1)'::tid)
1671    ->  Index Scan using t1_pkey on t1
1672          Index Cond: (id = t2.id)
1673          Filter: (ctid = '(1,1)'::tid)
1674 (6 rows)
1675
1676 /*+IndexScan(t1) NoTidScan(t2)*/
1677 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1678 LOG:  pg_hint_plan:
1679 used hint:
1680 IndexScan(t1)
1681 NoTidScan(t2)
1682 not used hint:
1683 duplication hint:
1684 error hint:
1685
1686               QUERY PLAN               
1687 ---------------------------------------
1688  Nested Loop
1689    ->  Seq Scan on t2
1690          Filter: (ctid = '(1,1)'::tid)
1691    ->  Index Scan using t1_pkey on t1
1692          Index Cond: (id = t2.id)
1693          Filter: (ctid = '(1,1)'::tid)
1694 (6 rows)
1695
1696 /*+BitmapScan(t1)*/
1697 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1698 LOG:  pg_hint_plan:
1699 used hint:
1700 BitmapScan(t1)
1701 not used hint:
1702 duplication hint:
1703 error hint:
1704
1705                 QUERY PLAN                
1706 ------------------------------------------
1707  Nested Loop
1708    ->  Tid Scan on t2
1709          TID Cond: (ctid = '(1,1)'::tid)
1710    ->  Bitmap Heap Scan on t1
1711          Recheck Cond: (id = t2.id)
1712          Filter: (ctid = '(1,1)'::tid)
1713          ->  Bitmap Index Scan on t1_pkey
1714                Index Cond: (id = t2.id)
1715 (8 rows)
1716
1717 /*+BitmapScan(t2)*/
1718 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1719 LOG:  pg_hint_plan:
1720 used hint:
1721 BitmapScan(t2)
1722 not used hint:
1723 duplication hint:
1724 error hint:
1725
1726                 QUERY PLAN                
1727 ------------------------------------------
1728  Nested Loop
1729    ->  Tid Scan on t1
1730          TID Cond: (ctid = '(1,1)'::tid)
1731    ->  Bitmap Heap Scan on t2
1732          Recheck Cond: (id = t1.id)
1733          Filter: (ctid = '(1,1)'::tid)
1734          ->  Bitmap Index Scan on t2_pkey
1735                Index Cond: (id = t1.id)
1736 (8 rows)
1737
1738 /*+BitmapScan(t2)*/
1739 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1740 LOG:  pg_hint_plan:
1741 used hint:
1742 BitmapScan(t2)
1743 not used hint:
1744 duplication hint:
1745 error hint:
1746
1747                 QUERY PLAN                
1748 ------------------------------------------
1749  Nested Loop
1750    ->  Tid Scan on t1
1751          TID Cond: (ctid = '(1,1)'::tid)
1752    ->  Bitmap Heap Scan on t2
1753          Recheck Cond: (id = t1.id)
1754          Filter: (ctid = '(1,1)'::tid)
1755          ->  Bitmap Index Scan on t2_pkey
1756                Index Cond: (id = t1.id)
1757 (8 rows)
1758
1759 /*+BitmapScan(t1) SeqScan(t2)*/
1760 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1761 LOG:  pg_hint_plan:
1762 used hint:
1763 BitmapScan(t1)
1764 SeqScan(t2)
1765 not used hint:
1766 duplication hint:
1767 error hint:
1768
1769                 QUERY PLAN                
1770 ------------------------------------------
1771  Nested Loop
1772    ->  Seq Scan on t2
1773          Filter: (ctid = '(1,1)'::tid)
1774    ->  Bitmap Heap Scan on t1
1775          Recheck Cond: (id = t2.id)
1776          Filter: (ctid = '(1,1)'::tid)
1777          ->  Bitmap Index Scan on t1_pkey
1778                Index Cond: (id = t2.id)
1779 (8 rows)
1780
1781 /*+BitmapScan(t1) IndexScan(t2)*/
1782 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1783 LOG:  pg_hint_plan:
1784 used hint:
1785 BitmapScan(t1)
1786 IndexScan(t2)
1787 not used hint:
1788 duplication hint:
1789 error hint:
1790
1791                 QUERY PLAN                
1792 ------------------------------------------
1793  Nested Loop
1794    ->  Index Scan using t2_pkey on t2
1795          Filter: (ctid = '(1,1)'::tid)
1796    ->  Bitmap Heap Scan on t1
1797          Recheck Cond: (id = t2.id)
1798          Filter: (ctid = '(1,1)'::tid)
1799          ->  Bitmap Index Scan on t1_pkey
1800                Index Cond: (id = t2.id)
1801 (8 rows)
1802
1803 /*+BitmapScan(t1) BitmapScan(t2)*/
1804 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1805 LOG:  pg_hint_plan:
1806 used hint:
1807 BitmapScan(t1)
1808 BitmapScan(t2)
1809 not used hint:
1810 duplication hint:
1811 error hint:
1812
1813                 QUERY PLAN                
1814 ------------------------------------------
1815  Nested Loop
1816    ->  Index Scan using t2_pkey on t2
1817          Filter: (ctid = '(1,1)'::tid)
1818    ->  Bitmap Heap Scan on t1
1819          Recheck Cond: (id = t2.id)
1820          Filter: (ctid = '(1,1)'::tid)
1821          ->  Bitmap Index Scan on t1_pkey
1822                Index Cond: (id = t2.id)
1823 (8 rows)
1824
1825 /*+BitmapScan(t1) TidScan(t2)*/
1826 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1827 LOG:  pg_hint_plan:
1828 used hint:
1829 BitmapScan(t1)
1830 TidScan(t2)
1831 not used hint:
1832 duplication hint:
1833 error hint:
1834
1835                 QUERY PLAN                
1836 ------------------------------------------
1837  Nested Loop
1838    ->  Tid Scan on t2
1839          TID Cond: (ctid = '(1,1)'::tid)
1840    ->  Bitmap Heap Scan on t1
1841          Recheck Cond: (id = t2.id)
1842          Filter: (ctid = '(1,1)'::tid)
1843          ->  Bitmap Index Scan on t1_pkey
1844                Index Cond: (id = t2.id)
1845 (8 rows)
1846
1847 /*+BitmapScan(t1) NoSeqScan(t2)*/
1848 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1849 LOG:  pg_hint_plan:
1850 used hint:
1851 BitmapScan(t1)
1852 NoSeqScan(t2)
1853 not used hint:
1854 duplication hint:
1855 error hint:
1856
1857                 QUERY PLAN                
1858 ------------------------------------------
1859  Nested Loop
1860    ->  Tid Scan on t2
1861          TID Cond: (ctid = '(1,1)'::tid)
1862    ->  Bitmap Heap Scan on t1
1863          Recheck Cond: (id = t2.id)
1864          Filter: (ctid = '(1,1)'::tid)
1865          ->  Bitmap Index Scan on t1_pkey
1866                Index Cond: (id = t2.id)
1867 (8 rows)
1868
1869 /*+BitmapScan(t1) NoIndexScan(t2)*/
1870 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1871 LOG:  pg_hint_plan:
1872 used hint:
1873 BitmapScan(t1)
1874 NoIndexScan(t2)
1875 not used hint:
1876 duplication hint:
1877 error hint:
1878
1879                 QUERY PLAN                
1880 ------------------------------------------
1881  Nested Loop
1882    ->  Tid Scan on t2
1883          TID Cond: (ctid = '(1,1)'::tid)
1884    ->  Bitmap Heap Scan on t1
1885          Recheck Cond: (id = t2.id)
1886          Filter: (ctid = '(1,1)'::tid)
1887          ->  Bitmap Index Scan on t1_pkey
1888                Index Cond: (id = t2.id)
1889 (8 rows)
1890
1891 /*+BitmapScan(t1) NoBitmapScan(t2)*/
1892 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1893 LOG:  pg_hint_plan:
1894 used hint:
1895 BitmapScan(t1)
1896 NoBitmapScan(t2)
1897 not used hint:
1898 duplication hint:
1899 error hint:
1900
1901                 QUERY PLAN                
1902 ------------------------------------------
1903  Nested Loop
1904    ->  Tid Scan on t2
1905          TID Cond: (ctid = '(1,1)'::tid)
1906    ->  Bitmap Heap Scan on t1
1907          Recheck Cond: (id = t2.id)
1908          Filter: (ctid = '(1,1)'::tid)
1909          ->  Bitmap Index Scan on t1_pkey
1910                Index Cond: (id = t2.id)
1911 (8 rows)
1912
1913 /*+BitmapScan(t1) NoTidScan(t2)*/
1914 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1915 LOG:  pg_hint_plan:
1916 used hint:
1917 BitmapScan(t1)
1918 NoTidScan(t2)
1919 not used hint:
1920 duplication hint:
1921 error hint:
1922
1923                 QUERY PLAN                
1924 ------------------------------------------
1925  Nested Loop
1926    ->  Seq Scan on t2
1927          Filter: (ctid = '(1,1)'::tid)
1928    ->  Bitmap Heap Scan on t1
1929          Recheck Cond: (id = t2.id)
1930          Filter: (ctid = '(1,1)'::tid)
1931          ->  Bitmap Index Scan on t1_pkey
1932                Index Cond: (id = t2.id)
1933 (8 rows)
1934
1935 /*+TidScan(t1)*/
1936 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1937 LOG:  pg_hint_plan:
1938 used hint:
1939 TidScan(t1)
1940 not used hint:
1941 duplication hint:
1942 error hint:
1943
1944                QUERY PLAN                
1945 -----------------------------------------
1946  Nested Loop
1947    Join Filter: (t1.id = t2.id)
1948    ->  Tid Scan on t1
1949          TID Cond: (ctid = '(1,1)'::tid)
1950    ->  Tid Scan on t2
1951          TID Cond: (ctid = '(1,1)'::tid)
1952 (6 rows)
1953
1954 /*+TidScan(t2)*/
1955 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1956 LOG:  pg_hint_plan:
1957 used hint:
1958 TidScan(t2)
1959 not used hint:
1960 duplication hint:
1961 error hint:
1962
1963                QUERY PLAN                
1964 -----------------------------------------
1965  Nested Loop
1966    Join Filter: (t1.id = t2.id)
1967    ->  Tid Scan on t1
1968          TID Cond: (ctid = '(1,1)'::tid)
1969    ->  Tid Scan on t2
1970          TID Cond: (ctid = '(1,1)'::tid)
1971 (6 rows)
1972
1973 /*+TidScan(t1) SeqScan(t2)*/
1974 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1975 LOG:  pg_hint_plan:
1976 used hint:
1977 TidScan(t1)
1978 SeqScan(t2)
1979 not used hint:
1980 duplication hint:
1981 error hint:
1982
1983                QUERY PLAN                
1984 -----------------------------------------
1985  Nested Loop
1986    Join Filter: (t1.id = t2.id)
1987    ->  Tid Scan on t1
1988          TID Cond: (ctid = '(1,1)'::tid)
1989    ->  Seq Scan on t2
1990          Filter: (ctid = '(1,1)'::tid)
1991 (6 rows)
1992
1993 /*+TidScan(t1) IndexScan(t2)*/
1994 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
1995 LOG:  pg_hint_plan:
1996 used hint:
1997 TidScan(t1)
1998 IndexScan(t2)
1999 not used hint:
2000 duplication hint:
2001 error hint:
2002
2003                QUERY PLAN                
2004 -----------------------------------------
2005  Nested Loop
2006    ->  Tid Scan on t1
2007          TID Cond: (ctid = '(1,1)'::tid)
2008    ->  Index Scan using t2_pkey on t2
2009          Index Cond: (id = t1.id)
2010          Filter: (ctid = '(1,1)'::tid)
2011 (6 rows)
2012
2013 /*+TidScan(t1) BitmapScan(t2)*/
2014 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2015 LOG:  pg_hint_plan:
2016 used hint:
2017 TidScan(t1)
2018 BitmapScan(t2)
2019 not used hint:
2020 duplication hint:
2021 error hint:
2022
2023                 QUERY PLAN                
2024 ------------------------------------------
2025  Nested Loop
2026    ->  Tid Scan on t1
2027          TID Cond: (ctid = '(1,1)'::tid)
2028    ->  Bitmap Heap Scan on t2
2029          Recheck Cond: (id = t1.id)
2030          Filter: (ctid = '(1,1)'::tid)
2031          ->  Bitmap Index Scan on t2_pkey
2032                Index Cond: (id = t1.id)
2033 (8 rows)
2034
2035 /*+TidScan(t1) TidScan(t2)*/
2036 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2037 LOG:  pg_hint_plan:
2038 used hint:
2039 TidScan(t1)
2040 TidScan(t2)
2041 not used hint:
2042 duplication hint:
2043 error hint:
2044
2045                QUERY PLAN                
2046 -----------------------------------------
2047  Nested Loop
2048    Join Filter: (t1.id = t2.id)
2049    ->  Tid Scan on t1
2050          TID Cond: (ctid = '(1,1)'::tid)
2051    ->  Tid Scan on t2
2052          TID Cond: (ctid = '(1,1)'::tid)
2053 (6 rows)
2054
2055 /*+TidScan(t1) NoSeqScan(t2)*/
2056 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2057 LOG:  pg_hint_plan:
2058 used hint:
2059 TidScan(t1)
2060 NoSeqScan(t2)
2061 not used hint:
2062 duplication hint:
2063 error hint:
2064
2065                QUERY PLAN                
2066 -----------------------------------------
2067  Nested Loop
2068    Join Filter: (t1.id = t2.id)
2069    ->  Tid Scan on t1
2070          TID Cond: (ctid = '(1,1)'::tid)
2071    ->  Tid Scan on t2
2072          TID Cond: (ctid = '(1,1)'::tid)
2073 (6 rows)
2074
2075 /*+TidScan(t1) NoIndexScan(t2)*/
2076 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2077 LOG:  pg_hint_plan:
2078 used hint:
2079 TidScan(t1)
2080 NoIndexScan(t2)
2081 not used hint:
2082 duplication hint:
2083 error hint:
2084
2085                QUERY PLAN                
2086 -----------------------------------------
2087  Nested Loop
2088    Join Filter: (t1.id = t2.id)
2089    ->  Tid Scan on t1
2090          TID Cond: (ctid = '(1,1)'::tid)
2091    ->  Tid Scan on t2
2092          TID Cond: (ctid = '(1,1)'::tid)
2093 (6 rows)
2094
2095 /*+TidScan(t1) NoBitmapScan(t2)*/
2096 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2097 LOG:  pg_hint_plan:
2098 used hint:
2099 TidScan(t1)
2100 NoBitmapScan(t2)
2101 not used hint:
2102 duplication hint:
2103 error hint:
2104
2105                QUERY PLAN                
2106 -----------------------------------------
2107  Nested Loop
2108    Join Filter: (t1.id = t2.id)
2109    ->  Tid Scan on t1
2110          TID Cond: (ctid = '(1,1)'::tid)
2111    ->  Tid Scan on t2
2112          TID Cond: (ctid = '(1,1)'::tid)
2113 (6 rows)
2114
2115 /*+TidScan(t1) NoTidScan(t2)*/
2116 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2117 LOG:  pg_hint_plan:
2118 used hint:
2119 TidScan(t1)
2120 NoTidScan(t2)
2121 not used hint:
2122 duplication hint:
2123 error hint:
2124
2125                QUERY PLAN                
2126 -----------------------------------------
2127  Nested Loop
2128    ->  Tid Scan on t1
2129          TID Cond: (ctid = '(1,1)'::tid)
2130    ->  Index Scan using t2_pkey on t2
2131          Index Cond: (id = t1.id)
2132          Filter: (ctid = '(1,1)'::tid)
2133 (6 rows)
2134
2135 /*+NoSeqScan(t1)*/
2136 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2137 LOG:  pg_hint_plan:
2138 used hint:
2139 NoSeqScan(t1)
2140 not used hint:
2141 duplication hint:
2142 error hint:
2143
2144                QUERY PLAN                
2145 -----------------------------------------
2146  Nested Loop
2147    Join Filter: (t1.id = t2.id)
2148    ->  Tid Scan on t1
2149          TID Cond: (ctid = '(1,1)'::tid)
2150    ->  Tid Scan on t2
2151          TID Cond: (ctid = '(1,1)'::tid)
2152 (6 rows)
2153
2154 /*+NoSeqScan(t2)*/
2155 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2156 LOG:  pg_hint_plan:
2157 used hint:
2158 NoSeqScan(t2)
2159 not used hint:
2160 duplication hint:
2161 error hint:
2162
2163                QUERY PLAN                
2164 -----------------------------------------
2165  Nested Loop
2166    Join Filter: (t1.id = t2.id)
2167    ->  Tid Scan on t1
2168          TID Cond: (ctid = '(1,1)'::tid)
2169    ->  Tid Scan on t2
2170          TID Cond: (ctid = '(1,1)'::tid)
2171 (6 rows)
2172
2173 /*+NoSeqScan(t1) SeqScan(t2)*/
2174 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2175 LOG:  pg_hint_plan:
2176 used hint:
2177 NoSeqScan(t1)
2178 SeqScan(t2)
2179 not used hint:
2180 duplication hint:
2181 error hint:
2182
2183                QUERY PLAN                
2184 -----------------------------------------
2185  Nested Loop
2186    Join Filter: (t1.id = t2.id)
2187    ->  Tid Scan on t1
2188          TID Cond: (ctid = '(1,1)'::tid)
2189    ->  Seq Scan on t2
2190          Filter: (ctid = '(1,1)'::tid)
2191 (6 rows)
2192
2193 /*+NoSeqScan(t1) IndexScan(t2)*/
2194 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2195 LOG:  pg_hint_plan:
2196 used hint:
2197 NoSeqScan(t1)
2198 IndexScan(t2)
2199 not used hint:
2200 duplication hint:
2201 error hint:
2202
2203                QUERY PLAN                
2204 -----------------------------------------
2205  Nested Loop
2206    ->  Tid Scan on t1
2207          TID Cond: (ctid = '(1,1)'::tid)
2208    ->  Index Scan using t2_pkey on t2
2209          Index Cond: (id = t1.id)
2210          Filter: (ctid = '(1,1)'::tid)
2211 (6 rows)
2212
2213 /*+NoSeqScan(t1) BitmapScan(t2)*/
2214 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2215 LOG:  pg_hint_plan:
2216 used hint:
2217 NoSeqScan(t1)
2218 BitmapScan(t2)
2219 not used hint:
2220 duplication hint:
2221 error hint:
2222
2223                 QUERY PLAN                
2224 ------------------------------------------
2225  Nested Loop
2226    ->  Tid Scan on t1
2227          TID Cond: (ctid = '(1,1)'::tid)
2228    ->  Bitmap Heap Scan on t2
2229          Recheck Cond: (id = t1.id)
2230          Filter: (ctid = '(1,1)'::tid)
2231          ->  Bitmap Index Scan on t2_pkey
2232                Index Cond: (id = t1.id)
2233 (8 rows)
2234
2235 /*+NoSeqScan(t1) TidScan(t2)*/
2236 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2237 LOG:  pg_hint_plan:
2238 used hint:
2239 NoSeqScan(t1)
2240 TidScan(t2)
2241 not used hint:
2242 duplication hint:
2243 error hint:
2244
2245                QUERY PLAN                
2246 -----------------------------------------
2247  Nested Loop
2248    Join Filter: (t1.id = t2.id)
2249    ->  Tid Scan on t1
2250          TID Cond: (ctid = '(1,1)'::tid)
2251    ->  Tid Scan on t2
2252          TID Cond: (ctid = '(1,1)'::tid)
2253 (6 rows)
2254
2255 /*+NoSeqScan(t1) NoSeqScan(t2)*/
2256 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2257 LOG:  pg_hint_plan:
2258 used hint:
2259 NoSeqScan(t1)
2260 NoSeqScan(t2)
2261 not used hint:
2262 duplication hint:
2263 error hint:
2264
2265                QUERY PLAN                
2266 -----------------------------------------
2267  Nested Loop
2268    Join Filter: (t1.id = t2.id)
2269    ->  Tid Scan on t1
2270          TID Cond: (ctid = '(1,1)'::tid)
2271    ->  Tid Scan on t2
2272          TID Cond: (ctid = '(1,1)'::tid)
2273 (6 rows)
2274
2275 /*+NoSeqScan(t1) NoIndexScan(t2)*/
2276 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2277 LOG:  pg_hint_plan:
2278 used hint:
2279 NoSeqScan(t1)
2280 NoIndexScan(t2)
2281 not used hint:
2282 duplication hint:
2283 error hint:
2284
2285                QUERY PLAN                
2286 -----------------------------------------
2287  Nested Loop
2288    Join Filter: (t1.id = t2.id)
2289    ->  Tid Scan on t1
2290          TID Cond: (ctid = '(1,1)'::tid)
2291    ->  Tid Scan on t2
2292          TID Cond: (ctid = '(1,1)'::tid)
2293 (6 rows)
2294
2295 /*+NoSeqScan(t1) NoBitmapScan(t2)*/
2296 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2297 LOG:  pg_hint_plan:
2298 used hint:
2299 NoSeqScan(t1)
2300 NoBitmapScan(t2)
2301 not used hint:
2302 duplication hint:
2303 error hint:
2304
2305                QUERY PLAN                
2306 -----------------------------------------
2307  Nested Loop
2308    Join Filter: (t1.id = t2.id)
2309    ->  Tid Scan on t1
2310          TID Cond: (ctid = '(1,1)'::tid)
2311    ->  Tid Scan on t2
2312          TID Cond: (ctid = '(1,1)'::tid)
2313 (6 rows)
2314
2315 /*+NoSeqScan(t1) NoTidScan(t2)*/
2316 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2317 LOG:  pg_hint_plan:
2318 used hint:
2319 NoSeqScan(t1)
2320 NoTidScan(t2)
2321 not used hint:
2322 duplication hint:
2323 error hint:
2324
2325                QUERY PLAN                
2326 -----------------------------------------
2327  Nested Loop
2328    ->  Tid Scan on t1
2329          TID Cond: (ctid = '(1,1)'::tid)
2330    ->  Index Scan using t2_pkey on t2
2331          Index Cond: (id = t1.id)
2332          Filter: (ctid = '(1,1)'::tid)
2333 (6 rows)
2334
2335 /*+NoIndexScan(t1)*/
2336 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2337 LOG:  pg_hint_plan:
2338 used hint:
2339 NoIndexScan(t1)
2340 not used hint:
2341 duplication hint:
2342 error hint:
2343
2344                QUERY PLAN                
2345 -----------------------------------------
2346  Nested Loop
2347    Join Filter: (t1.id = t2.id)
2348    ->  Tid Scan on t1
2349          TID Cond: (ctid = '(1,1)'::tid)
2350    ->  Tid Scan on t2
2351          TID Cond: (ctid = '(1,1)'::tid)
2352 (6 rows)
2353
2354 /*+NoIndexScan(t2)*/
2355 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2356 LOG:  pg_hint_plan:
2357 used hint:
2358 NoIndexScan(t2)
2359 not used hint:
2360 duplication hint:
2361 error hint:
2362
2363                QUERY PLAN                
2364 -----------------------------------------
2365  Nested Loop
2366    Join Filter: (t1.id = t2.id)
2367    ->  Tid Scan on t1
2368          TID Cond: (ctid = '(1,1)'::tid)
2369    ->  Tid Scan on t2
2370          TID Cond: (ctid = '(1,1)'::tid)
2371 (6 rows)
2372
2373 /*+NoIndexScan(t1) SeqScan(t2)*/
2374 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2375 LOG:  pg_hint_plan:
2376 used hint:
2377 NoIndexScan(t1)
2378 SeqScan(t2)
2379 not used hint:
2380 duplication hint:
2381 error hint:
2382
2383                QUERY PLAN                
2384 -----------------------------------------
2385  Nested Loop
2386    Join Filter: (t1.id = t2.id)
2387    ->  Tid Scan on t1
2388          TID Cond: (ctid = '(1,1)'::tid)
2389    ->  Seq Scan on t2
2390          Filter: (ctid = '(1,1)'::tid)
2391 (6 rows)
2392
2393 /*+NoIndexScan(t1) IndexScan(t2)*/
2394 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2395 LOG:  pg_hint_plan:
2396 used hint:
2397 NoIndexScan(t1)
2398 IndexScan(t2)
2399 not used hint:
2400 duplication hint:
2401 error hint:
2402
2403                QUERY PLAN                
2404 -----------------------------------------
2405  Nested Loop
2406    ->  Tid Scan on t1
2407          TID Cond: (ctid = '(1,1)'::tid)
2408    ->  Index Scan using t2_pkey on t2
2409          Index Cond: (id = t1.id)
2410          Filter: (ctid = '(1,1)'::tid)
2411 (6 rows)
2412
2413 /*+NoIndexScan(t1) BitmapScan(t2)*/
2414 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2415 LOG:  pg_hint_plan:
2416 used hint:
2417 NoIndexScan(t1)
2418 BitmapScan(t2)
2419 not used hint:
2420 duplication hint:
2421 error hint:
2422
2423                 QUERY PLAN                
2424 ------------------------------------------
2425  Nested Loop
2426    ->  Tid Scan on t1
2427          TID Cond: (ctid = '(1,1)'::tid)
2428    ->  Bitmap Heap Scan on t2
2429          Recheck Cond: (id = t1.id)
2430          Filter: (ctid = '(1,1)'::tid)
2431          ->  Bitmap Index Scan on t2_pkey
2432                Index Cond: (id = t1.id)
2433 (8 rows)
2434
2435 /*+NoIndexScan(t1) TidScan(t2)*/
2436 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2437 LOG:  pg_hint_plan:
2438 used hint:
2439 NoIndexScan(t1)
2440 TidScan(t2)
2441 not used hint:
2442 duplication hint:
2443 error hint:
2444
2445                QUERY PLAN                
2446 -----------------------------------------
2447  Nested Loop
2448    Join Filter: (t1.id = t2.id)
2449    ->  Tid Scan on t1
2450          TID Cond: (ctid = '(1,1)'::tid)
2451    ->  Tid Scan on t2
2452          TID Cond: (ctid = '(1,1)'::tid)
2453 (6 rows)
2454
2455 /*+NoIndexScan(t1) NoSeqScan(t2)*/
2456 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2457 LOG:  pg_hint_plan:
2458 used hint:
2459 NoIndexScan(t1)
2460 NoSeqScan(t2)
2461 not used hint:
2462 duplication hint:
2463 error hint:
2464
2465                QUERY PLAN                
2466 -----------------------------------------
2467  Nested Loop
2468    Join Filter: (t1.id = t2.id)
2469    ->  Tid Scan on t1
2470          TID Cond: (ctid = '(1,1)'::tid)
2471    ->  Tid Scan on t2
2472          TID Cond: (ctid = '(1,1)'::tid)
2473 (6 rows)
2474
2475 /*+NoIndexScan(t1) NoIndexScan(t2)*/
2476 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2477 LOG:  pg_hint_plan:
2478 used hint:
2479 NoIndexScan(t1)
2480 NoIndexScan(t2)
2481 not used hint:
2482 duplication hint:
2483 error hint:
2484
2485                QUERY PLAN                
2486 -----------------------------------------
2487  Nested Loop
2488    Join Filter: (t1.id = t2.id)
2489    ->  Tid Scan on t1
2490          TID Cond: (ctid = '(1,1)'::tid)
2491    ->  Tid Scan on t2
2492          TID Cond: (ctid = '(1,1)'::tid)
2493 (6 rows)
2494
2495 /*+NoIndexScan(t1) NoBitmapScan(t2)*/
2496 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2497 LOG:  pg_hint_plan:
2498 used hint:
2499 NoIndexScan(t1)
2500 NoBitmapScan(t2)
2501 not used hint:
2502 duplication hint:
2503 error hint:
2504
2505                QUERY PLAN                
2506 -----------------------------------------
2507  Nested Loop
2508    Join Filter: (t1.id = t2.id)
2509    ->  Tid Scan on t1
2510          TID Cond: (ctid = '(1,1)'::tid)
2511    ->  Tid Scan on t2
2512          TID Cond: (ctid = '(1,1)'::tid)
2513 (6 rows)
2514
2515 /*+NoIndexScan(t1) NoTidScan(t2)*/
2516 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2517 LOG:  pg_hint_plan:
2518 used hint:
2519 NoIndexScan(t1)
2520 NoTidScan(t2)
2521 not used hint:
2522 duplication hint:
2523 error hint:
2524
2525                QUERY PLAN                
2526 -----------------------------------------
2527  Nested Loop
2528    ->  Tid Scan on t1
2529          TID Cond: (ctid = '(1,1)'::tid)
2530    ->  Index Scan using t2_pkey on t2
2531          Index Cond: (id = t1.id)
2532          Filter: (ctid = '(1,1)'::tid)
2533 (6 rows)
2534
2535 /*+NoBitmapScan(t1)*/
2536 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2537 LOG:  pg_hint_plan:
2538 used hint:
2539 NoBitmapScan(t1)
2540 not used hint:
2541 duplication hint:
2542 error hint:
2543
2544                QUERY PLAN                
2545 -----------------------------------------
2546  Nested Loop
2547    Join Filter: (t1.id = t2.id)
2548    ->  Tid Scan on t1
2549          TID Cond: (ctid = '(1,1)'::tid)
2550    ->  Tid Scan on t2
2551          TID Cond: (ctid = '(1,1)'::tid)
2552 (6 rows)
2553
2554 /*+NoBitmapScan(t2)*/
2555 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2556 LOG:  pg_hint_plan:
2557 used hint:
2558 NoBitmapScan(t2)
2559 not used hint:
2560 duplication hint:
2561 error hint:
2562
2563                QUERY PLAN                
2564 -----------------------------------------
2565  Nested Loop
2566    Join Filter: (t1.id = t2.id)
2567    ->  Tid Scan on t1
2568          TID Cond: (ctid = '(1,1)'::tid)
2569    ->  Tid Scan on t2
2570          TID Cond: (ctid = '(1,1)'::tid)
2571 (6 rows)
2572
2573 /*+NoBitmapScan(t1) SeqScan(t2)*/
2574 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2575 LOG:  pg_hint_plan:
2576 used hint:
2577 NoBitmapScan(t1)
2578 SeqScan(t2)
2579 not used hint:
2580 duplication hint:
2581 error hint:
2582
2583                QUERY PLAN                
2584 -----------------------------------------
2585  Nested Loop
2586    Join Filter: (t1.id = t2.id)
2587    ->  Tid Scan on t1
2588          TID Cond: (ctid = '(1,1)'::tid)
2589    ->  Seq Scan on t2
2590          Filter: (ctid = '(1,1)'::tid)
2591 (6 rows)
2592
2593 /*+NoBitmapScan(t1) IndexScan(t2)*/
2594 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2595 LOG:  pg_hint_plan:
2596 used hint:
2597 NoBitmapScan(t1)
2598 IndexScan(t2)
2599 not used hint:
2600 duplication hint:
2601 error hint:
2602
2603                QUERY PLAN                
2604 -----------------------------------------
2605  Nested Loop
2606    ->  Tid Scan on t1
2607          TID Cond: (ctid = '(1,1)'::tid)
2608    ->  Index Scan using t2_pkey on t2
2609          Index Cond: (id = t1.id)
2610          Filter: (ctid = '(1,1)'::tid)
2611 (6 rows)
2612
2613 /*+NoBitmapScan(t1) BitmapScan(t2)*/
2614 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2615 LOG:  pg_hint_plan:
2616 used hint:
2617 NoBitmapScan(t1)
2618 BitmapScan(t2)
2619 not used hint:
2620 duplication hint:
2621 error hint:
2622
2623                 QUERY PLAN                
2624 ------------------------------------------
2625  Nested Loop
2626    ->  Tid Scan on t1
2627          TID Cond: (ctid = '(1,1)'::tid)
2628    ->  Bitmap Heap Scan on t2
2629          Recheck Cond: (id = t1.id)
2630          Filter: (ctid = '(1,1)'::tid)
2631          ->  Bitmap Index Scan on t2_pkey
2632                Index Cond: (id = t1.id)
2633 (8 rows)
2634
2635 /*+NoBitmapScan(t1) TidScan(t2)*/
2636 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2637 LOG:  pg_hint_plan:
2638 used hint:
2639 NoBitmapScan(t1)
2640 TidScan(t2)
2641 not used hint:
2642 duplication hint:
2643 error hint:
2644
2645                QUERY PLAN                
2646 -----------------------------------------
2647  Nested Loop
2648    Join Filter: (t1.id = t2.id)
2649    ->  Tid Scan on t1
2650          TID Cond: (ctid = '(1,1)'::tid)
2651    ->  Tid Scan on t2
2652          TID Cond: (ctid = '(1,1)'::tid)
2653 (6 rows)
2654
2655 /*+NoBitmapScan(t1) NoSeqScan(t2)*/
2656 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2657 LOG:  pg_hint_plan:
2658 used hint:
2659 NoBitmapScan(t1)
2660 NoSeqScan(t2)
2661 not used hint:
2662 duplication hint:
2663 error hint:
2664
2665                QUERY PLAN                
2666 -----------------------------------------
2667  Nested Loop
2668    Join Filter: (t1.id = t2.id)
2669    ->  Tid Scan on t1
2670          TID Cond: (ctid = '(1,1)'::tid)
2671    ->  Tid Scan on t2
2672          TID Cond: (ctid = '(1,1)'::tid)
2673 (6 rows)
2674
2675 /*+NoBitmapScan(t1) NoIndexScan(t2)*/
2676 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2677 LOG:  pg_hint_plan:
2678 used hint:
2679 NoBitmapScan(t1)
2680 NoIndexScan(t2)
2681 not used hint:
2682 duplication hint:
2683 error hint:
2684
2685                QUERY PLAN                
2686 -----------------------------------------
2687  Nested Loop
2688    Join Filter: (t1.id = t2.id)
2689    ->  Tid Scan on t1
2690          TID Cond: (ctid = '(1,1)'::tid)
2691    ->  Tid Scan on t2
2692          TID Cond: (ctid = '(1,1)'::tid)
2693 (6 rows)
2694
2695 /*+NoBitmapScan(t1) NoBitmapScan(t2)*/
2696 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2697 LOG:  pg_hint_plan:
2698 used hint:
2699 NoBitmapScan(t1)
2700 NoBitmapScan(t2)
2701 not used hint:
2702 duplication hint:
2703 error hint:
2704
2705                QUERY PLAN                
2706 -----------------------------------------
2707  Nested Loop
2708    Join Filter: (t1.id = t2.id)
2709    ->  Tid Scan on t1
2710          TID Cond: (ctid = '(1,1)'::tid)
2711    ->  Tid Scan on t2
2712          TID Cond: (ctid = '(1,1)'::tid)
2713 (6 rows)
2714
2715 /*+NoBitmapScan(t1) NoTidScan(t2)*/
2716 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2717 LOG:  pg_hint_plan:
2718 used hint:
2719 NoBitmapScan(t1)
2720 NoTidScan(t2)
2721 not used hint:
2722 duplication hint:
2723 error hint:
2724
2725                QUERY PLAN                
2726 -----------------------------------------
2727  Nested Loop
2728    ->  Tid Scan on t1
2729          TID Cond: (ctid = '(1,1)'::tid)
2730    ->  Index Scan using t2_pkey on t2
2731          Index Cond: (id = t1.id)
2732          Filter: (ctid = '(1,1)'::tid)
2733 (6 rows)
2734
2735 /*+NoTidScan(t1)*/
2736 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2737 LOG:  pg_hint_plan:
2738 used hint:
2739 NoTidScan(t1)
2740 not used hint:
2741 duplication hint:
2742 error hint:
2743
2744                QUERY PLAN                
2745 -----------------------------------------
2746  Nested Loop
2747    ->  Tid Scan on t2
2748          TID Cond: (ctid = '(1,1)'::tid)
2749    ->  Index Scan using t1_pkey on t1
2750          Index Cond: (id = t2.id)
2751          Filter: (ctid = '(1,1)'::tid)
2752 (6 rows)
2753
2754 /*+NoTidScan(t2)*/
2755 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2756 LOG:  pg_hint_plan:
2757 used hint:
2758 NoTidScan(t2)
2759 not used hint:
2760 duplication hint:
2761 error hint:
2762
2763                QUERY PLAN                
2764 -----------------------------------------
2765  Nested Loop
2766    ->  Tid Scan on t1
2767          TID Cond: (ctid = '(1,1)'::tid)
2768    ->  Index Scan using t2_pkey on t2
2769          Index Cond: (id = t1.id)
2770          Filter: (ctid = '(1,1)'::tid)
2771 (6 rows)
2772
2773 /*+NoTidScan(t1) SeqScan(t2)*/
2774 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2775 LOG:  pg_hint_plan:
2776 used hint:
2777 NoTidScan(t1)
2778 SeqScan(t2)
2779 not used hint:
2780 duplication hint:
2781 error hint:
2782
2783               QUERY PLAN               
2784 ---------------------------------------
2785  Nested Loop
2786    ->  Seq Scan on t2
2787          Filter: (ctid = '(1,1)'::tid)
2788    ->  Index Scan using t1_pkey on t1
2789          Index Cond: (id = t2.id)
2790          Filter: (ctid = '(1,1)'::tid)
2791 (6 rows)
2792
2793 /*+NoTidScan(t1) IndexScan(t2)*/
2794 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2795 LOG:  pg_hint_plan:
2796 used hint:
2797 NoTidScan(t1)
2798 IndexScan(t2)
2799 not used hint:
2800 duplication hint:
2801 error hint:
2802
2803               QUERY PLAN               
2804 ---------------------------------------
2805  Nested Loop
2806    ->  Index Scan using t2_pkey on t2
2807          Filter: (ctid = '(1,1)'::tid)
2808    ->  Index Scan using t1_pkey on t1
2809          Index Cond: (id = t2.id)
2810          Filter: (ctid = '(1,1)'::tid)
2811 (6 rows)
2812
2813 /*+NoTidScan(t1) BitmapScan(t2)*/
2814 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2815 LOG:  pg_hint_plan:
2816 used hint:
2817 NoTidScan(t1)
2818 BitmapScan(t2)
2819 not used hint:
2820 duplication hint:
2821 error hint:
2822
2823                 QUERY PLAN                
2824 ------------------------------------------
2825  Nested Loop
2826    ->  Seq Scan on t1
2827          Filter: (ctid = '(1,1)'::tid)
2828    ->  Bitmap Heap Scan on t2
2829          Recheck Cond: (id = t1.id)
2830          Filter: (ctid = '(1,1)'::tid)
2831          ->  Bitmap Index Scan on t2_pkey
2832                Index Cond: (id = t1.id)
2833 (8 rows)
2834
2835 /*+NoTidScan(t1) TidScan(t2)*/
2836 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2837 LOG:  pg_hint_plan:
2838 used hint:
2839 NoTidScan(t1)
2840 TidScan(t2)
2841 not used hint:
2842 duplication hint:
2843 error hint:
2844
2845                QUERY PLAN                
2846 -----------------------------------------
2847  Nested Loop
2848    ->  Tid Scan on t2
2849          TID Cond: (ctid = '(1,1)'::tid)
2850    ->  Index Scan using t1_pkey on t1
2851          Index Cond: (id = t2.id)
2852          Filter: (ctid = '(1,1)'::tid)
2853 (6 rows)
2854
2855 /*+NoTidScan(t1) NoSeqScan(t2)*/
2856 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2857 LOG:  pg_hint_plan:
2858 used hint:
2859 NoTidScan(t1)
2860 NoSeqScan(t2)
2861 not used hint:
2862 duplication hint:
2863 error hint:
2864
2865                QUERY PLAN                
2866 -----------------------------------------
2867  Nested Loop
2868    ->  Tid Scan on t2
2869          TID Cond: (ctid = '(1,1)'::tid)
2870    ->  Index Scan using t1_pkey on t1
2871          Index Cond: (id = t2.id)
2872          Filter: (ctid = '(1,1)'::tid)
2873 (6 rows)
2874
2875 /*+NoTidScan(t1) NoIndexScan(t2)*/
2876 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2877 LOG:  pg_hint_plan:
2878 used hint:
2879 NoTidScan(t1)
2880 NoIndexScan(t2)
2881 not used hint:
2882 duplication hint:
2883 error hint:
2884
2885                QUERY PLAN                
2886 -----------------------------------------
2887  Nested Loop
2888    ->  Tid Scan on t2
2889          TID Cond: (ctid = '(1,1)'::tid)
2890    ->  Index Scan using t1_pkey on t1
2891          Index Cond: (id = t2.id)
2892          Filter: (ctid = '(1,1)'::tid)
2893 (6 rows)
2894
2895 /*+NoTidScan(t1) NoBitmapScan(t2)*/
2896 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2897 LOG:  pg_hint_plan:
2898 used hint:
2899 NoTidScan(t1)
2900 NoBitmapScan(t2)
2901 not used hint:
2902 duplication hint:
2903 error hint:
2904
2905                QUERY PLAN                
2906 -----------------------------------------
2907  Nested Loop
2908    ->  Tid Scan on t2
2909          TID Cond: (ctid = '(1,1)'::tid)
2910    ->  Index Scan using t1_pkey on t1
2911          Index Cond: (id = t2.id)
2912          Filter: (ctid = '(1,1)'::tid)
2913 (6 rows)
2914
2915 /*+NoTidScan(t1) NoTidScan(t2)*/
2916 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
2917 LOG:  pg_hint_plan:
2918 used hint:
2919 NoTidScan(t1)
2920 NoTidScan(t2)
2921 not used hint:
2922 duplication hint:
2923 error hint:
2924
2925               QUERY PLAN               
2926 ---------------------------------------
2927  Nested Loop
2928    ->  Seq Scan on t2
2929          Filter: (ctid = '(1,1)'::tid)
2930    ->  Index Scan using t1_pkey on t1
2931          Index Cond: (id = t2.id)
2932          Filter: (ctid = '(1,1)'::tid)
2933 (6 rows)
2934
2935 -- additional test
2936 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10;
2937                QUERY PLAN                
2938 -----------------------------------------
2939  Nested Loop
2940    Join Filter: (t1.id = t2.id)
2941    ->  Tid Scan on t1
2942          TID Cond: (ctid = '(1,1)'::tid)
2943          Filter: (id < 10)
2944    ->  Tid Scan on t2
2945          TID Cond: (ctid = '(1,1)'::tid)
2946          Filter: (id < 10)
2947 (8 rows)
2948
2949 /*+BitmapScan(t1) BitmapScan(t2)*/
2950 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)' AND t1.id < 10 AND t2.id < 10;
2951 LOG:  pg_hint_plan:
2952 used hint:
2953 BitmapScan(t1)
2954 BitmapScan(t2)
2955 not used hint:
2956 duplication hint:
2957 error hint:
2958
2959                        QUERY PLAN                       
2960 --------------------------------------------------------
2961  Nested Loop
2962    ->  Bitmap Heap Scan on t2
2963          Recheck Cond: (id < 10)
2964          Filter: (ctid = '(1,1)'::tid)
2965          ->  Bitmap Index Scan on t2_pkey
2966                Index Cond: (id < 10)
2967    ->  Bitmap Heap Scan on t1
2968          Recheck Cond: ((id = t2.id) AND (id < 10))
2969          Filter: (ctid = '(1,1)'::tid)
2970          ->  Bitmap Index Scan on t1_pkey
2971                Index Cond: ((id = t2.id) AND (id < 10))
2972 (11 rows)
2973
2974 -- outer join test
2975 EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN  t2 ON (t1.id = t2.id);
2976           QUERY PLAN          
2977 ------------------------------
2978  Hash Full Join
2979    Hash Cond: (t1.id = t2.id)
2980    ->  Seq Scan on t1
2981    ->  Hash
2982          ->  Seq Scan on t2
2983 (5 rows)
2984
2985 /*+MergeJoin(t1 t2)*/
2986 EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN  t2 ON (t1.id = t2.id);
2987 LOG:  pg_hint_plan:
2988 used hint:
2989 MergeJoin(t1 t2)
2990 not used hint:
2991 duplication hint:
2992 error hint:
2993
2994               QUERY PLAN              
2995 --------------------------------------
2996  Merge Full Join
2997    Merge Cond: (t1.id = t2.id)
2998    ->  Index Scan using t1_pkey on t1
2999    ->  Index Scan using t2_pkey on t2
3000 (4 rows)
3001
3002 /*+NestLoop(t1 t2)*/
3003 EXPLAIN (COSTS false) SELECT * FROM t1 FULL OUTER JOIN  t2 ON (t1.id = t2.id);
3004 LOG:  pg_hint_plan:
3005 used hint:
3006 NestLoop(t1 t2)
3007 not used hint:
3008 duplication hint:
3009 error hint:
3010
3011           QUERY PLAN          
3012 ------------------------------
3013  Hash Full Join
3014    Hash Cond: (t2.id = t1.id)
3015    ->  Seq Scan on t2
3016    ->  Hash
3017          ->  Seq Scan on t1
3018 (5 rows)
3019
3020 -- inheritance tables test
3021 SET constraint_exclusion TO off;
3022 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3023                               QUERY PLAN                               
3024 -----------------------------------------------------------------------
3025  Append
3026    ->  Seq Scan on p1
3027          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3028    ->  Seq Scan on p1_c1
3029          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3030    ->  Seq Scan on p1_c2
3031          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3032    ->  Seq Scan on p1_c3
3033          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3034    ->  Seq Scan on p1_c4
3035          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3036    ->  Seq Scan on p1_c1_c1
3037          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3038    ->  Seq Scan on p1_c1_c2
3039          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3040    ->  Seq Scan on p1_c3_c1
3041          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3042    ->  Seq Scan on p1_c3_c2
3043          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3044 (19 rows)
3045
3046 SET constraint_exclusion TO on;
3047 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3048                               QUERY PLAN                               
3049 -----------------------------------------------------------------------
3050  Append
3051    ->  Seq Scan on p1
3052          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3053    ->  Seq Scan on p1_c1
3054          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3055    ->  Seq Scan on p1_c1_c1
3056          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3057    ->  Seq Scan on p1_c1_c2
3058          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3059 (9 rows)
3060
3061 SET constraint_exclusion TO off;
3062 /*+SeqScan(p1)*/
3063 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3064 LOG:  pg_hint_plan:
3065 used hint:
3066 SeqScan(p1)
3067 not used hint:
3068 duplication hint:
3069 error hint:
3070
3071                               QUERY PLAN                               
3072 -----------------------------------------------------------------------
3073  Append
3074    ->  Seq Scan on p1
3075          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3076    ->  Seq Scan on p1_c1
3077          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3078    ->  Seq Scan on p1_c2
3079          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3080    ->  Seq Scan on p1_c3
3081          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3082    ->  Seq Scan on p1_c4
3083          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3084    ->  Seq Scan on p1_c1_c1
3085          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3086    ->  Seq Scan on p1_c1_c2
3087          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3088    ->  Seq Scan on p1_c3_c1
3089          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3090    ->  Seq Scan on p1_c3_c2
3091          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3092 (19 rows)
3093
3094 /*+IndexScan(p1)*/
3095 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3096 LOG:  pg_hint_plan:
3097 used hint:
3098 IndexScan(p1)
3099 not used hint:
3100 duplication hint:
3101 error hint:
3102
3103                     QUERY PLAN                    
3104 --------------------------------------------------
3105  Append
3106    ->  Index Scan using p1_pkey on p1
3107          Index Cond: ((id >= 50) AND (id <= 51))
3108          Filter: (ctid = '(1,1)'::tid)
3109    ->  Index Scan using p1_c1_pkey on p1_c1
3110          Index Cond: ((id >= 50) AND (id <= 51))
3111          Filter: (ctid = '(1,1)'::tid)
3112    ->  Index Scan using p1_c2_pkey on p1_c2
3113          Index Cond: ((id >= 50) AND (id <= 51))
3114          Filter: (ctid = '(1,1)'::tid)
3115    ->  Index Scan using p1_c3_pkey on p1_c3
3116          Index Cond: ((id >= 50) AND (id <= 51))
3117          Filter: (ctid = '(1,1)'::tid)
3118    ->  Index Scan using p1_c4_pkey on p1_c4
3119          Index Cond: ((id >= 50) AND (id <= 51))
3120          Filter: (ctid = '(1,1)'::tid)
3121    ->  Index Scan using p1_c1_c1_pkey on p1_c1_c1
3122          Index Cond: ((id >= 50) AND (id <= 51))
3123          Filter: (ctid = '(1,1)'::tid)
3124    ->  Index Scan using p1_c1_c2_pkey on p1_c1_c2
3125          Index Cond: ((id >= 50) AND (id <= 51))
3126          Filter: (ctid = '(1,1)'::tid)
3127    ->  Index Scan using p1_c3_c1_pkey on p1_c3_c1
3128          Index Cond: ((id >= 50) AND (id <= 51))
3129          Filter: (ctid = '(1,1)'::tid)
3130    ->  Index Scan using p1_c3_c2_pkey on p1_c3_c2
3131          Index Cond: ((id >= 50) AND (id <= 51))
3132          Filter: (ctid = '(1,1)'::tid)
3133 (28 rows)
3134
3135 /*+BitmapScan(p1)*/
3136 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3137 LOG:  pg_hint_plan:
3138 used hint:
3139 BitmapScan(p1)
3140 not used hint:
3141 duplication hint:
3142 error hint:
3143
3144                       QUERY PLAN                       
3145 -------------------------------------------------------
3146  Append
3147    ->  Bitmap Heap Scan on p1
3148          Recheck Cond: ((id >= 50) AND (id <= 51))
3149          Filter: (ctid = '(1,1)'::tid)
3150          ->  Bitmap Index Scan on p1_pkey
3151                Index Cond: ((id >= 50) AND (id <= 51))
3152    ->  Bitmap Heap Scan on p1_c1
3153          Recheck Cond: ((id >= 50) AND (id <= 51))
3154          Filter: (ctid = '(1,1)'::tid)
3155          ->  Bitmap Index Scan on p1_c1_pkey
3156                Index Cond: ((id >= 50) AND (id <= 51))
3157    ->  Bitmap Heap Scan on p1_c2
3158          Recheck Cond: ((id >= 50) AND (id <= 51))
3159          Filter: (ctid = '(1,1)'::tid)
3160          ->  Bitmap Index Scan on p1_c2_pkey
3161                Index Cond: ((id >= 50) AND (id <= 51))
3162    ->  Bitmap Heap Scan on p1_c3
3163          Recheck Cond: ((id >= 50) AND (id <= 51))
3164          Filter: (ctid = '(1,1)'::tid)
3165          ->  Bitmap Index Scan on p1_c3_pkey
3166                Index Cond: ((id >= 50) AND (id <= 51))
3167    ->  Bitmap Heap Scan on p1_c4
3168          Recheck Cond: ((id >= 50) AND (id <= 51))
3169          Filter: (ctid = '(1,1)'::tid)
3170          ->  Bitmap Index Scan on p1_c4_pkey
3171                Index Cond: ((id >= 50) AND (id <= 51))
3172    ->  Bitmap Heap Scan on p1_c1_c1
3173          Recheck Cond: ((id >= 50) AND (id <= 51))
3174          Filter: (ctid = '(1,1)'::tid)
3175          ->  Bitmap Index Scan on p1_c1_c1_pkey
3176                Index Cond: ((id >= 50) AND (id <= 51))
3177    ->  Bitmap Heap Scan on p1_c1_c2
3178          Recheck Cond: ((id >= 50) AND (id <= 51))
3179          Filter: (ctid = '(1,1)'::tid)
3180          ->  Bitmap Index Scan on p1_c1_c2_pkey
3181                Index Cond: ((id >= 50) AND (id <= 51))
3182    ->  Bitmap Heap Scan on p1_c3_c1
3183          Recheck Cond: ((id >= 50) AND (id <= 51))
3184          Filter: (ctid = '(1,1)'::tid)
3185          ->  Bitmap Index Scan on p1_c3_c1_pkey
3186                Index Cond: ((id >= 50) AND (id <= 51))
3187    ->  Bitmap Heap Scan on p1_c3_c2
3188          Recheck Cond: ((id >= 50) AND (id <= 51))
3189          Filter: (ctid = '(1,1)'::tid)
3190          ->  Bitmap Index Scan on p1_c3_c2_pkey
3191                Index Cond: ((id >= 50) AND (id <= 51))
3192 (46 rows)
3193
3194 /*+TidScan(p1)*/
3195 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3196 LOG:  pg_hint_plan:
3197 used hint:
3198 TidScan(p1)
3199 not used hint:
3200 duplication hint:
3201 error hint:
3202
3203                  QUERY PLAN                  
3204 ---------------------------------------------
3205  Append
3206    ->  Tid Scan on p1
3207          TID Cond: (ctid = '(1,1)'::tid)
3208          Filter: ((id >= 50) AND (id <= 51))
3209    ->  Tid Scan on p1_c1
3210          TID Cond: (ctid = '(1,1)'::tid)
3211          Filter: ((id >= 50) AND (id <= 51))
3212    ->  Tid Scan on p1_c2
3213          TID Cond: (ctid = '(1,1)'::tid)
3214          Filter: ((id >= 50) AND (id <= 51))
3215    ->  Tid Scan on p1_c3
3216          TID Cond: (ctid = '(1,1)'::tid)
3217          Filter: ((id >= 50) AND (id <= 51))
3218    ->  Tid Scan on p1_c4
3219          TID Cond: (ctid = '(1,1)'::tid)
3220          Filter: ((id >= 50) AND (id <= 51))
3221    ->  Tid Scan on p1_c1_c1
3222          TID Cond: (ctid = '(1,1)'::tid)
3223          Filter: ((id >= 50) AND (id <= 51))
3224    ->  Tid Scan on p1_c1_c2
3225          TID Cond: (ctid = '(1,1)'::tid)
3226          Filter: ((id >= 50) AND (id <= 51))
3227    ->  Tid Scan on p1_c3_c1
3228          TID Cond: (ctid = '(1,1)'::tid)
3229          Filter: ((id >= 50) AND (id <= 51))
3230    ->  Tid Scan on p1_c3_c2
3231          TID Cond: (ctid = '(1,1)'::tid)
3232          Filter: ((id >= 50) AND (id <= 51))
3233 (28 rows)
3234
3235 SET constraint_exclusion TO on;
3236 /*+SeqScan(p1)*/
3237 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3238 LOG:  pg_hint_plan:
3239 used hint:
3240 SeqScan(p1)
3241 not used hint:
3242 duplication hint:
3243 error hint:
3244
3245                               QUERY PLAN                               
3246 -----------------------------------------------------------------------
3247  Append
3248    ->  Seq Scan on p1
3249          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3250    ->  Seq Scan on p1_c1
3251          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3252    ->  Seq Scan on p1_c1_c1
3253          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3254    ->  Seq Scan on p1_c1_c2
3255          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3256 (9 rows)
3257
3258 /*+IndexScan(p1)*/
3259 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3260 LOG:  pg_hint_plan:
3261 used hint:
3262 IndexScan(p1)
3263 not used hint:
3264 duplication hint:
3265 error hint:
3266
3267                     QUERY PLAN                    
3268 --------------------------------------------------
3269  Append
3270    ->  Index Scan using p1_pkey on p1
3271          Index Cond: ((id >= 50) AND (id <= 51))
3272          Filter: (ctid = '(1,1)'::tid)
3273    ->  Index Scan using p1_c1_pkey on p1_c1
3274          Index Cond: ((id >= 50) AND (id <= 51))
3275          Filter: (ctid = '(1,1)'::tid)
3276    ->  Index Scan using p1_c1_c1_pkey on p1_c1_c1
3277          Index Cond: ((id >= 50) AND (id <= 51))
3278          Filter: (ctid = '(1,1)'::tid)
3279    ->  Index Scan using p1_c1_c2_pkey on p1_c1_c2
3280          Index Cond: ((id >= 50) AND (id <= 51))
3281          Filter: (ctid = '(1,1)'::tid)
3282 (13 rows)
3283
3284 /*+BitmapScan(p1)*/
3285 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3286 LOG:  pg_hint_plan:
3287 used hint:
3288 BitmapScan(p1)
3289 not used hint:
3290 duplication hint:
3291 error hint:
3292
3293                       QUERY PLAN                       
3294 -------------------------------------------------------
3295  Append
3296    ->  Bitmap Heap Scan on p1
3297          Recheck Cond: ((id >= 50) AND (id <= 51))
3298          Filter: (ctid = '(1,1)'::tid)
3299          ->  Bitmap Index Scan on p1_pkey
3300                Index Cond: ((id >= 50) AND (id <= 51))
3301    ->  Bitmap Heap Scan on p1_c1
3302          Recheck Cond: ((id >= 50) AND (id <= 51))
3303          Filter: (ctid = '(1,1)'::tid)
3304          ->  Bitmap Index Scan on p1_c1_pkey
3305                Index Cond: ((id >= 50) AND (id <= 51))
3306    ->  Bitmap Heap Scan on p1_c1_c1
3307          Recheck Cond: ((id >= 50) AND (id <= 51))
3308          Filter: (ctid = '(1,1)'::tid)
3309          ->  Bitmap Index Scan on p1_c1_c1_pkey
3310                Index Cond: ((id >= 50) AND (id <= 51))
3311    ->  Bitmap Heap Scan on p1_c1_c2
3312          Recheck Cond: ((id >= 50) AND (id <= 51))
3313          Filter: (ctid = '(1,1)'::tid)
3314          ->  Bitmap Index Scan on p1_c1_c2_pkey
3315                Index Cond: ((id >= 50) AND (id <= 51))
3316 (21 rows)
3317
3318 /*+TidScan(p1)*/
3319 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3320 LOG:  pg_hint_plan:
3321 used hint:
3322 TidScan(p1)
3323 not used hint:
3324 duplication hint:
3325 error hint:
3326
3327                  QUERY PLAN                  
3328 ---------------------------------------------
3329  Append
3330    ->  Tid Scan on p1
3331          TID Cond: (ctid = '(1,1)'::tid)
3332          Filter: ((id >= 50) AND (id <= 51))
3333    ->  Tid Scan on p1_c1
3334          TID Cond: (ctid = '(1,1)'::tid)
3335          Filter: ((id >= 50) AND (id <= 51))
3336    ->  Tid Scan on p1_c1_c1
3337          TID Cond: (ctid = '(1,1)'::tid)
3338          Filter: ((id >= 50) AND (id <= 51))
3339    ->  Tid Scan on p1_c1_c2
3340          TID Cond: (ctid = '(1,1)'::tid)
3341          Filter: ((id >= 50) AND (id <= 51))
3342 (13 rows)
3343
3344 SET constraint_exclusion TO off;
3345 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3346                                     QUERY PLAN                                     
3347 -----------------------------------------------------------------------------------
3348  Merge Join
3349    Merge Cond: (p1.id = t1.id)
3350    ->  Sort
3351          Sort Key: p1.id
3352          ->  Append
3353                ->  Seq Scan on p1
3354                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3355                ->  Seq Scan on p1_c1
3356                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3357                ->  Seq Scan on p1_c2
3358                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3359                ->  Seq Scan on p1_c3
3360                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3361                ->  Seq Scan on p1_c4
3362                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3363                ->  Seq Scan on p1_c1_c1
3364                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3365                ->  Seq Scan on p1_c1_c2
3366                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3367                ->  Seq Scan on p1_c3_c1
3368                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3369                ->  Seq Scan on p1_c3_c2
3370                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3371    ->  Index Scan using t1_pkey on t1
3372          Index Cond: (id < 10)
3373 (25 rows)
3374
3375 SET constraint_exclusion TO on;
3376 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3377                                     QUERY PLAN                                     
3378 -----------------------------------------------------------------------------------
3379  Merge Join
3380    Merge Cond: (p1.id = t1.id)
3381    ->  Sort
3382          Sort Key: p1.id
3383          ->  Append
3384                ->  Seq Scan on p1
3385                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3386                ->  Seq Scan on p1_c1
3387                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3388                ->  Seq Scan on p1_c1_c1
3389                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3390                ->  Seq Scan on p1_c1_c2
3391                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3392    ->  Index Scan using t1_pkey on t1
3393          Index Cond: (id < 10)
3394 (15 rows)
3395
3396 SET constraint_exclusion TO off;
3397 /*+SeqScan(p1)*/
3398 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3399 LOG:  pg_hint_plan:
3400 used hint:
3401 SeqScan(p1)
3402 not used hint:
3403 duplication hint:
3404 error hint:
3405
3406                                     QUERY PLAN                                     
3407 -----------------------------------------------------------------------------------
3408  Merge Join
3409    Merge Cond: (p1.id = t1.id)
3410    ->  Sort
3411          Sort Key: p1.id
3412          ->  Append
3413                ->  Seq Scan on p1
3414                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3415                ->  Seq Scan on p1_c1
3416                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3417                ->  Seq Scan on p1_c2
3418                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3419                ->  Seq Scan on p1_c3
3420                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3421                ->  Seq Scan on p1_c4
3422                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3423                ->  Seq Scan on p1_c1_c1
3424                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3425                ->  Seq Scan on p1_c1_c2
3426                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3427                ->  Seq Scan on p1_c3_c1
3428                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3429                ->  Seq Scan on p1_c3_c2
3430                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3431    ->  Index Scan using t1_pkey on t1
3432          Index Cond: (id < 10)
3433 (25 rows)
3434
3435 /*+IndexScan(p1)*/
3436 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3437 LOG:  pg_hint_plan:
3438 used hint:
3439 IndexScan(p1)
3440 not used hint:
3441 duplication hint:
3442 error hint:
3443
3444                        QUERY PLAN                       
3445 --------------------------------------------------------
3446  Merge Join
3447    Merge Cond: (p1.id = t1.id)
3448    ->  Merge Append
3449          Sort Key: p1.id
3450          ->  Index Scan using p1_pkey on p1
3451                Index Cond: ((id >= 50) AND (id <= 51))
3452                Filter: (ctid = '(1,1)'::tid)
3453          ->  Index Scan using p1_c1_pkey on p1_c1
3454                Index Cond: ((id >= 50) AND (id <= 51))
3455                Filter: (ctid = '(1,1)'::tid)
3456          ->  Index Scan using p1_c2_pkey on p1_c2
3457                Index Cond: ((id >= 50) AND (id <= 51))
3458                Filter: (ctid = '(1,1)'::tid)
3459          ->  Index Scan using p1_c3_pkey on p1_c3
3460                Index Cond: ((id >= 50) AND (id <= 51))
3461                Filter: (ctid = '(1,1)'::tid)
3462          ->  Index Scan using p1_c4_pkey on p1_c4
3463                Index Cond: ((id >= 50) AND (id <= 51))
3464                Filter: (ctid = '(1,1)'::tid)
3465          ->  Index Scan using p1_c1_c1_pkey on p1_c1_c1
3466                Index Cond: ((id >= 50) AND (id <= 51))
3467                Filter: (ctid = '(1,1)'::tid)
3468          ->  Index Scan using p1_c1_c2_pkey on p1_c1_c2
3469                Index Cond: ((id >= 50) AND (id <= 51))
3470                Filter: (ctid = '(1,1)'::tid)
3471          ->  Index Scan using p1_c3_c1_pkey on p1_c3_c1
3472                Index Cond: ((id >= 50) AND (id <= 51))
3473                Filter: (ctid = '(1,1)'::tid)
3474          ->  Index Scan using p1_c3_c2_pkey on p1_c3_c2
3475                Index Cond: ((id >= 50) AND (id <= 51))
3476                Filter: (ctid = '(1,1)'::tid)
3477    ->  Index Scan using t1_pkey on t1
3478          Index Cond: (id < 10)
3479 (33 rows)
3480
3481 /*+BitmapScan(p1)*/
3482 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3483 LOG:  pg_hint_plan:
3484 used hint:
3485 BitmapScan(p1)
3486 not used hint:
3487 duplication hint:
3488 error hint:
3489
3490                             QUERY PLAN                             
3491 -------------------------------------------------------------------
3492  Merge Join
3493    Merge Cond: (p1.id = t1.id)
3494    ->  Sort
3495          Sort Key: p1.id
3496          ->  Append
3497                ->  Bitmap Heap Scan on p1
3498                      Recheck Cond: ((id >= 50) AND (id <= 51))
3499                      Filter: (ctid = '(1,1)'::tid)
3500                      ->  Bitmap Index Scan on p1_pkey
3501                            Index Cond: ((id >= 50) AND (id <= 51))
3502                ->  Bitmap Heap Scan on p1_c1
3503                      Recheck Cond: ((id >= 50) AND (id <= 51))
3504                      Filter: (ctid = '(1,1)'::tid)
3505                      ->  Bitmap Index Scan on p1_c1_pkey
3506                            Index Cond: ((id >= 50) AND (id <= 51))
3507                ->  Bitmap Heap Scan on p1_c2
3508                      Recheck Cond: ((id >= 50) AND (id <= 51))
3509                      Filter: (ctid = '(1,1)'::tid)
3510                      ->  Bitmap Index Scan on p1_c2_pkey
3511                            Index Cond: ((id >= 50) AND (id <= 51))
3512                ->  Bitmap Heap Scan on p1_c3
3513                      Recheck Cond: ((id >= 50) AND (id <= 51))
3514                      Filter: (ctid = '(1,1)'::tid)
3515                      ->  Bitmap Index Scan on p1_c3_pkey
3516                            Index Cond: ((id >= 50) AND (id <= 51))
3517                ->  Bitmap Heap Scan on p1_c4
3518                      Recheck Cond: ((id >= 50) AND (id <= 51))
3519                      Filter: (ctid = '(1,1)'::tid)
3520                      ->  Bitmap Index Scan on p1_c4_pkey
3521                            Index Cond: ((id >= 50) AND (id <= 51))
3522                ->  Bitmap Heap Scan on p1_c1_c1
3523                      Recheck Cond: ((id >= 50) AND (id <= 51))
3524                      Filter: (ctid = '(1,1)'::tid)
3525                      ->  Bitmap Index Scan on p1_c1_c1_pkey
3526                            Index Cond: ((id >= 50) AND (id <= 51))
3527                ->  Bitmap Heap Scan on p1_c1_c2
3528                      Recheck Cond: ((id >= 50) AND (id <= 51))
3529                      Filter: (ctid = '(1,1)'::tid)
3530                      ->  Bitmap Index Scan on p1_c1_c2_pkey
3531                            Index Cond: ((id >= 50) AND (id <= 51))
3532                ->  Bitmap Heap Scan on p1_c3_c1
3533                      Recheck Cond: ((id >= 50) AND (id <= 51))
3534                      Filter: (ctid = '(1,1)'::tid)
3535                      ->  Bitmap Index Scan on p1_c3_c1_pkey
3536                            Index Cond: ((id >= 50) AND (id <= 51))
3537                ->  Bitmap Heap Scan on p1_c3_c2
3538                      Recheck Cond: ((id >= 50) AND (id <= 51))
3539                      Filter: (ctid = '(1,1)'::tid)
3540                      ->  Bitmap Index Scan on p1_c3_c2_pkey
3541                            Index Cond: ((id >= 50) AND (id <= 51))
3542    ->  Index Scan using t1_pkey on t1
3543          Index Cond: (id < 10)
3544 (52 rows)
3545
3546 /*+TidScan(p1)*/
3547 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3548 LOG:  pg_hint_plan:
3549 used hint:
3550 TidScan(p1)
3551 not used hint:
3552 duplication hint:
3553 error hint:
3554
3555                        QUERY PLAN                        
3556 ---------------------------------------------------------
3557  Merge Join
3558    Merge Cond: (p1.id = t1.id)
3559    ->  Sort
3560          Sort Key: p1.id
3561          ->  Append
3562                ->  Tid Scan on p1
3563                      TID Cond: (ctid = '(1,1)'::tid)
3564                      Filter: ((id >= 50) AND (id <= 51))
3565                ->  Tid Scan on p1_c1
3566                      TID Cond: (ctid = '(1,1)'::tid)
3567                      Filter: ((id >= 50) AND (id <= 51))
3568                ->  Tid Scan on p1_c2
3569                      TID Cond: (ctid = '(1,1)'::tid)
3570                      Filter: ((id >= 50) AND (id <= 51))
3571                ->  Tid Scan on p1_c3
3572                      TID Cond: (ctid = '(1,1)'::tid)
3573                      Filter: ((id >= 50) AND (id <= 51))
3574                ->  Tid Scan on p1_c4
3575                      TID Cond: (ctid = '(1,1)'::tid)
3576                      Filter: ((id >= 50) AND (id <= 51))
3577                ->  Tid Scan on p1_c1_c1
3578                      TID Cond: (ctid = '(1,1)'::tid)
3579                      Filter: ((id >= 50) AND (id <= 51))
3580                ->  Tid Scan on p1_c1_c2
3581                      TID Cond: (ctid = '(1,1)'::tid)
3582                      Filter: ((id >= 50) AND (id <= 51))
3583                ->  Tid Scan on p1_c3_c1
3584                      TID Cond: (ctid = '(1,1)'::tid)
3585                      Filter: ((id >= 50) AND (id <= 51))
3586                ->  Tid Scan on p1_c3_c2
3587                      TID Cond: (ctid = '(1,1)'::tid)
3588                      Filter: ((id >= 50) AND (id <= 51))
3589    ->  Index Scan using t1_pkey on t1
3590          Index Cond: (id < 10)
3591 (34 rows)
3592
3593 /*+NestLoop(p1 t1)*/
3594 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3595 LOG:  pg_hint_plan:
3596 used hint:
3597 NestLoop(p1 t1)
3598 not used hint:
3599 duplication hint:
3600 error hint:
3601
3602                                  QUERY PLAN                                  
3603 -----------------------------------------------------------------------------
3604  Nested Loop
3605    Join Filter: (p1.id = t1.id)
3606    ->  Append
3607          ->  Seq Scan on p1
3608                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3609          ->  Seq Scan on p1_c1
3610                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3611          ->  Seq Scan on p1_c2
3612                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3613          ->  Seq Scan on p1_c3
3614                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3615          ->  Seq Scan on p1_c4
3616                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3617          ->  Seq Scan on p1_c1_c1
3618                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3619          ->  Seq Scan on p1_c1_c2
3620                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3621          ->  Seq Scan on p1_c3_c1
3622                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3623          ->  Seq Scan on p1_c3_c2
3624                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3625    ->  Materialize
3626          ->  Index Scan using t1_pkey on t1
3627                Index Cond: (id < 10)
3628 (24 rows)
3629
3630 /*+MergeJoin(p1 t1)*/
3631 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3632 LOG:  pg_hint_plan:
3633 used hint:
3634 MergeJoin(p1 t1)
3635 not used hint:
3636 duplication hint:
3637 error hint:
3638
3639                                     QUERY PLAN                                     
3640 -----------------------------------------------------------------------------------
3641  Merge Join
3642    Merge Cond: (p1.id = t1.id)
3643    ->  Sort
3644          Sort Key: p1.id
3645          ->  Append
3646                ->  Seq Scan on p1
3647                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3648                ->  Seq Scan on p1_c1
3649                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3650                ->  Seq Scan on p1_c2
3651                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3652                ->  Seq Scan on p1_c3
3653                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3654                ->  Seq Scan on p1_c4
3655                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3656                ->  Seq Scan on p1_c1_c1
3657                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3658                ->  Seq Scan on p1_c1_c2
3659                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3660                ->  Seq Scan on p1_c3_c1
3661                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3662                ->  Seq Scan on p1_c3_c2
3663                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3664    ->  Index Scan using t1_pkey on t1
3665          Index Cond: (id < 10)
3666 (25 rows)
3667
3668 /*+HashJoin(p1 t1)*/
3669 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3670 LOG:  pg_hint_plan:
3671 used hint:
3672 HashJoin(p1 t1)
3673 not used hint:
3674 duplication hint:
3675 error hint:
3676
3677                                  QUERY PLAN                                  
3678 -----------------------------------------------------------------------------
3679  Hash Join
3680    Hash Cond: (p1.id = t1.id)
3681    ->  Append
3682          ->  Seq Scan on p1
3683                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3684          ->  Seq Scan on p1_c1
3685                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3686          ->  Seq Scan on p1_c2
3687                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3688          ->  Seq Scan on p1_c3
3689                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3690          ->  Seq Scan on p1_c4
3691                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3692          ->  Seq Scan on p1_c1_c1
3693                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3694          ->  Seq Scan on p1_c1_c2
3695                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3696          ->  Seq Scan on p1_c3_c1
3697                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3698          ->  Seq Scan on p1_c3_c2
3699                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3700    ->  Hash
3701          ->  Index Scan using t1_pkey on t1
3702                Index Cond: (id < 10)
3703 (24 rows)
3704
3705 SET constraint_exclusion TO on;
3706 /*+SeqScan(p1)*/
3707 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3708 LOG:  pg_hint_plan:
3709 used hint:
3710 SeqScan(p1)
3711 not used hint:
3712 duplication hint:
3713 error hint:
3714
3715                                     QUERY PLAN                                     
3716 -----------------------------------------------------------------------------------
3717  Merge Join
3718    Merge Cond: (p1.id = t1.id)
3719    ->  Sort
3720          Sort Key: p1.id
3721          ->  Append
3722                ->  Seq Scan on p1
3723                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3724                ->  Seq Scan on p1_c1
3725                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3726                ->  Seq Scan on p1_c1_c1
3727                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3728                ->  Seq Scan on p1_c1_c2
3729                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3730    ->  Index Scan using t1_pkey on t1
3731          Index Cond: (id < 10)
3732 (15 rows)
3733
3734 /*+IndexScan(p1)*/
3735 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3736 LOG:  pg_hint_plan:
3737 used hint:
3738 IndexScan(p1)
3739 not used hint:
3740 duplication hint:
3741 error hint:
3742
3743                        QUERY PLAN                       
3744 --------------------------------------------------------
3745  Merge Join
3746    Merge Cond: (p1.id = t1.id)
3747    ->  Merge Append
3748          Sort Key: p1.id
3749          ->  Index Scan using p1_pkey on p1
3750                Index Cond: ((id >= 50) AND (id <= 51))
3751                Filter: (ctid = '(1,1)'::tid)
3752          ->  Index Scan using p1_c1_pkey on p1_c1
3753                Index Cond: ((id >= 50) AND (id <= 51))
3754                Filter: (ctid = '(1,1)'::tid)
3755          ->  Index Scan using p1_c1_c1_pkey on p1_c1_c1
3756                Index Cond: ((id >= 50) AND (id <= 51))
3757                Filter: (ctid = '(1,1)'::tid)
3758          ->  Index Scan using p1_c1_c2_pkey on p1_c1_c2
3759                Index Cond: ((id >= 50) AND (id <= 51))
3760                Filter: (ctid = '(1,1)'::tid)
3761    ->  Index Scan using t1_pkey on t1
3762          Index Cond: (id < 10)
3763 (18 rows)
3764
3765 /*+BitmapScan(p1)*/
3766 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3767 LOG:  pg_hint_plan:
3768 used hint:
3769 BitmapScan(p1)
3770 not used hint:
3771 duplication hint:
3772 error hint:
3773
3774                             QUERY PLAN                             
3775 -------------------------------------------------------------------
3776  Merge Join
3777    Merge Cond: (p1.id = t1.id)
3778    ->  Sort
3779          Sort Key: p1.id
3780          ->  Append
3781                ->  Bitmap Heap Scan on p1
3782                      Recheck Cond: ((id >= 50) AND (id <= 51))
3783                      Filter: (ctid = '(1,1)'::tid)
3784                      ->  Bitmap Index Scan on p1_pkey
3785                            Index Cond: ((id >= 50) AND (id <= 51))
3786                ->  Bitmap Heap Scan on p1_c1
3787                      Recheck Cond: ((id >= 50) AND (id <= 51))
3788                      Filter: (ctid = '(1,1)'::tid)
3789                      ->  Bitmap Index Scan on p1_c1_pkey
3790                            Index Cond: ((id >= 50) AND (id <= 51))
3791                ->  Bitmap Heap Scan on p1_c1_c1
3792                      Recheck Cond: ((id >= 50) AND (id <= 51))
3793                      Filter: (ctid = '(1,1)'::tid)
3794                      ->  Bitmap Index Scan on p1_c1_c1_pkey
3795                            Index Cond: ((id >= 50) AND (id <= 51))
3796                ->  Bitmap Heap Scan on p1_c1_c2
3797                      Recheck Cond: ((id >= 50) AND (id <= 51))
3798                      Filter: (ctid = '(1,1)'::tid)
3799                      ->  Bitmap Index Scan on p1_c1_c2_pkey
3800                            Index Cond: ((id >= 50) AND (id <= 51))
3801    ->  Index Scan using t1_pkey on t1
3802          Index Cond: (id < 10)
3803 (27 rows)
3804
3805 /*+TidScan(p1)*/
3806 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3807 LOG:  pg_hint_plan:
3808 used hint:
3809 TidScan(p1)
3810 not used hint:
3811 duplication hint:
3812 error hint:
3813
3814                        QUERY PLAN                        
3815 ---------------------------------------------------------
3816  Merge Join
3817    Merge Cond: (p1.id = t1.id)
3818    ->  Sort
3819          Sort Key: p1.id
3820          ->  Append
3821                ->  Tid Scan on p1
3822                      TID Cond: (ctid = '(1,1)'::tid)
3823                      Filter: ((id >= 50) AND (id <= 51))
3824                ->  Tid Scan on p1_c1
3825                      TID Cond: (ctid = '(1,1)'::tid)
3826                      Filter: ((id >= 50) AND (id <= 51))
3827                ->  Tid Scan on p1_c1_c1
3828                      TID Cond: (ctid = '(1,1)'::tid)
3829                      Filter: ((id >= 50) AND (id <= 51))
3830                ->  Tid Scan on p1_c1_c2
3831                      TID Cond: (ctid = '(1,1)'::tid)
3832                      Filter: ((id >= 50) AND (id <= 51))
3833    ->  Index Scan using t1_pkey on t1
3834          Index Cond: (id < 10)
3835 (19 rows)
3836
3837 /*+NestLoop(p1 t1)*/
3838 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3839 LOG:  pg_hint_plan:
3840 used hint:
3841 NestLoop(p1 t1)
3842 not used hint:
3843 duplication hint:
3844 error hint:
3845
3846                                     QUERY PLAN                                     
3847 -----------------------------------------------------------------------------------
3848  Nested Loop
3849    Join Filter: (p1.id = t1.id)
3850    ->  Index Scan using t1_pkey on t1
3851          Index Cond: (id < 10)
3852    ->  Materialize
3853          ->  Append
3854                ->  Seq Scan on p1
3855                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3856                ->  Seq Scan on p1_c1
3857                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3858                ->  Seq Scan on p1_c1_c1
3859                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3860                ->  Seq Scan on p1_c1_c2
3861                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3862 (14 rows)
3863
3864 /*+MergeJoin(p1 t1)*/
3865 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3866 LOG:  pg_hint_plan:
3867 used hint:
3868 MergeJoin(p1 t1)
3869 not used hint:
3870 duplication hint:
3871 error hint:
3872
3873                                     QUERY PLAN                                     
3874 -----------------------------------------------------------------------------------
3875  Merge Join
3876    Merge Cond: (p1.id = t1.id)
3877    ->  Sort
3878          Sort Key: p1.id
3879          ->  Append
3880                ->  Seq Scan on p1
3881                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3882                ->  Seq Scan on p1_c1
3883                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3884                ->  Seq Scan on p1_c1_c1
3885                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3886                ->  Seq Scan on p1_c1_c2
3887                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3888    ->  Index Scan using t1_pkey on t1
3889          Index Cond: (id < 10)
3890 (15 rows)
3891
3892 /*+HashJoin(p1 t1)*/
3893 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3894 LOG:  pg_hint_plan:
3895 used hint:
3896 HashJoin(p1 t1)
3897 not used hint:
3898 duplication hint:
3899 error hint:
3900
3901                                     QUERY PLAN                                     
3902 -----------------------------------------------------------------------------------
3903  Hash Join
3904    Hash Cond: (t1.id = p1.id)
3905    ->  Index Scan using t1_pkey on t1
3906          Index Cond: (id < 10)
3907    ->  Hash
3908          ->  Append
3909                ->  Seq Scan on p1
3910                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3911                ->  Seq Scan on p1_c1
3912                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3913                ->  Seq Scan on p1_c1_c1
3914                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3915                ->  Seq Scan on p1_c1_c2
3916                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3917 (14 rows)
3918
3919 SET constraint_exclusion TO off;
3920 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3921                            QUERY PLAN                            
3922 -----------------------------------------------------------------
3923  Seq Scan on p1
3924    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3925 (2 rows)
3926
3927 SET constraint_exclusion TO on;
3928 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3929                            QUERY PLAN                            
3930 -----------------------------------------------------------------
3931  Seq Scan on p1
3932    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3933 (2 rows)
3934
3935 SET constraint_exclusion TO off;
3936 /*+SeqScan(p1)*/
3937 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3938 LOG:  pg_hint_plan:
3939 used hint:
3940 SeqScan(p1)
3941 not used hint:
3942 duplication hint:
3943 error hint:
3944
3945                            QUERY PLAN                            
3946 -----------------------------------------------------------------
3947  Seq Scan on p1
3948    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3949 (2 rows)
3950
3951 /*+IndexScan(p1)*/
3952 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3953 LOG:  pg_hint_plan:
3954 used hint:
3955 IndexScan(p1)
3956 not used hint:
3957 duplication hint:
3958 error hint:
3959
3960                 QUERY PLAN                 
3961 -------------------------------------------
3962  Index Scan using p1_pkey on p1
3963    Index Cond: ((id >= 50) AND (id <= 51))
3964    Filter: (ctid = '(1,1)'::tid)
3965 (3 rows)
3966
3967 /*+BitmapScan(p1)*/
3968 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3969 LOG:  pg_hint_plan:
3970 used hint:
3971 BitmapScan(p1)
3972 not used hint:
3973 duplication hint:
3974 error hint:
3975
3976                    QUERY PLAN                    
3977 -------------------------------------------------
3978  Bitmap Heap Scan on p1
3979    Recheck Cond: ((id >= 50) AND (id <= 51))
3980    Filter: (ctid = '(1,1)'::tid)
3981    ->  Bitmap Index Scan on p1_pkey
3982          Index Cond: ((id >= 50) AND (id <= 51))
3983 (5 rows)
3984
3985 /*+TidScan(p1)*/
3986 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3987 LOG:  pg_hint_plan:
3988 used hint:
3989 TidScan(p1)
3990 not used hint:
3991 duplication hint:
3992 error hint:
3993
3994               QUERY PLAN               
3995 ---------------------------------------
3996  Tid Scan on p1
3997    TID Cond: (ctid = '(1,1)'::tid)
3998    Filter: ((id >= 50) AND (id <= 51))
3999 (3 rows)
4000
4001 /*+NestLoop(p1 t1)*/
4002 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4003 LOG:  pg_hint_plan:
4004 used hint:
4005 NestLoop(p1 t1)
4006 not used hint:
4007 duplication hint:
4008 error hint:
4009
4010                               QUERY PLAN                               
4011 -----------------------------------------------------------------------
4012  Nested Loop
4013    Join Filter: (p1.id = t1.id)
4014    ->  Seq Scan on p1
4015          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4016    ->  Index Scan using t1_pkey on t1
4017          Index Cond: (id < 10)
4018 (6 rows)
4019
4020 /*+MergeJoin(p1 t1)*/
4021 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4022 LOG:  pg_hint_plan:
4023 used hint:
4024 MergeJoin(p1 t1)
4025 not used hint:
4026 duplication hint:
4027 error hint:
4028
4029                                  QUERY PLAN                                  
4030 -----------------------------------------------------------------------------
4031  Merge Join
4032    Merge Cond: (p1.id = t1.id)
4033    ->  Sort
4034          Sort Key: p1.id
4035          ->  Seq Scan on p1
4036                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4037    ->  Index Scan using t1_pkey on t1
4038          Index Cond: (id < 10)
4039 (8 rows)
4040
4041 /*+HashJoin(p1 t1)*/
4042 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4043 LOG:  pg_hint_plan:
4044 used hint:
4045 HashJoin(p1 t1)
4046 not used hint:
4047 duplication hint:
4048 error hint:
4049
4050                                  QUERY PLAN                                  
4051 -----------------------------------------------------------------------------
4052  Hash Join
4053    Hash Cond: (t1.id = p1.id)
4054    ->  Index Scan using t1_pkey on t1
4055          Index Cond: (id < 10)
4056    ->  Hash
4057          ->  Seq Scan on p1
4058                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4059 (7 rows)
4060
4061 SET constraint_exclusion TO on;
4062 /*+SeqScan(p1)*/
4063 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4064 LOG:  pg_hint_plan:
4065 used hint:
4066 SeqScan(p1)
4067 not used hint:
4068 duplication hint:
4069 error hint:
4070
4071                            QUERY PLAN                            
4072 -----------------------------------------------------------------
4073  Seq Scan on p1
4074    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4075 (2 rows)
4076
4077 /*+IndexScan(p1)*/
4078 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4079 LOG:  pg_hint_plan:
4080 used hint:
4081 IndexScan(p1)
4082 not used hint:
4083 duplication hint:
4084 error hint:
4085
4086                 QUERY PLAN                 
4087 -------------------------------------------
4088  Index Scan using p1_pkey on p1
4089    Index Cond: ((id >= 50) AND (id <= 51))
4090    Filter: (ctid = '(1,1)'::tid)
4091 (3 rows)
4092
4093 /*+BitmapScan(p1)*/
4094 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4095 LOG:  pg_hint_plan:
4096 used hint:
4097 BitmapScan(p1)
4098 not used hint:
4099 duplication hint:
4100 error hint:
4101
4102                    QUERY PLAN                    
4103 -------------------------------------------------
4104  Bitmap Heap Scan on p1
4105    Recheck Cond: ((id >= 50) AND (id <= 51))
4106    Filter: (ctid = '(1,1)'::tid)
4107    ->  Bitmap Index Scan on p1_pkey
4108          Index Cond: ((id >= 50) AND (id <= 51))
4109 (5 rows)
4110
4111 /*+TidScan(p1)*/
4112 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4113 LOG:  pg_hint_plan:
4114 used hint:
4115 TidScan(p1)
4116 not used hint:
4117 duplication hint:
4118 error hint:
4119
4120               QUERY PLAN               
4121 ---------------------------------------
4122  Tid Scan on p1
4123    TID Cond: (ctid = '(1,1)'::tid)
4124    Filter: ((id >= 50) AND (id <= 51))
4125 (3 rows)
4126
4127 /*+NestLoop(p1 t1)*/
4128 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4129 LOG:  pg_hint_plan:
4130 used hint:
4131 NestLoop(p1 t1)
4132 not used hint:
4133 duplication hint:
4134 error hint:
4135
4136                               QUERY PLAN                               
4137 -----------------------------------------------------------------------
4138  Nested Loop
4139    Join Filter: (p1.id = t1.id)
4140    ->  Seq Scan on p1
4141          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4142    ->  Index Scan using t1_pkey on t1
4143          Index Cond: (id < 10)
4144 (6 rows)
4145
4146 /*+MergeJoin(p1 t1)*/
4147 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4148 LOG:  pg_hint_plan:
4149 used hint:
4150 MergeJoin(p1 t1)
4151 not used hint:
4152 duplication hint:
4153 error hint:
4154
4155                                  QUERY PLAN                                  
4156 -----------------------------------------------------------------------------
4157  Merge Join
4158    Merge Cond: (p1.id = t1.id)
4159    ->  Sort
4160          Sort Key: p1.id
4161          ->  Seq Scan on p1
4162                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4163    ->  Index Scan using t1_pkey on t1
4164          Index Cond: (id < 10)
4165 (8 rows)
4166
4167 /*+HashJoin(p1 t1)*/
4168 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4169 LOG:  pg_hint_plan:
4170 used hint:
4171 HashJoin(p1 t1)
4172 not used hint:
4173 duplication hint:
4174 error hint:
4175
4176                                  QUERY PLAN                                  
4177 -----------------------------------------------------------------------------
4178  Hash Join
4179    Hash Cond: (t1.id = p1.id)
4180    ->  Index Scan using t1_pkey on t1
4181          Index Cond: (id < 10)
4182    ->  Hash
4183          ->  Seq Scan on p1
4184                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4185 (7 rows)
4186
4187 SET constraint_exclusion TO off;
4188 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4189                               QUERY PLAN                               
4190 -----------------------------------------------------------------------
4191  Nested Loop
4192    Join Filter: (p1.id = t1.id)
4193    ->  Seq Scan on p1
4194          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4195    ->  Index Scan using t1_pkey on t1
4196          Index Cond: (id < 10)
4197 (6 rows)
4198
4199 SET constraint_exclusion TO on;
4200 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4201                               QUERY PLAN                               
4202 -----------------------------------------------------------------------
4203  Nested Loop
4204    Join Filter: (p1.id = t1.id)
4205    ->  Seq Scan on p1
4206          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4207    ->  Index Scan using t1_pkey on t1
4208          Index Cond: (id < 10)
4209 (6 rows)
4210
4211 SET constraint_exclusion TO off;
4212 /*+SeqScan(p1)*/
4213 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4214 LOG:  pg_hint_plan:
4215 used hint:
4216 SeqScan(p1)
4217 not used hint:
4218 duplication hint:
4219 error hint:
4220
4221                               QUERY PLAN                               
4222 -----------------------------------------------------------------------
4223  Nested Loop
4224    Join Filter: (p1.id = t1.id)
4225    ->  Seq Scan on p1
4226          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4227    ->  Index Scan using t1_pkey on t1
4228          Index Cond: (id < 10)
4229 (6 rows)
4230
4231 /*+IndexScan(p1)*/
4232 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4233 LOG:  pg_hint_plan:
4234 used hint:
4235 IndexScan(p1)
4236 not used hint:
4237 duplication hint:
4238 error hint:
4239
4240                    QUERY PLAN                    
4241 -------------------------------------------------
4242  Merge Join
4243    Merge Cond: (p1.id = t1.id)
4244    ->  Index Scan using p1_pkey on p1
4245          Index Cond: ((id >= 50) AND (id <= 51))
4246          Filter: (ctid = '(1,1)'::tid)
4247    ->  Index Scan using t1_pkey on t1
4248          Index Cond: (id < 10)
4249 (7 rows)
4250
4251 /*+BitmapScan(p1)*/
4252 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4253 LOG:  pg_hint_plan:
4254 used hint:
4255 BitmapScan(p1)
4256 not used hint:
4257 duplication hint:
4258 error hint:
4259
4260                       QUERY PLAN                       
4261 -------------------------------------------------------
4262  Nested Loop
4263    Join Filter: (p1.id = t1.id)
4264    ->  Bitmap Heap Scan on p1
4265          Recheck Cond: ((id >= 50) AND (id <= 51))
4266          Filter: (ctid = '(1,1)'::tid)
4267          ->  Bitmap Index Scan on p1_pkey
4268                Index Cond: ((id >= 50) AND (id <= 51))
4269    ->  Index Scan using t1_pkey on t1
4270          Index Cond: (id < 10)
4271 (9 rows)
4272
4273 /*+TidScan(p1)*/
4274 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4275 LOG:  pg_hint_plan:
4276 used hint:
4277 TidScan(p1)
4278 not used hint:
4279 duplication hint:
4280 error hint:
4281
4282                  QUERY PLAN                  
4283 ---------------------------------------------
4284  Nested Loop
4285    Join Filter: (p1.id = t1.id)
4286    ->  Tid Scan on p1
4287          TID Cond: (ctid = '(1,1)'::tid)
4288          Filter: ((id >= 50) AND (id <= 51))
4289    ->  Index Scan using t1_pkey on t1
4290          Index Cond: (id < 10)
4291 (7 rows)
4292
4293 SET constraint_exclusion TO on;
4294 /*+SeqScan(p1)*/
4295 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4296 LOG:  pg_hint_plan:
4297 used hint:
4298 SeqScan(p1)
4299 not used hint:
4300 duplication hint:
4301 error hint:
4302
4303                               QUERY PLAN                               
4304 -----------------------------------------------------------------------
4305  Nested Loop
4306    Join Filter: (p1.id = t1.id)
4307    ->  Seq Scan on p1
4308          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4309    ->  Index Scan using t1_pkey on t1
4310          Index Cond: (id < 10)
4311 (6 rows)
4312
4313 /*+IndexScan(p1)*/
4314 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4315 LOG:  pg_hint_plan:
4316 used hint:
4317 IndexScan(p1)
4318 not used hint:
4319 duplication hint:
4320 error hint:
4321
4322                    QUERY PLAN                    
4323 -------------------------------------------------
4324  Merge Join
4325    Merge Cond: (p1.id = t1.id)
4326    ->  Index Scan using p1_pkey on p1
4327          Index Cond: ((id >= 50) AND (id <= 51))
4328          Filter: (ctid = '(1,1)'::tid)
4329    ->  Index Scan using t1_pkey on t1
4330          Index Cond: (id < 10)
4331 (7 rows)
4332
4333 /*+BitmapScan(p1)*/
4334 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4335 LOG:  pg_hint_plan:
4336 used hint:
4337 BitmapScan(p1)
4338 not used hint:
4339 duplication hint:
4340 error hint:
4341
4342                       QUERY PLAN                       
4343 -------------------------------------------------------
4344  Nested Loop
4345    Join Filter: (p1.id = t1.id)
4346    ->  Bitmap Heap Scan on p1
4347          Recheck Cond: ((id >= 50) AND (id <= 51))
4348          Filter: (ctid = '(1,1)'::tid)
4349          ->  Bitmap Index Scan on p1_pkey
4350                Index Cond: ((id >= 50) AND (id <= 51))
4351    ->  Index Scan using t1_pkey on t1
4352          Index Cond: (id < 10)
4353 (9 rows)
4354
4355 /*+TidScan(p1)*/
4356 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4357 LOG:  pg_hint_plan:
4358 used hint:
4359 TidScan(p1)
4360 not used hint:
4361 duplication hint:
4362 error hint:
4363
4364                  QUERY PLAN                  
4365 ---------------------------------------------
4366  Nested Loop
4367    Join Filter: (p1.id = t1.id)
4368    ->  Tid Scan on p1
4369          TID Cond: (ctid = '(1,1)'::tid)
4370          Filter: ((id >= 50) AND (id <= 51))
4371    ->  Index Scan using t1_pkey on t1
4372          Index Cond: (id < 10)
4373 (7 rows)
4374
4375 -- quote test
4376 /*+SeqScan("""t1 )      ")IndexScan("t  2 """)HashJoin("""t1 )  "T3"t   2 """)Leading("""t1 )   "T3"t   2 """)Set(application_name"a    a       a""     a       A")*/
4377 EXPLAIN (COSTS false) SELECT * FROM t1 """t1 )  ", t2 "t        2 """, t3 "T3" WHERE """t1 )    ".id = "t       2 """.id AND """t1 )    ".id = "T3".id;
4378 LOG:  pg_hint_plan:
4379 used hint:
4380 SeqScan("""t1 ) ")
4381 IndexScan("t    2 """)
4382 HashJoin("""t1 )        " T3 "t 2 """)
4383 Leading("""t1 ) " T3 "t 2 """)
4384 Set(application_name "a a       a""     a       A")
4385 not used hint:
4386 duplication hint:
4387 error hint:
4388
4389                        QUERY PLAN                        
4390 ---------------------------------------------------------
4391  Hash Join
4392    Hash Cond: ("t        2 """.id = """t1 )      ".id)
4393    ->  Index Scan using t2_pkey on t2 "t 2 """
4394    ->  Hash
4395          ->  Hash Join
4396                Hash Cond: ("""t1 )       ".id = "T3".id)
4397                ->  Seq Scan on t1 """t1 )        "
4398                ->  Hash
4399                      ->  Seq Scan on t3 "T3"
4400 (9 rows)
4401
4402 -- duplicate hint test
4403 /*+SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)*/
4404 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
4405 INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4406 DETAIL:  Conflict scan method hint.
4407 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4408 DETAIL:  Conflict scan method hint.
4409 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4410 DETAIL:  Conflict scan method hint.
4411 INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4412 DETAIL:  Conflict scan method hint.
4413 INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4414 DETAIL:  Conflict scan method hint.
4415 INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4416 DETAIL:  Conflict scan method hint.
4417 INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4418 DETAIL:  Conflict join method hint.
4419 INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4420 DETAIL:  Conflict join method hint.
4421 INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4422 DETAIL:  Conflict set hint.
4423 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4424 DETAIL:  Conflict leading hint.
4425 LOG:  pg_hint_plan:
4426 used hint:
4427 TidScan(t1)
4428 TidScan(t2)
4429 MergeJoin(t1 t2)
4430 Leading(t2 t1)
4431 Set(enable_mergejoin on)
4432 Set(enable_seqscan on)
4433 not used hint:
4434 duplication hint:
4435 SeqScan(t1)
4436 IndexScan(t1)
4437 BitmapScan(t1)
4438 SeqScan(t2)
4439 IndexScan(t2)
4440 BitmapScan(t2)
4441 HashJoin(t1 t2)
4442 NestLoop(t1 t2)
4443 Leading(t1 t2)
4444 Set(enable_seqscan off)
4445 error hint:
4446
4447                   QUERY PLAN                   
4448 -----------------------------------------------
4449  Merge Join
4450    Merge Cond: (t1.id = t2.id)
4451    ->  Sort
4452          Sort Key: t1.id
4453          ->  Tid Scan on t1
4454                TID Cond: (ctid = '(1,1)'::tid)
4455    ->  Sort
4456          Sort Key: t2.id
4457          ->  Tid Scan on t2
4458                TID Cond: (ctid = '(1,1)'::tid)
4459 (10 rows)
4460
4461 -- sub query Leading hint test
4462 SET from_collapse_limit TO 100;
4463 SET geqo_threshold TO 100;
4464 EXPLAIN (COSTS false)
4465 WITH c1_1(id) AS (
4466 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4467 )
4468 SELECT t1_1.id, (
4469 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4470 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4471 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4472 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4473 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4474 );
4475                                   QUERY PLAN                                  
4476 ------------------------------------------------------------------------------
4477  Nested Loop
4478    CTE c1_1
4479      ->  Aggregate
4480            ->  Merge Join
4481                  Merge Cond: (t1_5.id = t3_5.id)
4482                  ->  Merge Join
4483                        Merge Cond: (t1_5.id = t2_5.id)
4484                        ->  Index Only Scan using t1_pkey on t1 t1_5
4485                        ->  Index Only Scan using t2_pkey on t2 t2_5
4486                  ->  Sort
4487                        Sort Key: t3_5.id
4488                        ->  Seq Scan on t3 t3_5
4489    InitPlan 2 (returns $1)
4490      ->  Aggregate
4491            ->  Merge Join
4492                  Merge Cond: (t1_2.id = t3_2.id)
4493                  ->  Merge Join
4494                        Merge Cond: (t1_2.id = t2_2.id)
4495                        ->  Index Only Scan using t1_pkey on t1 t1_2
4496                        ->  Index Only Scan using t2_pkey on t2 t2_2
4497                  ->  Sort
4498                        Sort Key: t3_2.id
4499                        ->  Seq Scan on t3 t3_2
4500    InitPlan 3 (returns $2)
4501      ->  Aggregate
4502            ->  Merge Join
4503                  Merge Cond: (t1_4.id = t3_4.id)
4504                  ->  Merge Join
4505                        Merge Cond: (t1_4.id = t2_4.id)
4506                        ->  Index Only Scan using t1_pkey on t1 t1_4
4507                        ->  Index Only Scan using t2_pkey on t2 t2_4
4508                  ->  Sort
4509                        Sort Key: t3_4.id
4510                        ->  Seq Scan on t3 t3_4
4511    ->  Nested Loop
4512          ->  Nested Loop
4513                ->  Nested Loop
4514                      ->  Nested Loop
4515                            ->  Nested Loop
4516                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4517                                        Index Cond: (id = $2)
4518                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4519                                        Index Cond: (id = $2)
4520                            ->  Seq Scan on t3 t3_1
4521                                  Filter: (id = $2)
4522                      ->  Index Only Scan using t1_pkey on t1 t1_3
4523                            Index Cond: (id = $2)
4524                ->  Index Only Scan using t2_pkey on t2 t2_3
4525                      Index Cond: (id = $2)
4526          ->  Seq Scan on t3 t3_3
4527                Filter: (id = $2)
4528    ->  CTE Scan on c1_1
4529          Filter: (id = $2)
4530 (53 rows)
4531
4532 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)*/
4533 EXPLAIN (COSTS false)
4534 WITH c1_1(id) AS (
4535 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4536 )
4537 SELECT t1_1.id, (
4538 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4539 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4540 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4541 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4542 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4543 );
4544 LOG:  pg_hint_plan:
4545 used hint:
4546 HashJoin(t1_1 t3_1)
4547 NestLoop(t1_2 t2_2)
4548 MergeJoin(t1_3 t3_3)
4549 NestLoop(t1_4 t2_4)
4550 NestLoop(t1_5 t2_5)
4551 not used hint:
4552 duplication hint:
4553 error hint:
4554
4555                                   QUERY PLAN                                  
4556 ------------------------------------------------------------------------------
4557  Nested Loop
4558    CTE c1_1
4559      ->  Aggregate
4560            ->  Merge Join
4561                  Merge Cond: (t1_5.id = t3_5.id)
4562                  ->  Nested Loop
4563                        ->  Index Only Scan using t2_pkey on t2 t2_5
4564                        ->  Index Only Scan using t1_pkey on t1 t1_5
4565                              Index Cond: (id = t2_5.id)
4566                  ->  Sort
4567                        Sort Key: t3_5.id
4568                        ->  Seq Scan on t3 t3_5
4569    InitPlan 2 (returns $3)
4570      ->  Aggregate
4571            ->  Merge Join
4572                  Merge Cond: (t1_2.id = t3_2.id)
4573                  ->  Nested Loop
4574                        ->  Index Only Scan using t2_pkey on t2 t2_2
4575                        ->  Index Only Scan using t1_pkey on t1 t1_2
4576                              Index Cond: (id = t2_2.id)
4577                  ->  Sort
4578                        Sort Key: t3_2.id
4579                        ->  Seq Scan on t3 t3_2
4580    InitPlan 3 (returns $5)
4581      ->  Aggregate
4582            ->  Merge Join
4583                  Merge Cond: (t1_4.id = t3_4.id)
4584                  ->  Nested Loop
4585                        ->  Index Only Scan using t2_pkey on t2 t2_4
4586                        ->  Index Only Scan using t1_pkey on t1 t1_4
4587                              Index Cond: (id = t2_4.id)
4588                  ->  Sort
4589                        Sort Key: t3_4.id
4590                        ->  Seq Scan on t3 t3_4
4591    ->  Nested Loop
4592          ->  Nested Loop
4593                ->  Nested Loop
4594                      ->  Nested Loop
4595                            ->  Nested Loop
4596                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4597                                        Index Cond: (id = $5)
4598                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4599                                        Index Cond: (id = $5)
4600                            ->  Seq Scan on t3 t3_1
4601                                  Filter: (id = $5)
4602                      ->  Index Only Scan using t1_pkey on t1 t1_3
4603                            Index Cond: (id = $5)
4604                ->  Index Only Scan using t2_pkey on t2 t2_3
4605                      Index Cond: (id = $5)
4606          ->  Seq Scan on t3 t3_3
4607                Filter: (id = $5)
4608    ->  CTE Scan on c1_1
4609          Filter: (id = $5)
4610 (53 rows)
4611
4612 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/
4613 EXPLAIN (COSTS false)
4614 WITH c1_1(id) AS (
4615 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4616 )
4617 SELECT t1_1.id, (
4618 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4619 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4620 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4621 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4622 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4623 );
4624 LOG:  pg_hint_plan:
4625 used hint:
4626 HashJoin(t1_1 t3_1)
4627 NestLoop(t1_2 t2_2)
4628 MergeJoin(t1_3 t3_3)
4629 NestLoop(t1_4 t2_4)
4630 NestLoop(t1_5 t2_5)
4631 not used hint:
4632 Leading(a t1_1 t1_2 t1_4 t1_5)
4633 duplication hint:
4634 error hint:
4635
4636                                   QUERY PLAN                                  
4637 ------------------------------------------------------------------------------
4638  Nested Loop
4639    CTE c1_1
4640      ->  Aggregate
4641            ->  Merge Join
4642                  Merge Cond: (t1_5.id = t3_5.id)
4643                  ->  Nested Loop
4644                        ->  Index Only Scan using t2_pkey on t2 t2_5
4645                        ->  Index Only Scan using t1_pkey on t1 t1_5
4646                              Index Cond: (id = t2_5.id)
4647                  ->  Sort
4648                        Sort Key: t3_5.id
4649                        ->  Seq Scan on t3 t3_5
4650    InitPlan 2 (returns $3)
4651      ->  Aggregate
4652            ->  Merge Join
4653                  Merge Cond: (t1_2.id = t3_2.id)
4654                  ->  Nested Loop
4655                        ->  Index Only Scan using t2_pkey on t2 t2_2
4656                        ->  Index Only Scan using t1_pkey on t1 t1_2
4657                              Index Cond: (id = t2_2.id)
4658                  ->  Sort
4659                        Sort Key: t3_2.id
4660                        ->  Seq Scan on t3 t3_2
4661    InitPlan 3 (returns $5)
4662      ->  Aggregate
4663            ->  Merge Join
4664                  Merge Cond: (t1_4.id = t3_4.id)
4665                  ->  Nested Loop
4666                        ->  Index Only Scan using t2_pkey on t2 t2_4
4667                        ->  Index Only Scan using t1_pkey on t1 t1_4
4668                              Index Cond: (id = t2_4.id)
4669                  ->  Sort
4670                        Sort Key: t3_4.id
4671                        ->  Seq Scan on t3 t3_4
4672    ->  Nested Loop
4673          ->  Nested Loop
4674                ->  Nested Loop
4675                      ->  Nested Loop
4676                            ->  Nested Loop
4677                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4678                                        Index Cond: (id = $5)
4679                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4680                                        Index Cond: (id = $5)
4681                            ->  Seq Scan on t3 t3_1
4682                                  Filter: (id = $5)
4683                      ->  Index Only Scan using t1_pkey on t1 t1_3
4684                            Index Cond: (id = $5)
4685                ->  Index Only Scan using t2_pkey on t2 t2_3
4686                      Index Cond: (id = $5)
4687          ->  Seq Scan on t3 t3_3
4688                Filter: (id = $5)
4689    ->  CTE Scan on c1_1
4690          Filter: (id = $5)
4691 (53 rows)
4692
4693 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/
4694 EXPLAIN (COSTS false)
4695 WITH c1_1(id) AS (
4696 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4697 )
4698 SELECT t1_1.id, (
4699 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4700 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4701 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4702 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4703 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4704 );
4705 LOG:  pg_hint_plan:
4706 used hint:
4707 HashJoin(t1_1 t3_1)
4708 NestLoop(t1_2 t2_2)
4709 MergeJoin(t1_3 t3_3)
4710 NestLoop(t1_4 t2_4)
4711 NestLoop(t1_5 t2_5)
4712 not used hint:
4713 Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)
4714 duplication hint:
4715 error hint:
4716
4717                                   QUERY PLAN                                  
4718 ------------------------------------------------------------------------------
4719  Nested Loop
4720    CTE c1_1
4721      ->  Aggregate
4722            ->  Merge Join
4723                  Merge Cond: (t1_5.id = t3_5.id)
4724                  ->  Nested Loop
4725                        ->  Index Only Scan using t2_pkey on t2 t2_5
4726                        ->  Index Only Scan using t1_pkey on t1 t1_5
4727                              Index Cond: (id = t2_5.id)
4728                  ->  Sort
4729                        Sort Key: t3_5.id
4730                        ->  Seq Scan on t3 t3_5
4731    InitPlan 2 (returns $3)
4732      ->  Aggregate
4733            ->  Merge Join
4734                  Merge Cond: (t1_2.id = t3_2.id)
4735                  ->  Nested Loop
4736                        ->  Index Only Scan using t2_pkey on t2 t2_2
4737                        ->  Index Only Scan using t1_pkey on t1 t1_2
4738                              Index Cond: (id = t2_2.id)
4739                  ->  Sort
4740                        Sort Key: t3_2.id
4741                        ->  Seq Scan on t3 t3_2
4742    InitPlan 3 (returns $5)
4743      ->  Aggregate
4744            ->  Merge Join
4745                  Merge Cond: (t1_4.id = t3_4.id)
4746                  ->  Nested Loop
4747                        ->  Index Only Scan using t2_pkey on t2 t2_4
4748                        ->  Index Only Scan using t1_pkey on t1 t1_4
4749                              Index Cond: (id = t2_4.id)
4750                  ->  Sort
4751                        Sort Key: t3_4.id
4752                        ->  Seq Scan on t3 t3_4
4753    ->  Nested Loop
4754          ->  Nested Loop
4755                ->  Nested Loop
4756                      ->  Nested Loop
4757                            ->  Nested Loop
4758                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4759                                        Index Cond: (id = $5)
4760                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4761                                        Index Cond: (id = $5)
4762                            ->  Seq Scan on t3 t3_1
4763                                  Filter: (id = $5)
4764                      ->  Index Only Scan using t1_pkey on t1 t1_3
4765                            Index Cond: (id = $5)
4766                ->  Index Only Scan using t2_pkey on t2 t2_3
4767                      Index Cond: (id = $5)
4768          ->  Seq Scan on t3 t3_3
4769                Filter: (id = $5)
4770    ->  CTE Scan on c1_1
4771          Filter: (id = $5)
4772 (53 rows)
4773
4774 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/
4775 EXPLAIN (COSTS false)
4776 WITH c1_1(id) AS (
4777 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4778 )
4779 SELECT t1_1.id, (
4780 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4781 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4782 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4783 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4784 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4785 );
4786 LOG:  pg_hint_plan:
4787 used hint:
4788 Leading(t3_5 t2_5 t1_5)
4789 Leading(t3_2 t2_2 t1_2)
4790 Leading(t3_4 t2_4 t1_4)
4791 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
4792 not used hint:
4793 HashJoin(t1_1 t3_1)
4794 NestLoop(t1_2 t2_2)
4795 MergeJoin(t1_3 t3_3)
4796 NestLoop(t1_4 t2_4)
4797 NestLoop(t1_5 t2_5)
4798 duplication hint:
4799 error hint:
4800
4801                                QUERY PLAN                               
4802 ------------------------------------------------------------------------
4803  Nested Loop
4804    CTE c1_1
4805      ->  Aggregate
4806            ->  Merge Join
4807                  Merge Cond: (t2_5.id = t1_5.id)
4808                  ->  Merge Join
4809                        Merge Cond: (t2_5.id = t3_5.id)
4810                        ->  Index Only Scan using t2_pkey on t2 t2_5
4811                        ->  Sort
4812                              Sort Key: t3_5.id
4813                              ->  Seq Scan on t3 t3_5
4814                  ->  Index Only Scan using t1_pkey on t1 t1_5
4815    InitPlan 2 (returns $1)
4816      ->  Aggregate
4817            ->  Merge Join
4818                  Merge Cond: (t2_2.id = t1_2.id)
4819                  ->  Merge Join
4820                        Merge Cond: (t2_2.id = t3_2.id)
4821                        ->  Index Only Scan using t2_pkey on t2 t2_2
4822                        ->  Sort
4823                              Sort Key: t3_2.id
4824                              ->  Seq Scan on t3 t3_2
4825                  ->  Index Only Scan using t1_pkey on t1 t1_2
4826    InitPlan 3 (returns $2)
4827      ->  Aggregate
4828            ->  Merge Join
4829                  Merge Cond: (t2_4.id = t1_4.id)
4830                  ->  Merge Join
4831                        Merge Cond: (t2_4.id = t3_4.id)
4832                        ->  Index Only Scan using t2_pkey on t2 t2_4
4833                        ->  Sort
4834                              Sort Key: t3_4.id
4835                              ->  Seq Scan on t3 t3_4
4836                  ->  Index Only Scan using t1_pkey on t1 t1_4
4837    ->  Nested Loop
4838          ->  Nested Loop
4839                ->  Nested Loop
4840                      ->  Nested Loop
4841                            ->  Nested Loop
4842                                  ->  Seq Scan on t3 t3_3
4843                                        Filter: (id = $2)
4844                                  ->  CTE Scan on c1_1
4845                                        Filter: (id = $2)
4846                            ->  Index Only Scan using t2_pkey on t2 t2_3
4847                                  Index Cond: (id = $2)
4848                      ->  Index Only Scan using t1_pkey on t1 t1_3
4849                            Index Cond: (id = $2)
4850                ->  Seq Scan on t3 t3_1
4851                      Filter: (id = $2)
4852          ->  Index Only Scan using t2_pkey on t2 t2_1
4853                Index Cond: (id = $2)
4854    ->  Index Only Scan using t1_pkey on t1 t1_1
4855          Index Cond: (id = $2)
4856 (53 rows)
4857
4858 SET from_collapse_limit TO 1;
4859 EXPLAIN (COSTS false)
4860 WITH c1_1(id) AS (
4861 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4862 )
4863 SELECT t1_1.id, (
4864 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4865 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4866 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4867 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4868 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4869 );
4870                              QUERY PLAN                             
4871 --------------------------------------------------------------------
4872  Nested Loop
4873    CTE c1_1
4874      ->  Aggregate
4875            ->  Merge Join
4876                  Merge Cond: (t1_5.id = t3_5.id)
4877                  ->  Merge Join
4878                        Merge Cond: (t1_5.id = t2_5.id)
4879                        ->  Index Only Scan using t1_pkey on t1 t1_5
4880                        ->  Index Only Scan using t2_pkey on t2 t2_5
4881                  ->  Sort
4882                        Sort Key: t3_5.id
4883                        ->  Seq Scan on t3 t3_5
4884    InitPlan 2 (returns $1)
4885      ->  Aggregate
4886            ->  Merge Join
4887                  Merge Cond: (t1_2.id = t3_2.id)
4888                  ->  Merge Join
4889                        Merge Cond: (t1_2.id = t2_2.id)
4890                        ->  Index Only Scan using t1_pkey on t1 t1_2
4891                        ->  Index Only Scan using t2_pkey on t2 t2_2
4892                  ->  Sort
4893                        Sort Key: t3_2.id
4894                        ->  Seq Scan on t3 t3_2
4895    InitPlan 3 (returns $2)
4896      ->  Aggregate
4897            ->  Merge Join
4898                  Merge Cond: (t1_4.id = t3_4.id)
4899                  ->  Merge Join
4900                        Merge Cond: (t1_4.id = t2_4.id)
4901                        ->  Index Only Scan using t1_pkey on t1 t1_4
4902                        ->  Index Only Scan using t2_pkey on t2 t2_4
4903                  ->  Sort
4904                        Sort Key: t3_4.id
4905                        ->  Seq Scan on t3 t3_4
4906    ->  Nested Loop
4907          ->  Nested Loop
4908                ->  Nested Loop
4909                      ->  Index Only Scan using t1_pkey on t1 t1_1
4910                            Index Cond: (id = $2)
4911                      ->  Index Only Scan using t2_pkey on t2 t2_1
4912                            Index Cond: (id = $2)
4913                ->  Seq Scan on t3 t3_1
4914                      Filter: (id = $2)
4915          ->  Nested Loop
4916                ->  Nested Loop
4917                      ->  Index Only Scan using t1_pkey on t1 t1_3
4918                            Index Cond: (id = $2)
4919                      ->  Index Only Scan using t2_pkey on t2 t2_3
4920                            Index Cond: (id = $2)
4921                ->  Seq Scan on t3 t3_3
4922                      Filter: (id = $2)
4923    ->  CTE Scan on c1_1
4924          Filter: (id = $2)
4925 (53 rows)
4926
4927 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)*/
4928 EXPLAIN (COSTS false)
4929 WITH c1_1(id) AS (
4930 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
4931 )
4932 SELECT t1_1.id, (
4933 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
4934 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4935 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
4936 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
4937 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
4938 );
4939 LOG:  pg_hint_plan:
4940 used hint:
4941 HashJoin(t1_1 t3_1)
4942 NestLoop(t1_2 t2_2)
4943 MergeJoin(t1_3 t3_3)
4944 NestLoop(t1_4 t2_4)
4945 NestLoop(t1_5 t2_5)
4946 not used hint:
4947 duplication hint:
4948 error hint:
4949
4950                              QUERY PLAN                             
4951 --------------------------------------------------------------------
4952  Nested Loop
4953    CTE c1_1
4954      ->  Aggregate
4955            ->  Merge Join
4956                  Merge Cond: (t1_5.id = t3_5.id)
4957                  ->  Nested Loop
4958                        ->  Index Only Scan using t2_pkey on t2 t2_5
4959                        ->  Index Only Scan using t1_pkey on t1 t1_5
4960                              Index Cond: (id = t2_5.id)
4961                  ->  Sort
4962                        Sort Key: t3_5.id
4963                        ->  Seq Scan on t3 t3_5
4964    InitPlan 2 (returns $3)
4965      ->  Aggregate
4966            ->  Merge Join
4967                  Merge Cond: (t1_2.id = t3_2.id)
4968                  ->  Nested Loop
4969                        ->  Index Only Scan using t2_pkey on t2 t2_2
4970                        ->  Index Only Scan using t1_pkey on t1 t1_2
4971                              Index Cond: (id = t2_2.id)
4972                  ->  Sort
4973                        Sort Key: t3_2.id
4974                        ->  Seq Scan on t3 t3_2
4975    InitPlan 3 (returns $5)
4976      ->  Aggregate
4977            ->  Merge Join
4978                  Merge Cond: (t1_4.id = t3_4.id)
4979                  ->  Nested Loop
4980                        ->  Index Only Scan using t2_pkey on t2 t2_4
4981                        ->  Index Only Scan using t1_pkey on t1 t1_4
4982                              Index Cond: (id = t2_4.id)
4983                  ->  Sort
4984                        Sort Key: t3_4.id
4985                        ->  Seq Scan on t3 t3_4
4986    ->  Nested Loop
4987          ->  Nested Loop
4988                ->  Nested Loop
4989                      ->  Index Only Scan using t1_pkey on t1 t1_1
4990                            Index Cond: (id = $5)
4991                      ->  Index Only Scan using t2_pkey on t2 t2_1
4992                            Index Cond: (id = $5)
4993                ->  Seq Scan on t3 t3_1
4994                      Filter: (id = $5)
4995          ->  Nested Loop
4996                ->  Nested Loop
4997                      ->  Index Only Scan using t1_pkey on t1 t1_3
4998                            Index Cond: (id = $5)
4999                      ->  Index Only Scan using t2_pkey on t2 t2_3
5000                            Index Cond: (id = $5)
5001                ->  Seq Scan on t3 t3_3
5002                      Filter: (id = $5)
5003    ->  CTE Scan on c1_1
5004          Filter: (id = $5)
5005 (53 rows)
5006
5007 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t1_1 t1_2 t1_4 t1_5)*/
5008 EXPLAIN (COSTS false)
5009 WITH c1_1(id) AS (
5010 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
5011 )
5012 SELECT t1_1.id, (
5013 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
5014 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5015 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
5016 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
5017 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
5018 );
5019 LOG:  pg_hint_plan:
5020 used hint:
5021 HashJoin(t1_1 t3_1)
5022 NestLoop(t1_2 t2_2)
5023 MergeJoin(t1_3 t3_3)
5024 NestLoop(t1_4 t2_4)
5025 NestLoop(t1_5 t2_5)
5026 not used hint:
5027 Leading(a t1_1 t1_2 t1_4 t1_5)
5028 duplication hint:
5029 error hint:
5030
5031                              QUERY PLAN                             
5032 --------------------------------------------------------------------
5033  Nested Loop
5034    CTE c1_1
5035      ->  Aggregate
5036            ->  Merge Join
5037                  Merge Cond: (t1_5.id = t3_5.id)
5038                  ->  Nested Loop
5039                        ->  Index Only Scan using t2_pkey on t2 t2_5
5040                        ->  Index Only Scan using t1_pkey on t1 t1_5
5041                              Index Cond: (id = t2_5.id)
5042                  ->  Sort
5043                        Sort Key: t3_5.id
5044                        ->  Seq Scan on t3 t3_5
5045    InitPlan 2 (returns $3)
5046      ->  Aggregate
5047            ->  Merge Join
5048                  Merge Cond: (t1_2.id = t3_2.id)
5049                  ->  Nested Loop
5050                        ->  Index Only Scan using t2_pkey on t2 t2_2
5051                        ->  Index Only Scan using t1_pkey on t1 t1_2
5052                              Index Cond: (id = t2_2.id)
5053                  ->  Sort
5054                        Sort Key: t3_2.id
5055                        ->  Seq Scan on t3 t3_2
5056    InitPlan 3 (returns $5)
5057      ->  Aggregate
5058            ->  Merge Join
5059                  Merge Cond: (t1_4.id = t3_4.id)
5060                  ->  Nested Loop
5061                        ->  Index Only Scan using t2_pkey on t2 t2_4
5062                        ->  Index Only Scan using t1_pkey on t1 t1_4
5063                              Index Cond: (id = t2_4.id)
5064                  ->  Sort
5065                        Sort Key: t3_4.id
5066                        ->  Seq Scan on t3 t3_4
5067    ->  Nested Loop
5068          ->  Nested Loop
5069                ->  Nested Loop
5070                      ->  Index Only Scan using t1_pkey on t1 t1_1
5071                            Index Cond: (id = $5)
5072                      ->  Index Only Scan using t2_pkey on t2 t2_1
5073                            Index Cond: (id = $5)
5074                ->  Seq Scan on t3 t3_1
5075                      Filter: (id = $5)
5076          ->  Nested Loop
5077                ->  Nested Loop
5078                      ->  Index Only Scan using t1_pkey on t1 t1_3
5079                            Index Cond: (id = $5)
5080                      ->  Index Only Scan using t2_pkey on t2 t2_3
5081                            Index Cond: (id = $5)
5082                ->  Seq Scan on t3 t3_3
5083                      Filter: (id = $5)
5084    ->  CTE Scan on c1_1
5085          Filter: (id = $5)
5086 (53 rows)
5087
5088 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)*/
5089 EXPLAIN (COSTS false)
5090 WITH c1_1(id) AS (
5091 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
5092 )
5093 SELECT t1_1.id, (
5094 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
5095 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5096 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
5097 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
5098 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
5099 );
5100 LOG:  pg_hint_plan:
5101 used hint:
5102 HashJoin(t1_1 t3_1)
5103 NestLoop(t1_2 t2_2)
5104 MergeJoin(t1_3 t3_3)
5105 NestLoop(t1_4 t2_4)
5106 NestLoop(t1_5 t2_5)
5107 not used hint:
5108 Leading(a t3_2 t3_5 t2_2 c1_1 t3_4 t3_3 t2_3 t2_4 t1_3 t2_5 t1_2 t3_1 t1_4 t2_1 t1_5 t1_1)
5109 duplication hint:
5110 error hint:
5111
5112                              QUERY PLAN                             
5113 --------------------------------------------------------------------
5114  Nested Loop
5115    CTE c1_1
5116      ->  Aggregate
5117            ->  Merge Join
5118                  Merge Cond: (t1_5.id = t3_5.id)
5119                  ->  Nested Loop
5120                        ->  Index Only Scan using t2_pkey on t2 t2_5
5121                        ->  Index Only Scan using t1_pkey on t1 t1_5
5122                              Index Cond: (id = t2_5.id)
5123                  ->  Sort
5124                        Sort Key: t3_5.id
5125                        ->  Seq Scan on t3 t3_5
5126    InitPlan 2 (returns $3)
5127      ->  Aggregate
5128            ->  Merge Join
5129                  Merge Cond: (t1_2.id = t3_2.id)
5130                  ->  Nested Loop
5131                        ->  Index Only Scan using t2_pkey on t2 t2_2
5132                        ->  Index Only Scan using t1_pkey on t1 t1_2
5133                              Index Cond: (id = t2_2.id)
5134                  ->  Sort
5135                        Sort Key: t3_2.id
5136                        ->  Seq Scan on t3 t3_2
5137    InitPlan 3 (returns $5)
5138      ->  Aggregate
5139            ->  Merge Join
5140                  Merge Cond: (t1_4.id = t3_4.id)
5141                  ->  Nested Loop
5142                        ->  Index Only Scan using t2_pkey on t2 t2_4
5143                        ->  Index Only Scan using t1_pkey on t1 t1_4
5144                              Index Cond: (id = t2_4.id)
5145                  ->  Sort
5146                        Sort Key: t3_4.id
5147                        ->  Seq Scan on t3 t3_4
5148    ->  Nested Loop
5149          ->  Nested Loop
5150                ->  Nested Loop
5151                      ->  Index Only Scan using t1_pkey on t1 t1_1
5152                            Index Cond: (id = $5)
5153                      ->  Index Only Scan using t2_pkey on t2 t2_1
5154                            Index Cond: (id = $5)
5155                ->  Seq Scan on t3 t3_1
5156                      Filter: (id = $5)
5157          ->  Nested Loop
5158                ->  Nested Loop
5159                      ->  Index Only Scan using t1_pkey on t1 t1_3
5160                            Index Cond: (id = $5)
5161                      ->  Index Only Scan using t2_pkey on t2 t2_3
5162                            Index Cond: (id = $5)
5163                ->  Seq Scan on t3 t3_3
5164                      Filter: (id = $5)
5165    ->  CTE Scan on c1_1
5166          Filter: (id = $5)
5167 (53 rows)
5168
5169 /*+HashJoin(t1_1 t3_1)MergeJoin(t1_3 t3_3)NestLoop(t1_2 t2_2)NestLoop(t1_4 t2_4)NestLoop(t1_5 t2_5)Leading(t3_5 t2_5 t1_5)Leading(t3_2 t2_2 t1_2)Leading(t3_4 t2_4 t1_4)Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)*/
5170 EXPLAIN (COSTS false)
5171 WITH c1_1(id) AS (
5172 SELECT max(t1_5.id) FROM t1 t1_5, t2 t2_5, t3 t3_5 WHERE t1_5.id = t2_5.id AND t2_5.id = t3_5.id
5173 )
5174 SELECT t1_1.id, (
5175 SELECT max(t1_2.id) FROM t1 t1_2, t2 t2_2, t3 t3_2 WHERE t1_2.id = t2_2.id AND t2_2.id = t3_2.id
5176 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5177 SELECT t1_3.id FROM t1 t1_3, t2 t2_3, t3 t3_3 WHERE t1_3.id = t2_3.id AND t2_3.id = t3_3.id
5178 ) v1_1(id), c1_1 WHERE t1_1.id = t2_1.id AND t2_1.id = t3_1.id AND t2_1.id = v1_1.id AND v1_1.id = c1_1.id AND t1_1.id = (
5179 SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t2_4.id = t3_4.id 
5180 );
5181 LOG:  pg_hint_plan:
5182 used hint:
5183 MergeJoin(t1_3 t3_3)
5184 Leading(t3_5 t2_5 t1_5)
5185 Leading(t3_2 t2_2 t1_2)
5186 Leading(t3_4 t2_4 t1_4)
5187 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
5188 not used hint:
5189 HashJoin(t1_1 t3_1)
5190 NestLoop(t1_2 t2_2)
5191 NestLoop(t1_4 t2_4)
5192 NestLoop(t1_5 t2_5)
5193 duplication hint:
5194 error hint:
5195
5196                                   QUERY PLAN                                  
5197 ------------------------------------------------------------------------------
5198  Nested Loop
5199    CTE c1_1
5200      ->  Aggregate
5201            ->  Merge Join
5202                  Merge Cond: (t2_5.id = t1_5.id)
5203                  ->  Merge Join
5204                        Merge Cond: (t2_5.id = t3_5.id)
5205                        ->  Index Only Scan using t2_pkey on t2 t2_5
5206                        ->  Sort
5207                              Sort Key: t3_5.id
5208                              ->  Seq Scan on t3 t3_5
5209                  ->  Index Only Scan using t1_pkey on t1 t1_5
5210    InitPlan 2 (returns $1)
5211      ->  Aggregate
5212            ->  Merge Join
5213                  Merge Cond: (t2_2.id = t1_2.id)
5214                  ->  Merge Join
5215                        Merge Cond: (t2_2.id = t3_2.id)
5216                        ->  Index Only Scan using t2_pkey on t2 t2_2
5217                        ->  Sort
5218                              Sort Key: t3_2.id
5219                              ->  Seq Scan on t3 t3_2
5220                  ->  Index Only Scan using t1_pkey on t1 t1_2
5221    InitPlan 3 (returns $2)
5222      ->  Aggregate
5223            ->  Merge Join
5224                  Merge Cond: (t2_4.id = t1_4.id)
5225                  ->  Merge Join
5226                        Merge Cond: (t2_4.id = t3_4.id)
5227                        ->  Index Only Scan using t2_pkey on t2 t2_4
5228                        ->  Sort
5229                              Sort Key: t3_4.id
5230                              ->  Seq Scan on t3 t3_4
5231                  ->  Index Only Scan using t1_pkey on t1 t1_4
5232    ->  Nested Loop
5233          ->  Nested Loop
5234                ->  Nested Loop
5235                      ->  Nested Loop
5236                            ->  Nested Loop
5237                                  ->  Index Only Scan using t1_pkey on t1 t1_3
5238                                        Index Cond: (id = $2)
5239                                  ->  Index Only Scan using t2_pkey on t2 t2_3
5240                                        Index Cond: (id = $2)
5241                            ->  Seq Scan on t3 t3_3
5242                                  Filter: (id = $2)
5243                      ->  CTE Scan on c1_1
5244                            Filter: (id = $2)
5245                ->  Seq Scan on t3 t3_1
5246                      Filter: (id = $2)
5247          ->  Index Only Scan using t2_pkey on t2 t2_1
5248                Index Cond: (id = $2)
5249    ->  Index Only Scan using t1_pkey on t1 t1_1
5250          Index Cond: (id = $2)
5251 (53 rows)
5252
5253 -- ambigous error
5254 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5255                    QUERY PLAN                    
5256 -------------------------------------------------
5257  Merge Join
5258    Merge Cond: (t1.id = t2.id)
5259    ->  Merge Join
5260          Merge Cond: (t1.id = t1_1.id)
5261          ->  Index Scan using t1_pkey on t1
5262          ->  Index Scan using t1_pkey on t1 t1_1
5263    ->  Index Scan using t2_pkey on t2
5264 (7 rows)
5265
5266 /*+NestLoop(t1 t2)*/
5267 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5268 INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t2)"
5269 DETAIL:  Relation name "t1" is ambiguous.
5270 LOG:  pg_hint_plan:
5271 used hint:
5272 not used hint:
5273 duplication hint:
5274 error hint:
5275 NestLoop(t1 t2)
5276
5277                    QUERY PLAN                    
5278 -------------------------------------------------
5279  Merge Join
5280    Merge Cond: (t1.id = t2.id)
5281    ->  Merge Join
5282          Merge Cond: (t1.id = t1_1.id)
5283          ->  Index Scan using t1_pkey on t1
5284          ->  Index Scan using t1_pkey on t1 t1_1
5285    ->  Index Scan using t2_pkey on t2
5286 (7 rows)
5287
5288 /*+Leading(t1 t2 t1)*/
5289 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5290 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t1)"
5291 DETAIL:  Relation name "t1" is ambiguous.
5292 LOG:  pg_hint_plan:
5293 used hint:
5294 not used hint:
5295 duplication hint:
5296 error hint:
5297 Leading(t1 t2 t1)
5298
5299                    QUERY PLAN                    
5300 -------------------------------------------------
5301  Merge Join
5302    Merge Cond: (t1.id = t2.id)
5303    ->  Merge Join
5304          Merge Cond: (t1.id = t1_1.id)
5305          ->  Index Scan using t1_pkey on t1
5306          ->  Index Scan using t1_pkey on t1 t1_1
5307    ->  Index Scan using t2_pkey on t2
5308 (7 rows)
5309
5310 -- identifier length test
5311 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5312                                                   QUERY PLAN                                                  
5313 --------------------------------------------------------------------------------------------------------------
5314  Merge Join
5315    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5316    ->  Merge Join
5317          Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id)
5318          ->  Index Scan using t1_pkey on t1 "123456789012345678901234567890123456789012345678901234567890123"
5319          ->  Index Scan using t2_pkey on t2
5320    ->  Sort
5321          Sort Key: t3.id
5322          ->  Seq Scan on t3
5323 (9 rows)
5324
5325 /*+
5326 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5327 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5328 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5329 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5330 */
5331 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5332 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5333 LOG:  pg_hint_plan:
5334 used hint:
5335 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5336 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5337 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5338 not used hint:
5339 duplication hint:
5340 error hint:
5341 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5342
5343                                              QUERY PLAN                                             
5344 ----------------------------------------------------------------------------------------------------
5345  Merge Join
5346    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5347    ->  Merge Join
5348          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5349          ->  Index Scan using t2_pkey on t2
5350          ->  Sort
5351                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5352                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5353    ->  Sort
5354          Sort Key: t3.id
5355          ->  Seq Scan on t3
5356 (11 rows)
5357
5358 /*+
5359 Leading(1234567890123456789012345678901234567890123456789012345678901234 t2 t3)
5360 SeqScan(1234567890123456789012345678901234567890123456789012345678901234)
5361 MergeJoin(1234567890123456789012345678901234567890123456789012345678901234 t2)
5362 Set(1234567890123456789012345678901234567890123456789012345678901234 1)
5363 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5364 */
5365 EXPLAIN (COSTS false) SELECT * FROM t1 "1234567890123456789012345678901234567890123456789012345678901234" JOIN t2 ON ("1234567890123456789012345678901234567890123456789012345678901234".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5366 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5367 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5368 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5369 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5370 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5371 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5372 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5373 LOG:  pg_hint_plan:
5374 used hint:
5375 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5376 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5377 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5378 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5379 not used hint:
5380 duplication hint:
5381 error hint:
5382 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5383
5384                                              QUERY PLAN                                             
5385 ----------------------------------------------------------------------------------------------------
5386  Merge Join
5387    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5388    ->  Merge Join
5389          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5390          ->  Index Scan using t2_pkey on t2
5391          ->  Sort
5392                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5393                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5394    ->  Sort
5395          Sort Key: t3.id
5396          ->  Seq Scan on t3
5397 (11 rows)
5398
5399 SET "123456789012345678901234567890123456789012345678901234567890123" TO 1;
5400 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5401 SET "1234567890123456789012345678901234567890123456789012345678901234" TO 1;
5402 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5403 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5404 SET cursor_tuple_fraction TO 1234567890123456789012345678901234567890123456789012345678901234;
5405 ERROR:  1.23457e+63 is outside the valid range for parameter "cursor_tuple_fraction" (0 .. 1)
5406 -- multi error
5407 /*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/
5408 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
5409 INFO:  parameter "enable_seqscan" requires a Boolean value
5410 INFO:  parameter "seq_page_cost" requires a numeric value
5411 LOG:  pg_hint_plan:
5412 used hint:
5413 not used hint:
5414 duplication hint:
5415 error hint:
5416 Set(enable_seqscan 100)
5417 Set(seq_page_cost on)
5418
5419               QUERY PLAN              
5420 --------------------------------------
5421  Merge Join
5422    Merge Cond: (t1.id = t2.id)
5423    ->  Index Scan using t1_pkey on t1
5424    ->  Index Scan using t2_pkey on t2
5425 (4 rows)
5426
5427 -- debug log of candidate index to use IndexScan
5428 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5429                                        QUERY PLAN                                       
5430 ----------------------------------------------------------------------------------------
5431  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
5432    Index Cond: (id = 1)
5433 (2 rows)
5434
5435 /*+IndexScan(t5 t5_id2)*/
5436 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5437 LOG:  available indexes for IndexScan(t5): t5_id2
5438 LOG:  pg_hint_plan:
5439 used hint:
5440 IndexScan(t5 t5_id2)
5441 not used hint:
5442 duplication hint:
5443 error hint:
5444
5445           QUERY PLAN           
5446 -------------------------------
5447  Index Scan using t5_id2 on t5
5448    Index Cond: (id = 1)
5449 (2 rows)
5450
5451 /*+IndexScan(t5 no_exist)*/
5452 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5453 LOG:  available indexes for IndexScan(t5):
5454 LOG:  pg_hint_plan:
5455 used hint:
5456 IndexScan(t5 no_exist)
5457 not used hint:
5458 duplication hint:
5459 error hint:
5460
5461      QUERY PLAN     
5462 --------------------
5463  Seq Scan on t5
5464    Filter: (id = 1)
5465 (2 rows)
5466
5467 /*+IndexScan(t5 t5_id1 t5_id2)*/
5468 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5469 LOG:  available indexes for IndexScan(t5): t5_id2 t5_id1
5470 LOG:  pg_hint_plan:
5471 used hint:
5472 IndexScan(t5 t5_id1 t5_id2)
5473 not used hint:
5474 duplication hint:
5475 error hint:
5476
5477           QUERY PLAN           
5478 -------------------------------
5479  Index Scan using t5_id2 on t5
5480    Index Cond: (id = 1)
5481 (2 rows)
5482
5483 /*+IndexScan(t5 no_exist t5_id2)*/
5484 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5485 LOG:  available indexes for IndexScan(t5): t5_id2
5486 LOG:  pg_hint_plan:
5487 used hint:
5488 IndexScan(t5 no_exist t5_id2)
5489 not used hint:
5490 duplication hint:
5491 error hint:
5492
5493           QUERY PLAN           
5494 -------------------------------
5495  Index Scan using t5_id2 on t5
5496    Index Cond: (id = 1)
5497 (2 rows)
5498
5499 /*+IndexScan(t5 no_exist5 no_exist2)*/
5500 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5501 LOG:  available indexes for IndexScan(t5):
5502 LOG:  pg_hint_plan:
5503 used hint:
5504 IndexScan(t5 no_exist5 no_exist2)
5505 not used hint:
5506 duplication hint:
5507 error hint:
5508
5509      QUERY PLAN     
5510 --------------------
5511  Seq Scan on t5
5512    Filter: (id = 1)
5513 (2 rows)
5514
5515 -- outer inner
5516 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5517                        QUERY PLAN                       
5518 --------------------------------------------------------
5519  Hash Join
5520    Hash Cond: (t3.val = t2.val)
5521    ->  Seq Scan on t3
5522    ->  Hash
5523          ->  Hash Join
5524                Hash Cond: (t2.id = t1.id)
5525                ->  Seq Scan on t2
5526                ->  Hash
5527                      ->  Index Scan using t1_pkey on t1
5528                            Index Cond: (id < 10)
5529 (10 rows)
5530
5531 /*+Leading((t1))*/
5532 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5533 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1))"
5534 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5535 LOG:  pg_hint_plan:
5536 used hint:
5537 not used hint:
5538 duplication hint:
5539 error hint:
5540 Leading((t1))
5541
5542                        QUERY PLAN                       
5543 --------------------------------------------------------
5544  Hash Join
5545    Hash Cond: (t3.val = t2.val)
5546    ->  Seq Scan on t3
5547    ->  Hash
5548          ->  Hash Join
5549                Hash Cond: (t2.id = t1.id)
5550                ->  Seq Scan on t2
5551                ->  Hash
5552                      ->  Index Scan using t1_pkey on t1
5553                            Index Cond: (id < 10)
5554 (10 rows)
5555
5556 /*+Leading((t1 t2))*/
5557 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5558 LOG:  pg_hint_plan:
5559 used hint:
5560 Leading((t1 t2))
5561 not used hint:
5562 duplication hint:
5563 error hint:
5564
5565                  QUERY PLAN                 
5566 --------------------------------------------
5567  Nested Loop
5568    Join Filter: (t2.val = t3.val)
5569    ->  Hash Join
5570          Hash Cond: (t1.id = t2.id)
5571          ->  Index Scan using t1_pkey on t1
5572                Index Cond: (id < 10)
5573          ->  Hash
5574                ->  Seq Scan on t2
5575    ->  Seq Scan on t3
5576 (9 rows)
5577
5578 /*+Leading((t1 t2 t3))*/
5579 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5580 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1 t2 t3))"
5581 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5582 LOG:  pg_hint_plan:
5583 used hint:
5584 not used hint:
5585 duplication hint:
5586 error hint:
5587 Leading((t1 t2 t3))
5588
5589                        QUERY PLAN                       
5590 --------------------------------------------------------
5591  Hash Join
5592    Hash Cond: (t3.val = t2.val)
5593    ->  Seq Scan on t3
5594    ->  Hash
5595          ->  Hash Join
5596                Hash Cond: (t2.id = t1.id)
5597                ->  Seq Scan on t2
5598                ->  Hash
5599                      ->  Index Scan using t1_pkey on t1
5600                            Index Cond: (id < 10)
5601 (10 rows)
5602
5603 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5604                  QUERY PLAN                 
5605 --------------------------------------------
5606  Hash Join
5607    Hash Cond: (t2.id = t1.id)
5608    ->  Seq Scan on t2
5609    ->  Hash
5610          ->  Index Scan using t1_pkey on t1
5611                Index Cond: (id < 10)
5612 (6 rows)
5613
5614 /*+Leading((t1 t2))*/
5615 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5616 LOG:  pg_hint_plan:
5617 used hint:
5618 Leading((t1 t2))
5619 not used hint:
5620 duplication hint:
5621 error hint:
5622
5623               QUERY PLAN              
5624 --------------------------------------
5625  Hash Join
5626    Hash Cond: (t1.id = t2.id)
5627    ->  Index Scan using t1_pkey on t1
5628          Index Cond: (id < 10)
5629    ->  Hash
5630          ->  Seq Scan on t2
5631 (6 rows)
5632
5633 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5634                        QUERY PLAN                       
5635 --------------------------------------------------------
5636  Hash Join
5637    Hash Cond: (t3.val = t2.val)
5638    ->  Seq Scan on t3
5639    ->  Hash
5640          ->  Hash Join
5641                Hash Cond: (t2.id = t1.id)
5642                ->  Seq Scan on t2
5643                ->  Hash
5644                      ->  Index Scan using t1_pkey on t1
5645                            Index Cond: (id < 10)
5646 (10 rows)
5647
5648 /*+Leading(((t1 t2) t3))*/
5649 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5650 LOG:  pg_hint_plan:
5651 used hint:
5652 Leading(((t1 t2) t3))
5653 not used hint:
5654 duplication hint:
5655 error hint:
5656
5657                  QUERY PLAN                 
5658 --------------------------------------------
5659  Nested Loop
5660    Join Filter: (t2.val = t3.val)
5661    ->  Hash Join
5662          Hash Cond: (t1.id = t2.id)
5663          ->  Index Scan using t1_pkey on t1
5664                Index Cond: (id < 10)
5665          ->  Hash
5666                ->  Seq Scan on t2
5667    ->  Seq Scan on t3
5668 (9 rows)
5669
5670 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
5671                        QUERY PLAN                       
5672 --------------------------------------------------------
5673  Nested Loop
5674    ->  Merge Join
5675          Merge Cond: (t3.id = t4.id)
5676          ->  Nested Loop
5677                Join Filter: (t1.val = t3.val)
5678                ->  Index Scan using t3_pkey on t3
5679                ->  Materialize
5680                      ->  Index Scan using t1_pkey on t1
5681                            Index Cond: (id < 10)
5682          ->  Sort
5683                Sort Key: t4.id
5684                ->  Seq Scan on t4
5685    ->  Index Scan using t2_pkey on t2
5686          Index Cond: (id = t1.id)
5687 (14 rows)
5688
5689 /*+Leading((((t1 t2) t3) t4))*/
5690 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
5691 LOG:  pg_hint_plan:
5692 used hint:
5693 Leading((((t1 t2) t3) t4))
5694 not used hint:
5695 duplication hint:
5696 error hint:
5697
5698                     QUERY PLAN                    
5699 --------------------------------------------------
5700  Nested Loop
5701    ->  Nested Loop
5702          Join Filter: (t1.val = t3.val)
5703          ->  Hash Join
5704                Hash Cond: (t1.id = t2.id)
5705                ->  Index Scan using t1_pkey on t1
5706                      Index Cond: (id < 10)
5707                ->  Hash
5708                      ->  Seq Scan on t2
5709          ->  Seq Scan on t3
5710    ->  Index Scan using t4_pkey on t4
5711          Index Cond: (id = t3.id)
5712 (12 rows)
5713
5714 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5715                        QUERY PLAN                       
5716 --------------------------------------------------------
5717  Hash Join
5718    Hash Cond: (t3.val = t2.val)
5719    ->  Seq Scan on t3
5720    ->  Hash
5721          ->  Hash Join
5722                Hash Cond: (t2.id = t1.id)
5723                ->  Seq Scan on t2
5724                ->  Hash
5725                      ->  Index Scan using t1_pkey on t1
5726                            Index Cond: (id < 10)
5727 (10 rows)
5728
5729 /*+Leading(((t1 t2) t3))*/
5730 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5731 LOG:  pg_hint_plan:
5732 used hint:
5733 Leading(((t1 t2) t3))
5734 not used hint:
5735 duplication hint:
5736 error hint:
5737
5738                  QUERY PLAN                 
5739 --------------------------------------------
5740  Nested Loop
5741    Join Filter: (t2.val = t3.val)
5742    ->  Hash Join
5743          Hash Cond: (t1.id = t2.id)
5744          ->  Index Scan using t1_pkey on t1
5745                Index Cond: (id < 10)
5746          ->  Hash
5747                ->  Seq Scan on t2
5748    ->  Seq Scan on t3
5749 (9 rows)
5750
5751 /*+Leading((t1 (t2 t3)))*/
5752 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5753 LOG:  pg_hint_plan:
5754 used hint:
5755 Leading((t1 (t2 t3)))
5756 not used hint:
5757 duplication hint:
5758 error hint:
5759
5760                  QUERY PLAN                 
5761 --------------------------------------------
5762  Hash Join
5763    Hash Cond: (t1.id = t2.id)
5764    ->  Index Scan using t1_pkey on t1
5765          Index Cond: (id < 10)
5766    ->  Hash
5767          ->  Hash Join
5768                Hash Cond: (t2.val = t3.val)
5769                ->  Seq Scan on t2
5770                ->  Hash
5771                      ->  Seq Scan on t3
5772 (10 rows)
5773
5774 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
5775                        QUERY PLAN                       
5776 --------------------------------------------------------
5777  Nested Loop
5778    ->  Merge Join
5779          Merge Cond: (t3.id = t4.id)
5780          ->  Nested Loop
5781                Join Filter: (t1.val = t3.val)
5782                ->  Index Scan using t3_pkey on t3
5783                ->  Materialize
5784                      ->  Index Scan using t1_pkey on t1
5785                            Index Cond: (id < 10)
5786          ->  Sort
5787                Sort Key: t4.id
5788                ->  Seq Scan on t4
5789    ->  Index Scan using t2_pkey on t2
5790          Index Cond: (id = t1.id)
5791 (14 rows)
5792
5793 /*+Leading(((t1 t2) (t3 t4)))*/
5794 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
5795 LOG:  pg_hint_plan:
5796 used hint:
5797 Leading(((t1 t2) (t3 t4)))
5798 not used hint:
5799 duplication hint:
5800 error hint:
5801
5802                  QUERY PLAN                 
5803 --------------------------------------------
5804  Nested Loop
5805    Join Filter: (t1.val = t3.val)
5806    ->  Hash Join
5807          Hash Cond: (t1.id = t2.id)
5808          ->  Index Scan using t1_pkey on t1
5809                Index Cond: (id < 10)
5810          ->  Hash
5811                ->  Seq Scan on t2
5812    ->  Merge Join
5813          Merge Cond: (t3.id = t4.id)
5814          ->  Index Scan using t3_pkey on t3
5815          ->  Sort
5816                Sort Key: t4.id
5817                ->  Seq Scan on t4
5818 (14 rows)
5819
5820 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1);
5821                              QUERY PLAN                             
5822 --------------------------------------------------------------------
5823  Hash Join
5824    Hash Cond: (t2.val = t3.val)
5825    InitPlan 1 (returns $1)
5826      ->  Limit
5827            ->  Sort
5828                  Sort Key: t1_2.id
5829                  ->  Nested Loop
5830                        ->  Index Scan using t2_val on t2 t2_2
5831                              Index Cond: (val > 100)
5832                        ->  Index Only Scan using t1_pkey on t1 t1_2
5833                              Index Cond: (id = t2_2.id)
5834    ->  Merge Join
5835          Merge Cond: (t1.id = t2.id)
5836          ->  Index Scan using t1_pkey on t1
5837                Index Cond: (id < $1)
5838          ->  Index Scan using t2_pkey on t2
5839    ->  Hash
5840          ->  Seq Scan on t3
5841 (18 rows)
5842
5843 /*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
5844 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t1.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1);
5845 INFO:  pg_hint_plan: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
5846 DETAIL:  Conflict leading hint.
5847 LOG:  pg_hint_plan:
5848 used hint:
5849 Leading(((t3 t1) t2))
5850 not used hint:
5851 duplication hint:
5852 Leading(((t1 t2) t3))
5853 error hint:
5854
5855                              QUERY PLAN                             
5856 --------------------------------------------------------------------
5857  Hash Join
5858    Hash Cond: (t1.id = t2.id)
5859    InitPlan 1 (returns $1)
5860      ->  Limit
5861            ->  Sort
5862                  Sort Key: t1_2.id
5863                  ->  Nested Loop
5864                        ->  Index Scan using t2_val on t2 t2_2
5865                              Index Cond: (val > 100)
5866                        ->  Index Only Scan using t1_pkey on t1 t1_2
5867                              Index Cond: (id = t2_2.id)
5868    ->  Hash Join
5869          Hash Cond: (t3.val = t1.val)
5870          ->  Seq Scan on t3
5871          ->  Hash
5872                ->  Index Scan using t1_pkey on t1
5873                      Index Cond: (id < $1)
5874    ->  Hash
5875          ->  Seq Scan on t2
5876 (19 rows)
5877
5878 /*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/
5879 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1);
5880 LOG:  pg_hint_plan:
5881 used hint:
5882 Leading(((t1 t2) t3))
5883 Leading((t1_2 t2_2))
5884 not used hint:
5885 duplication hint:
5886 error hint:
5887
5888                           QUERY PLAN                          
5889 --------------------------------------------------------------
5890  Hash Join
5891    Hash Cond: (t2.val = t3.val)
5892    InitPlan 1 (returns $0)
5893      ->  Limit
5894            ->  Merge Join
5895                  Merge Cond: (t1_2.id = t2_2.id)
5896                  ->  Index Only Scan using t1_pkey on t1 t1_2
5897                  ->  Sort
5898                        Sort Key: t2_2.id
5899                        ->  Index Scan using t2_val on t2 t2_2
5900                              Index Cond: (val > 100)
5901    ->  Merge Join
5902          Merge Cond: (t1.id = t2.id)
5903          ->  Index Scan using t1_pkey on t1
5904                Index Cond: (id < $0)
5905          ->  Index Scan using t2_pkey on t2
5906    ->  Hash
5907          ->  Seq Scan on t3
5908 (18 rows)
5909
5910 /*+Leading(((((t1 t2) t3) t1_2) t2_2))*/
5911 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1);
5912 LOG:  pg_hint_plan:
5913 used hint:
5914 not used hint:
5915 Leading(((((t1 t2) t3) t1_2) t2_2))
5916 duplication hint:
5917 error hint:
5918
5919                              QUERY PLAN                             
5920 --------------------------------------------------------------------
5921  Hash Join
5922    Hash Cond: (t2.val = t3.val)
5923    InitPlan 1 (returns $1)
5924      ->  Limit
5925            ->  Sort
5926                  Sort Key: t1_2.id
5927                  ->  Nested Loop
5928                        ->  Index Scan using t2_val on t2 t2_2
5929                              Index Cond: (val > 100)
5930                        ->  Index Only Scan using t1_pkey on t1 t1_2
5931                              Index Cond: (id = t2_2.id)
5932    ->  Merge Join
5933          Merge Cond: (t1.id = t2.id)
5934          ->  Index Scan using t1_pkey on t1
5935                Index Cond: (id < $1)
5936          ->  Index Scan using t2_pkey on t2
5937    ->  Hash
5938          ->  Seq Scan on t3
5939 (18 rows)
5940
5941 -- Specified outer/inner leading hint and join method hint at the same time
5942 /*+Leading(((t1 t2) t3))*/
5943 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5944 LOG:  pg_hint_plan:
5945 used hint:
5946 Leading(((t1 t2) t3))
5947 not used hint:
5948 duplication hint:
5949 error hint:
5950
5951                  QUERY PLAN                 
5952 --------------------------------------------
5953  Nested Loop
5954    Join Filter: (t2.val = t3.val)
5955    ->  Hash Join
5956          Hash Cond: (t1.id = t2.id)
5957          ->  Index Scan using t1_pkey on t1
5958                Index Cond: (id < 10)
5959          ->  Hash
5960                ->  Seq Scan on t2
5961    ->  Seq Scan on t3
5962 (9 rows)
5963
5964 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/
5965 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5966 LOG:  pg_hint_plan:
5967 used hint:
5968 MergeJoin(t1 t2)
5969 Leading(((t1 t2) t3))
5970 not used hint:
5971 duplication hint:
5972 error hint:
5973
5974                  QUERY PLAN                 
5975 --------------------------------------------
5976  Nested Loop
5977    Join Filter: (t2.val = t3.val)
5978    ->  Merge Join
5979          Merge Cond: (t1.id = t2.id)
5980          ->  Index Scan using t1_pkey on t1
5981                Index Cond: (id < 10)
5982          ->  Index Scan using t2_pkey on t2
5983    ->  Seq Scan on t3
5984 (8 rows)
5985
5986 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/
5987 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5988 LOG:  pg_hint_plan:
5989 used hint:
5990 MergeJoin(t1 t2 t3)
5991 Leading(((t1 t2) t3))
5992 not used hint:
5993 duplication hint:
5994 error hint:
5995
5996                     QUERY PLAN                    
5997 --------------------------------------------------
5998  Merge Join
5999    Merge Cond: (t2.val = t3.val)
6000    ->  Sort
6001          Sort Key: t2.val
6002          ->  Hash Join
6003                Hash Cond: (t1.id = t2.id)
6004                ->  Index Scan using t1_pkey on t1
6005                      Index Cond: (id < 10)
6006                ->  Hash
6007                      ->  Seq Scan on t2
6008    ->  Sort
6009          Sort Key: t3.val
6010          ->  Seq Scan on t3
6011 (13 rows)
6012
6013 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/
6014 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6015 LOG:  pg_hint_plan:
6016 used hint:
6017 Leading(((t1 t2) t3))
6018 not used hint:
6019 MergeJoin(t1 t3)
6020 duplication hint:
6021 error hint:
6022
6023                  QUERY PLAN                 
6024 --------------------------------------------
6025  Nested Loop
6026    Join Filter: (t2.val = t3.val)
6027    ->  Hash Join
6028          Hash Cond: (t1.id = t2.id)
6029          ->  Index Scan using t1_pkey on t1
6030                Index Cond: (id < 10)
6031          ->  Hash
6032                ->  Seq Scan on t2
6033    ->  Seq Scan on t3
6034 (9 rows)
6035
6036 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
6037                        QUERY PLAN                       
6038 --------------------------------------------------------
6039  Nested Loop
6040    ->  Merge Join
6041          Merge Cond: (t3.id = t4.id)
6042          ->  Nested Loop
6043                Join Filter: (t1.val = t3.val)
6044                ->  Index Scan using t3_pkey on t3
6045                ->  Materialize
6046                      ->  Index Scan using t1_pkey on t1
6047                            Index Cond: (id < 10)
6048          ->  Sort
6049                Sort Key: t4.id
6050                ->  Seq Scan on t4
6051    ->  Index Scan using t2_pkey on t2
6052          Index Cond: (id = t1.id)
6053 (14 rows)
6054
6055 /*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/
6056 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
6057 LOG:  pg_hint_plan:
6058 used hint:
6059 Leading(((t1 t2) t3))
6060 not used hint:
6061 MergeJoin(t3 t4)
6062 duplication hint:
6063 error hint:
6064
6065                     QUERY PLAN                    
6066 --------------------------------------------------
6067  Nested Loop
6068    Join Filter: (t3.id = t4.id)
6069    ->  Nested Loop
6070          Join Filter: (t1.val = t3.val)
6071          ->  Hash Join
6072                Hash Cond: (t1.id = t2.id)
6073                ->  Index Scan using t1_pkey on t1
6074                      Index Cond: (id < 10)
6075                ->  Hash
6076                      ->  Seq Scan on t2
6077          ->  Seq Scan on t3
6078    ->  Seq Scan on t4
6079 (12 rows)
6080
6081 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
6082 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t3.id = t4.id AND t1.val = t3.val AND t1.id < 10;
6083 LOG:  pg_hint_plan:
6084 used hint:
6085 MergeJoin(t1 t2 t3 t4)
6086 Leading(((t1 t2) t3))
6087 not used hint:
6088 duplication hint:
6089 error hint:
6090
6091                        QUERY PLAN                       
6092 --------------------------------------------------------
6093  Merge Join
6094    Merge Cond: (t3.id = t4.id)
6095    ->  Sort
6096          Sort Key: t3.id
6097          ->  Nested Loop
6098                Join Filter: (t1.val = t3.val)
6099                ->  Hash Join
6100                      Hash Cond: (t1.id = t2.id)
6101                      ->  Index Scan using t1_pkey on t1
6102                            Index Cond: (id < 10)
6103                      ->  Hash
6104                            ->  Seq Scan on t2
6105                ->  Seq Scan on t3
6106    ->  Sort
6107          Sort Key: t4.id
6108          ->  Seq Scan on t4
6109 (16 rows)
6110
6111 /*+ Leading ( ( t1 ( t2 t3 ) ) ) */
6112 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6113 LOG:  pg_hint_plan:
6114 used hint:
6115 Leading((t1 (t2 t3)))
6116 not used hint:
6117 duplication hint:
6118 error hint:
6119
6120                  QUERY PLAN                 
6121 --------------------------------------------
6122  Hash Join
6123    Hash Cond: (t1.id = t2.id)
6124    ->  Index Scan using t1_pkey on t1
6125          Index Cond: (id < 10)
6126    ->  Hash
6127          ->  Hash Join
6128                Hash Cond: (t2.val = t3.val)
6129                ->  Seq Scan on t2
6130                ->  Hash
6131                      ->  Seq Scan on t3
6132 (10 rows)
6133
6134 /*+Leading((t1(t2 t3)))*/
6135 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6136 LOG:  pg_hint_plan:
6137 used hint:
6138 Leading((t1 (t2 t3)))
6139 not used hint:
6140 duplication hint:
6141 error hint:
6142
6143                  QUERY PLAN                 
6144 --------------------------------------------
6145  Hash Join
6146    Hash Cond: (t1.id = t2.id)
6147    ->  Index Scan using t1_pkey on t1
6148          Index Cond: (id < 10)
6149    ->  Hash
6150          ->  Hash Join
6151                Hash Cond: (t2.val = t3.val)
6152                ->  Seq Scan on t2
6153                ->  Hash
6154                      ->  Seq Scan on t3
6155 (10 rows)
6156
6157 /*+Leading(("t1(t2" "t3)"))*/
6158 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6159 LOG:  pg_hint_plan:
6160 used hint:
6161 not used hint:
6162 Leading(("t1(t2" "t3)"))
6163 duplication hint:
6164 error hint:
6165
6166                        QUERY PLAN                       
6167 --------------------------------------------------------
6168  Hash Join
6169    Hash Cond: (t3.val = t2.val)
6170    ->  Seq Scan on t3
6171    ->  Hash
6172          ->  Hash Join
6173                Hash Cond: (t2.id = t1.id)
6174                ->  Seq Scan on t2
6175                ->  Hash
6176                      ->  Index Scan using t1_pkey on t1
6177                            Index Cond: (id < 10)
6178 (10 rows)
6179
6180 /*+ Leading ( ( ( t1 t2 ) t3 ) ) */
6181 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6182 LOG:  pg_hint_plan:
6183 used hint:
6184 Leading(((t1 t2) t3))
6185 not used hint:
6186 duplication hint:
6187 error hint:
6188
6189                  QUERY PLAN                 
6190 --------------------------------------------
6191  Nested Loop
6192    Join Filter: (t2.val = t3.val)
6193    ->  Hash Join
6194          Hash Cond: (t1.id = t2.id)
6195          ->  Index Scan using t1_pkey on t1
6196                Index Cond: (id < 10)
6197          ->  Hash
6198                ->  Seq Scan on t2
6199    ->  Seq Scan on t3
6200 (9 rows)
6201
6202 /*+Leading(((t1 t2)t3))*/
6203 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6204 LOG:  pg_hint_plan:
6205 used hint:
6206 Leading(((t1 t2) t3))
6207 not used hint:
6208 duplication hint:
6209 error hint:
6210
6211                  QUERY PLAN                 
6212 --------------------------------------------
6213  Nested Loop
6214    Join Filter: (t2.val = t3.val)
6215    ->  Hash Join
6216          Hash Cond: (t1.id = t2.id)
6217          ->  Index Scan using t1_pkey on t1
6218                Index Cond: (id < 10)
6219          ->  Hash
6220                ->  Seq Scan on t2
6221    ->  Seq Scan on t3
6222 (9 rows)
6223
6224 /*+Leading(("(t1" "t2)t3"))*/
6225 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6226 LOG:  pg_hint_plan:
6227 used hint:
6228 not used hint:
6229 Leading(("(t1" "t2)t3"))
6230 duplication hint:
6231 error hint:
6232
6233                        QUERY PLAN                       
6234 --------------------------------------------------------
6235  Hash Join
6236    Hash Cond: (t3.val = t2.val)
6237    ->  Seq Scan on t3
6238    ->  Hash
6239          ->  Hash Join
6240                Hash Cond: (t2.id = t1.id)
6241                ->  Seq Scan on t2
6242                ->  Hash
6243                      ->  Index Scan using t1_pkey on t1
6244                            Index Cond: (id < 10)
6245 (10 rows)
6246
6247 /*+Leading((t1(t2(t3(t4 t5)))))*/
6248 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6249 LOG:  pg_hint_plan:
6250 used hint:
6251 Leading((t1 (t2 (t3 (t4 t5)))))
6252 not used hint:
6253 duplication hint:
6254 error hint:
6255
6256                                                             QUERY PLAN                                                            
6257 ----------------------------------------------------------------------------------------------------------------------------------
6258  Merge Join
6259    Merge Cond: (t1.id = t2.id)
6260    ->  Index Scan using t1_pkey on t1
6261    ->  Materialize
6262          ->  Merge Join
6263                Merge Cond: (t2.id = t3.id)
6264                ->  Index Scan using t2_pkey on t2
6265                ->  Materialize
6266                      ->  Merge Join
6267                            Merge Cond: (t3.id = t4.id)
6268                            ->  Index Scan using t3_pkey on t3
6269                            ->  Materialize
6270                                  ->  Merge Join
6271                                        Merge Cond: (t4.id = t5.id)
6272                                        ->  Index Scan using t4_pkey on t4
6273                                        ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6274 (16 rows)
6275
6276 /*+Leading((t5(t4(t3(t2 t1)))))*/
6277 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6278 LOG:  pg_hint_plan:
6279 used hint:
6280 Leading((t5 (t4 (t3 (t2 t1)))))
6281 not used hint:
6282 duplication hint:
6283 error hint:
6284
6285                                 QUERY PLAN                                
6286 --------------------------------------------------------------------------
6287  Hash Join
6288    Hash Cond: (t5.id = t1.id)
6289    ->  Seq Scan on t5
6290    ->  Hash
6291          ->  Merge Join
6292                Merge Cond: (t4.id = t1.id)
6293                ->  Sort
6294                      Sort Key: t4.id
6295                      ->  Seq Scan on t4
6296                ->  Materialize
6297                      ->  Merge Join
6298                            Merge Cond: (t3.id = t1.id)
6299                            ->  Sort
6300                                  Sort Key: t3.id
6301                                  ->  Seq Scan on t3
6302                            ->  Materialize
6303                                  ->  Merge Join
6304                                        Merge Cond: (t2.id = t1.id)
6305                                        ->  Index Scan using t2_pkey on t2
6306                                        ->  Index Scan using t1_pkey on t1
6307 (20 rows)
6308
6309 /*+Leading(((((t1 t2)t3)t4)t5))*/
6310 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6311 LOG:  pg_hint_plan:
6312 used hint:
6313 Leading(((((t1 t2) t3) t4) t5))
6314 not used hint:
6315 duplication hint:
6316 error hint:
6317
6318                                           QUERY PLAN                                          
6319 ----------------------------------------------------------------------------------------------
6320  Nested Loop
6321    ->  Merge Join
6322          Merge Cond: (t1.id = t4.id)
6323          ->  Merge Join
6324                Merge Cond: (t1.id = t3.id)
6325                ->  Merge Join
6326                      Merge Cond: (t1.id = t2.id)
6327                      ->  Index Scan using t1_pkey on t1
6328                      ->  Index Scan using t2_pkey on t2
6329                ->  Sort
6330                      Sort Key: t3.id
6331                      ->  Seq Scan on t3
6332          ->  Sort
6333                Sort Key: t4.id
6334                ->  Seq Scan on t4
6335    ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6336          Index Cond: (id = t1.id)
6337 (17 rows)
6338
6339 /*+Leading(((((t5 t4)t3)t2)t1))*/
6340 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6341 LOG:  pg_hint_plan:
6342 used hint:
6343 Leading(((((t5 t4) t3) t2) t1))
6344 not used hint:
6345 duplication hint:
6346 error hint:
6347
6348                                                    QUERY PLAN                                                   
6349 ----------------------------------------------------------------------------------------------------------------
6350  Nested Loop
6351    Join Filter: (t2.id = t1.id)
6352    ->  Nested Loop
6353          Join Filter: (t3.id = t2.id)
6354          ->  Merge Join
6355                Merge Cond: (t4.id = t3.id)
6356                ->  Merge Join
6357                      Merge Cond: (t5.id = t4.id)
6358                      ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6359                      ->  Sort
6360                            Sort Key: t4.id
6361                            ->  Seq Scan on t4
6362                ->  Index Scan using t3_pkey on t3
6363          ->  Index Scan using t2_pkey on t2
6364                Index Cond: (id = t5.id)
6365    ->  Index Scan using t1_pkey on t1
6366          Index Cond: (id = t5.id)
6367 (17 rows)
6368
6369 /*+Leading(((t1 t2)(t3(t4 t5))))*/
6370 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6371 LOG:  pg_hint_plan:
6372 used hint:
6373 Leading(((t1 t2) (t3 (t4 t5))))
6374 not used hint:
6375 duplication hint:
6376 error hint:
6377
6378                                                       QUERY PLAN                                                      
6379 ----------------------------------------------------------------------------------------------------------------------
6380  Merge Join
6381    Merge Cond: (t1.id = t3.id)
6382    ->  Merge Join
6383          Merge Cond: (t1.id = t2.id)
6384          ->  Index Scan using t1_pkey on t1
6385          ->  Index Scan using t2_pkey on t2
6386    ->  Materialize
6387          ->  Merge Join
6388                Merge Cond: (t3.id = t4.id)
6389                ->  Index Scan using t3_pkey on t3
6390                ->  Materialize
6391                      ->  Merge Join
6392                            Merge Cond: (t4.id = t5.id)
6393                            ->  Index Scan using t4_pkey on t4
6394                            ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6395 (15 rows)
6396
6397 /*+Leading(((t5 t4)(t3(t2 t1))))*/
6398 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6399 LOG:  pg_hint_plan:
6400 used hint:
6401 Leading(((t5 t4) (t3 (t2 t1))))
6402 not used hint:
6403 duplication hint:
6404 error hint:
6405
6406                                              QUERY PLAN                                             
6407 ----------------------------------------------------------------------------------------------------
6408  Merge Join
6409    Merge Cond: (t4.id = t1.id)
6410    ->  Merge Join
6411          Merge Cond: (t5.id = t4.id)
6412          ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6413          ->  Sort
6414                Sort Key: t4.id
6415                ->  Seq Scan on t4
6416    ->  Materialize
6417          ->  Merge Join
6418                Merge Cond: (t3.id = t1.id)
6419                ->  Sort
6420                      Sort Key: t3.id
6421                      ->  Seq Scan on t3
6422                ->  Materialize
6423                      ->  Merge Join
6424                            Merge Cond: (t2.id = t1.id)
6425                            ->  Index Scan using t2_pkey on t2
6426                            ->  Index Scan using t1_pkey on t1
6427 (19 rows)
6428
6429 /*+Leading((((t1 t2)t3)(t4 t5)))*/
6430 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6431 LOG:  pg_hint_plan:
6432 used hint:
6433 Leading((((t1 t2) t3) (t4 t5)))
6434 not used hint:
6435 duplication hint:
6436 error hint:
6437
6438                                                 QUERY PLAN                                                
6439 ----------------------------------------------------------------------------------------------------------
6440  Merge Join
6441    Merge Cond: (t1.id = t4.id)
6442    ->  Merge Join
6443          Merge Cond: (t1.id = t3.id)
6444          ->  Merge Join
6445                Merge Cond: (t1.id = t2.id)
6446                ->  Index Scan using t1_pkey on t1
6447                ->  Index Scan using t2_pkey on t2
6448          ->  Sort
6449                Sort Key: t3.id
6450                ->  Seq Scan on t3
6451    ->  Materialize
6452          ->  Merge Join
6453                Merge Cond: (t4.id = t5.id)
6454                ->  Index Scan using t4_pkey on t4
6455                ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6456 (16 rows)
6457
6458 /*+Leading((((t5 t4)t3)(t2 t1)))*/
6459 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4, t5 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id AND t1.id = t5.id;
6460 LOG:  pg_hint_plan:
6461 used hint:
6462 Leading((((t5 t4) t3) (t2 t1)))
6463 not used hint:
6464 duplication hint:
6465 error hint:
6466
6467                                                 QUERY PLAN                                                
6468 ----------------------------------------------------------------------------------------------------------
6469  Merge Join
6470    Merge Cond: (t3.id = t1.id)
6471    ->  Merge Join
6472          Merge Cond: (t4.id = t3.id)
6473          ->  Merge Join
6474                Merge Cond: (t5.id = t4.id)
6475                ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6476                ->  Sort
6477                      Sort Key: t4.id
6478                      ->  Seq Scan on t4
6479          ->  Index Scan using t3_pkey on t3
6480    ->  Materialize
6481          ->  Merge Join
6482                Merge Cond: (t2.id = t1.id)
6483                ->  Index Scan using t2_pkey on t2
6484                ->  Index Scan using t1_pkey on t1
6485 (16 rows)
6486
6487 -- inherite table test to specify the index's name
6488 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6489                               QUERY PLAN                               
6490 -----------------------------------------------------------------------
6491  Append
6492    ->  Seq Scan on p2
6493          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6494    ->  Seq Scan on p2_c1
6495          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6496    ->  Seq Scan on p2_c1_c1
6497          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6498    ->  Seq Scan on p2_c1_c2
6499          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6500 (9 rows)
6501
6502 /*+IndexScan(p2 p2_pkey)*/
6503 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6504 LOG:  available indexes for IndexScan(p2): p2_pkey
6505 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6506 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6507 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6508 LOG:  pg_hint_plan:
6509 used hint:
6510 IndexScan(p2 p2_pkey)
6511 not used hint:
6512 duplication hint:
6513 error hint:
6514
6515                     QUERY PLAN                    
6516 --------------------------------------------------
6517  Append
6518    ->  Index Scan using p2_pkey on p2
6519          Index Cond: ((id >= 50) AND (id <= 51))
6520          Filter: (ctid = '(1,1)'::tid)
6521    ->  Index Scan using p2_c1_pkey on p2_c1
6522          Index Cond: ((id >= 50) AND (id <= 51))
6523          Filter: (ctid = '(1,1)'::tid)
6524    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6525          Index Cond: ((id >= 50) AND (id <= 51))
6526          Filter: (ctid = '(1,1)'::tid)
6527    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6528          Index Cond: ((id >= 50) AND (id <= 51))
6529          Filter: (ctid = '(1,1)'::tid)
6530 (13 rows)
6531
6532 /*+IndexScan(p2 p2_id_val_idx)*/
6533 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6534 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
6535 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6536 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
6537 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
6538 LOG:  pg_hint_plan:
6539 used hint:
6540 IndexScan(p2 p2_id_val_idx)
6541 not used hint:
6542 duplication hint:
6543 error hint:
6544
6545                        QUERY PLAN                       
6546 --------------------------------------------------------
6547  Append
6548    ->  Index Scan using p2_id_val_idx on p2
6549          Index Cond: ((id >= 50) AND (id <= 51))
6550          Filter: (ctid = '(1,1)'::tid)
6551    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6552          Index Cond: ((id >= 50) AND (id <= 51))
6553          Filter: (ctid = '(1,1)'::tid)
6554    ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
6555          Index Cond: ((id >= 50) AND (id <= 51))
6556          Filter: (ctid = '(1,1)'::tid)
6557    ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
6558          Index Cond: ((id >= 50) AND (id <= 51))
6559          Filter: (ctid = '(1,1)'::tid)
6560 (13 rows)
6561
6562 /*+IndexScan(p2 p2_val_id_idx)*/
6563 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6564 LOG:  available indexes for IndexScan(p2): p2_val_id_idx
6565 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_id_idx
6566 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx
6567 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx
6568 LOG:  pg_hint_plan:
6569 used hint:
6570 IndexScan(p2 p2_val_id_idx)
6571 not used hint:
6572 duplication hint:
6573 error hint:
6574
6575                        QUERY PLAN                       
6576 --------------------------------------------------------
6577  Append
6578    ->  Index Scan using p2_val_id_idx on p2
6579          Index Cond: ((id >= 50) AND (id <= 51))
6580          Filter: (ctid = '(1,1)'::tid)
6581    ->  Index Scan using p2_c1_val_id_idx on p2_c1
6582          Index Cond: ((id >= 50) AND (id <= 51))
6583          Filter: (ctid = '(1,1)'::tid)
6584    ->  Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1
6585          Index Cond: ((id >= 50) AND (id <= 51))
6586          Filter: (ctid = '(1,1)'::tid)
6587    ->  Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2
6588          Index Cond: ((id >= 50) AND (id <= 51))
6589          Filter: (ctid = '(1,1)'::tid)
6590 (13 rows)
6591
6592 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6593                                        QUERY PLAN                                        
6594 -----------------------------------------------------------------------------------------
6595  Append
6596    ->  Seq Scan on p2
6597          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6598    ->  Seq Scan on p2_c1
6599          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6600    ->  Seq Scan on p2_c2
6601          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6602    ->  Seq Scan on p2_c3
6603          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6604    ->  Seq Scan on p2_c4
6605          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6606    ->  Seq Scan on p2_c1_c1
6607          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6608    ->  Seq Scan on p2_c1_c2
6609          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6610    ->  Seq Scan on p2_c3_c1
6611          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6612    ->  Seq Scan on p2_c3_c2
6613          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6614 (19 rows)
6615
6616 -- Inhibit parallel exection to avoid interfaring the hint
6617 set max_parallel_workers_per_gather to 0;
6618 /*+ IndexScan(p2 p2_val)*/
6619 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6620 LOG:  available indexes for IndexScan(p2):
6621 LOG:  available indexes for IndexScan(p2_c1):
6622 LOG:  available indexes for IndexScan(p2_c2):
6623 LOG:  available indexes for IndexScan(p2_c3):
6624 LOG:  available indexes for IndexScan(p2_c4):
6625 LOG:  available indexes for IndexScan(p2_c1_c1):
6626 LOG:  available indexes for IndexScan(p2_c1_c2):
6627 LOG:  available indexes for IndexScan(p2_c3_c1):
6628 LOG:  available indexes for IndexScan(p2_c3_c2):
6629 LOG:  pg_hint_plan:
6630 used hint:
6631 IndexScan(p2 p2_val)
6632 not used hint:
6633 duplication hint:
6634 error hint:
6635
6636                                        QUERY PLAN                                        
6637 -----------------------------------------------------------------------------------------
6638  Append
6639    ->  Seq Scan on p2
6640          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6641    ->  Seq Scan on p2_c1
6642          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6643    ->  Seq Scan on p2_c2
6644          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6645    ->  Seq Scan on p2_c3
6646          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6647    ->  Seq Scan on p2_c4
6648          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6649    ->  Seq Scan on p2_c1_c1
6650          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6651    ->  Seq Scan on p2_c1_c2
6652          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6653    ->  Seq Scan on p2_c3_c1
6654          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6655    ->  Seq Scan on p2_c3_c2
6656          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6657 (19 rows)
6658
6659 /*+IndexScan(p2 p2_pkey)*/
6660 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6661 LOG:  available indexes for IndexScan(p2): p2_pkey
6662 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6663 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6664 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6665 LOG:  pg_hint_plan:
6666 used hint:
6667 IndexScan(p2 p2_pkey)
6668 not used hint:
6669 duplication hint:
6670 error hint:
6671
6672                     QUERY PLAN                    
6673 --------------------------------------------------
6674  Append
6675    ->  Index Scan using p2_pkey on p2
6676          Index Cond: ((id >= 50) AND (id <= 51))
6677          Filter: (ctid = '(1,1)'::tid)
6678    ->  Index Scan using p2_c1_pkey on p2_c1
6679          Index Cond: ((id >= 50) AND (id <= 51))
6680          Filter: (ctid = '(1,1)'::tid)
6681    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6682          Index Cond: ((id >= 50) AND (id <= 51))
6683          Filter: (ctid = '(1,1)'::tid)
6684    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6685          Index Cond: ((id >= 50) AND (id <= 51))
6686          Filter: (ctid = '(1,1)'::tid)
6687 (13 rows)
6688
6689 /*+IndexScan(p2 p2_id2_val)*/
6690 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6691 LOG:  available indexes for IndexScan(p2): p2_id2_val
6692 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id2_val
6693 LOG:  available indexes for IndexScan(p2_c1_c1):
6694 LOG:  available indexes for IndexScan(p2_c1_c2):
6695 LOG:  pg_hint_plan:
6696 used hint:
6697 IndexScan(p2 p2_id2_val)
6698 not used hint:
6699 duplication hint:
6700 error hint:
6701
6702                               QUERY PLAN                               
6703 -----------------------------------------------------------------------
6704  Append
6705    ->  Index Scan using p2_id2_val on p2
6706          Index Cond: ((id >= 50) AND (id <= 51))
6707          Filter: (ctid = '(1,1)'::tid)
6708    ->  Index Scan using p2_c1_id2_val on p2_c1
6709          Index Cond: ((id >= 50) AND (id <= 51))
6710          Filter: (ctid = '(1,1)'::tid)
6711    ->  Seq Scan on p2_c1_c1
6712          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6713    ->  Seq Scan on p2_c1_c2
6714          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6715 (11 rows)
6716
6717 /*+IndexScan(p2 p2_val2_id)*/
6718 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6719 LOG:  available indexes for IndexScan(p2): p2_val2_id
6720 LOG:  available indexes for IndexScan(p2_c1):
6721 LOG:  available indexes for IndexScan(p2_c1_c1):
6722 LOG:  available indexes for IndexScan(p2_c1_c2):
6723 LOG:  pg_hint_plan:
6724 used hint:
6725 IndexScan(p2 p2_val2_id)
6726 not used hint:
6727 duplication hint:
6728 error hint:
6729
6730                               QUERY PLAN                               
6731 -----------------------------------------------------------------------
6732  Append
6733    ->  Index Scan using p2_val2_id on p2
6734          Index Cond: ((id >= 50) AND (id <= 51))
6735          Filter: (ctid = '(1,1)'::tid)
6736    ->  Seq Scan on p2_c1
6737          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6738    ->  Seq Scan on p2_c1_c1
6739          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6740    ->  Seq Scan on p2_c1_c2
6741          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6742 (10 rows)
6743
6744 /*+IndexScan(p2 p2_pkey)*/
6745 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6746 LOG:  available indexes for IndexScan(p2): p2_pkey
6747 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6748 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6749 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6750 LOG:  pg_hint_plan:
6751 used hint:
6752 IndexScan(p2 p2_pkey)
6753 not used hint:
6754 duplication hint:
6755 error hint:
6756
6757                     QUERY PLAN                    
6758 --------------------------------------------------
6759  Append
6760    ->  Index Scan using p2_pkey on p2
6761          Index Cond: ((id >= 50) AND (id <= 51))
6762          Filter: (ctid = '(1,1)'::tid)
6763    ->  Index Scan using p2_c1_pkey on p2_c1
6764          Index Cond: ((id >= 50) AND (id <= 51))
6765          Filter: (ctid = '(1,1)'::tid)
6766    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6767          Index Cond: ((id >= 50) AND (id <= 51))
6768          Filter: (ctid = '(1,1)'::tid)
6769    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6770          Index Cond: ((id >= 50) AND (id <= 51))
6771          Filter: (ctid = '(1,1)'::tid)
6772 (13 rows)
6773
6774 /*+IndexScan(p2 p2_c1_id_val_idx)*/
6775 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6776 LOG:  available indexes for IndexScan(p2):
6777 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6778 LOG:  available indexes for IndexScan(p2_c1_c1):
6779 LOG:  available indexes for IndexScan(p2_c1_c2):
6780 LOG:  pg_hint_plan:
6781 used hint:
6782 IndexScan(p2 p2_c1_id_val_idx)
6783 not used hint:
6784 duplication hint:
6785 error hint:
6786
6787                               QUERY PLAN                               
6788 -----------------------------------------------------------------------
6789  Append
6790    ->  Seq Scan on p2
6791          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6792    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6793          Index Cond: ((id >= 50) AND (id <= 51))
6794          Filter: (ctid = '(1,1)'::tid)
6795    ->  Seq Scan on p2_c1_c1
6796          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6797    ->  Seq Scan on p2_c1_c2
6798          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6799 (10 rows)
6800
6801 /*+IndexScan(p2 no_exist)*/
6802 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6803 LOG:  available indexes for IndexScan(p2):
6804 LOG:  available indexes for IndexScan(p2_c1):
6805 LOG:  available indexes for IndexScan(p2_c1_c1):
6806 LOG:  available indexes for IndexScan(p2_c1_c2):
6807 LOG:  pg_hint_plan:
6808 used hint:
6809 IndexScan(p2 no_exist)
6810 not used hint:
6811 duplication hint:
6812 error hint:
6813
6814                               QUERY PLAN                               
6815 -----------------------------------------------------------------------
6816  Append
6817    ->  Seq Scan on p2
6818          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6819    ->  Seq Scan on p2_c1
6820          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6821    ->  Seq Scan on p2_c1_c1
6822          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6823    ->  Seq Scan on p2_c1_c2
6824          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6825 (9 rows)
6826
6827 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
6828 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6829 LOG:  available indexes for IndexScan(p2): p2_pkey
6830 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6831 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6832 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6833 LOG:  pg_hint_plan:
6834 used hint:
6835 IndexScan(p2 p2_pkey p2_c1_id_val_idx)
6836 not used hint:
6837 duplication hint:
6838 error hint:
6839
6840                     QUERY PLAN                    
6841 --------------------------------------------------
6842  Append
6843    ->  Index Scan using p2_pkey on p2
6844          Index Cond: ((id >= 50) AND (id <= 51))
6845          Filter: (ctid = '(1,1)'::tid)
6846    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6847          Index Cond: ((id >= 50) AND (id <= 51))
6848          Filter: (ctid = '(1,1)'::tid)
6849    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6850          Index Cond: ((id >= 50) AND (id <= 51))
6851          Filter: (ctid = '(1,1)'::tid)
6852    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6853          Index Cond: ((id >= 50) AND (id <= 51))
6854          Filter: (ctid = '(1,1)'::tid)
6855 (13 rows)
6856
6857 /*+IndexScan(p2 p2_pkey no_exist)*/
6858 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6859 LOG:  available indexes for IndexScan(p2): p2_pkey
6860 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6861 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6862 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6863 LOG:  pg_hint_plan:
6864 used hint:
6865 IndexScan(p2 p2_pkey no_exist)
6866 not used hint:
6867 duplication hint:
6868 error hint:
6869
6870                     QUERY PLAN                    
6871 --------------------------------------------------
6872  Append
6873    ->  Index Scan using p2_pkey on p2
6874          Index Cond: ((id >= 50) AND (id <= 51))
6875          Filter: (ctid = '(1,1)'::tid)
6876    ->  Index Scan using p2_c1_pkey on p2_c1
6877          Index Cond: ((id >= 50) AND (id <= 51))
6878          Filter: (ctid = '(1,1)'::tid)
6879    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6880          Index Cond: ((id >= 50) AND (id <= 51))
6881          Filter: (ctid = '(1,1)'::tid)
6882    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6883          Index Cond: ((id >= 50) AND (id <= 51))
6884          Filter: (ctid = '(1,1)'::tid)
6885 (13 rows)
6886
6887 /*+IndexScan(p2 p2_c1_id_val_idx no_exist)*/
6888 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6889 LOG:  available indexes for IndexScan(p2):
6890 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6891 LOG:  available indexes for IndexScan(p2_c1_c1):
6892 LOG:  available indexes for IndexScan(p2_c1_c2):
6893 LOG:  pg_hint_plan:
6894 used hint:
6895 IndexScan(p2 p2_c1_id_val_idx no_exist)
6896 not used hint:
6897 duplication hint:
6898 error hint:
6899
6900                               QUERY PLAN                               
6901 -----------------------------------------------------------------------
6902  Append
6903    ->  Seq Scan on p2
6904          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6905    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6906          Index Cond: ((id >= 50) AND (id <= 51))
6907          Filter: (ctid = '(1,1)'::tid)
6908    ->  Seq Scan on p2_c1_c1
6909          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6910    ->  Seq Scan on p2_c1_c2
6911          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6912 (10 rows)
6913
6914 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
6915 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6916 LOG:  available indexes for IndexScan(p2): p2_pkey
6917 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6918 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6919 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6920 LOG:  pg_hint_plan:
6921 used hint:
6922 IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)
6923 not used hint:
6924 duplication hint:
6925 error hint:
6926
6927                     QUERY PLAN                    
6928 --------------------------------------------------
6929  Append
6930    ->  Index Scan using p2_pkey on p2
6931          Index Cond: ((id >= 50) AND (id <= 51))
6932          Filter: (ctid = '(1,1)'::tid)
6933    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6934          Index Cond: ((id >= 50) AND (id <= 51))
6935          Filter: (ctid = '(1,1)'::tid)
6936    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6937          Index Cond: ((id >= 50) AND (id <= 51))
6938          Filter: (ctid = '(1,1)'::tid)
6939    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6940          Index Cond: ((id >= 50) AND (id <= 51))
6941          Filter: (ctid = '(1,1)'::tid)
6942 (13 rows)
6943
6944 /*+IndexScan(p2 p2_val_idx)*/
6945 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6946 LOG:  available indexes for IndexScan(p2): p2_val_idx
6947 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx
6948 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx
6949 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx
6950 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx
6951 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx
6952 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx
6953 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx
6954 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx
6955 LOG:  pg_hint_plan:
6956 used hint:
6957 IndexScan(p2 p2_val_idx)
6958 not used hint:
6959 duplication hint:
6960 error hint:
6961
6962                             QUERY PLAN                             
6963 -------------------------------------------------------------------
6964  Append
6965    ->  Index Scan using p2_val_idx on p2
6966          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6967          Filter: (ctid = '(1,1)'::tid)
6968    ->  Index Scan using p2_c1_val_idx on p2_c1
6969          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6970          Filter: (ctid = '(1,1)'::tid)
6971    ->  Index Scan using p2_c2_val_idx on p2_c2
6972          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6973          Filter: (ctid = '(1,1)'::tid)
6974    ->  Index Scan using p2_c3_val_idx on p2_c3
6975          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6976          Filter: (ctid = '(1,1)'::tid)
6977    ->  Index Scan using p2_c4_val_idx on p2_c4
6978          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6979          Filter: (ctid = '(1,1)'::tid)
6980    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
6981          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6982          Filter: (ctid = '(1,1)'::tid)
6983    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
6984          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6985          Filter: (ctid = '(1,1)'::tid)
6986    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
6987          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6988          Filter: (ctid = '(1,1)'::tid)
6989    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
6990          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6991          Filter: (ctid = '(1,1)'::tid)
6992 (28 rows)
6993
6994 /*+IndexScan(p2 p2_expr)*/
6995 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6996 LOG:  available indexes for IndexScan(p2): p2_expr
6997 LOG:  available indexes for IndexScan(p2_c1): p2_c1_expr_idx
6998 LOG:  available indexes for IndexScan(p2_c2): p2_c2_expr_idx
6999 LOG:  available indexes for IndexScan(p2_c3): p2_c3_expr_idx
7000 LOG:  available indexes for IndexScan(p2_c4): p2_c4_expr_idx
7001 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_expr_idx
7002 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_expr_idx
7003 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_expr_idx
7004 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_expr_idx
7005 LOG:  pg_hint_plan:
7006 used hint:
7007 IndexScan(p2 p2_expr)
7008 not used hint:
7009 duplication hint:
7010 error hint:
7011
7012                                        QUERY PLAN                                        
7013 -----------------------------------------------------------------------------------------
7014  Append
7015    ->  Seq Scan on p2
7016          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7017    ->  Seq Scan on p2_c1
7018          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7019    ->  Seq Scan on p2_c2
7020          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7021    ->  Seq Scan on p2_c3
7022          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7023    ->  Seq Scan on p2_c4
7024          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7025    ->  Seq Scan on p2_c1_c1
7026          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7027    ->  Seq Scan on p2_c1_c2
7028          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7029    ->  Seq Scan on p2_c3_c1
7030          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7031    ->  Seq Scan on p2_c3_c2
7032          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7033 (19 rows)
7034
7035 /*+IndexScan(p2 p2_val_idx6)*/
7036 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7037 LOG:  available indexes for IndexScan(p2): p2_val_idx6
7038 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6
7039 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6
7040 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6
7041 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6
7042 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6
7043 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6
7044 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6
7045 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6
7046 LOG:  pg_hint_plan:
7047 used hint:
7048 IndexScan(p2 p2_val_idx6)
7049 not used hint:
7050 duplication hint:
7051 error hint:
7052
7053                                        QUERY PLAN                                        
7054 -----------------------------------------------------------------------------------------
7055  Append
7056    ->  Seq Scan on p2
7057          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7058    ->  Seq Scan on p2_c1
7059          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7060    ->  Seq Scan on p2_c2
7061          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7062    ->  Seq Scan on p2_c3
7063          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7064    ->  Seq Scan on p2_c4
7065          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7066    ->  Seq Scan on p2_c1_c1
7067          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7068    ->  Seq Scan on p2_c1_c2
7069          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7070    ->  Seq Scan on p2_c3_c1
7071          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7072    ->  Seq Scan on p2_c3_c2
7073          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7074 (19 rows)
7075
7076 /*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
7077 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7078 LOG:  available indexes for IndexScan(p2): p2_val_idx6 p2_val_idx
7079 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6 p2_c1_val_idx
7080 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6 p2_c2_val_idx
7081 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6 p2_c3_val_idx
7082 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6 p2_c4_val_idx
7083 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6 p2_c1_c1_val_idx
7084 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6 p2_c1_c2_val_idx
7085 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6 p2_c3_c1_val_idx
7086 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6 p2_c3_c2_val_idx
7087 LOG:  pg_hint_plan:
7088 used hint:
7089 IndexScan(p2 p2_val_idx p2_val_idx6)
7090 not used hint:
7091 duplication hint:
7092 error hint:
7093
7094                             QUERY PLAN                             
7095 -------------------------------------------------------------------
7096  Append
7097    ->  Index Scan using p2_val_idx on p2
7098          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7099          Filter: (ctid = '(1,1)'::tid)
7100    ->  Index Scan using p2_c1_val_idx on p2_c1
7101          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7102          Filter: (ctid = '(1,1)'::tid)
7103    ->  Index Scan using p2_c2_val_idx on p2_c2
7104          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7105          Filter: (ctid = '(1,1)'::tid)
7106    ->  Index Scan using p2_c3_val_idx on p2_c3
7107          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7108          Filter: (ctid = '(1,1)'::tid)
7109    ->  Index Scan using p2_c4_val_idx on p2_c4
7110          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7111          Filter: (ctid = '(1,1)'::tid)
7112    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
7113          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7114          Filter: (ctid = '(1,1)'::tid)
7115    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
7116          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7117          Filter: (ctid = '(1,1)'::tid)
7118    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
7119          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7120          Filter: (ctid = '(1,1)'::tid)
7121    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
7122          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7123          Filter: (ctid = '(1,1)'::tid)
7124 (28 rows)
7125
7126 -- regular expression
7127 -- ordinary table
7128 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7129                                          QUERY PLAN                                          
7130 ---------------------------------------------------------------------------------------------
7131  Index Only Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
7132    Index Cond: (id = 1)
7133 (2 rows)
7134
7135 /*+ IndexScanRegexp(t5 t5_[^i].*)*/
7136 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7137 LOG:  available indexes for IndexScanRegexp(t5): t5_val t5_pkey
7138 LOG:  pg_hint_plan:
7139 used hint:
7140 IndexScanRegexp(t5 t5_[^i].*)
7141 not used hint:
7142 duplication hint:
7143 error hint:
7144
7145            QUERY PLAN           
7146 --------------------------------
7147  Index Scan using t5_pkey on t5
7148    Index Cond: (id = 1)
7149 (2 rows)
7150
7151 /*+ IndexScanRegexp(t5 t5_id[0-9].*)*/
7152 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7153 LOG:  available indexes for IndexScanRegexp(t5): t5_id3 t5_id2 t5_id1
7154 LOG:  pg_hint_plan:
7155 used hint:
7156 IndexScanRegexp(t5 t5_id[0-9].*)
7157 not used hint:
7158 duplication hint:
7159 error hint:
7160
7161           QUERY PLAN           
7162 -------------------------------
7163  Index Scan using t5_id3 on t5
7164    Index Cond: (id = 1)
7165 (2 rows)
7166
7167 /*+ IndexScanRegexp(t5 t5[^_].*)*/
7168 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7169 LOG:  available indexes for IndexScanRegexp(t5):
7170 LOG:  pg_hint_plan:
7171 used hint:
7172 IndexScanRegexp(t5 t5[^_].*)
7173 not used hint:
7174 duplication hint:
7175 error hint:
7176
7177      QUERY PLAN     
7178 --------------------
7179  Seq Scan on t5
7180    Filter: (id = 1)
7181 (2 rows)
7182
7183 /*+ IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7184 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7185 LOG:  available indexes for IndexScanRegexp(t5):
7186 LOG:  pg_hint_plan:
7187 used hint:
7188 IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7189 not used hint:
7190 duplication hint:
7191 error hint:
7192
7193      QUERY PLAN     
7194 --------------------
7195  Seq Scan on t5
7196    Filter: (id = 1)
7197 (2 rows)
7198
7199 /*+ IndexScan(t5 t5_id[0-9].*)*/
7200 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7201 LOG:  available indexes for IndexScan(t5):
7202 LOG:  pg_hint_plan:
7203 used hint:
7204 IndexScan(t5 t5_id[0-9].*)
7205 not used hint:
7206 duplication hint:
7207 error hint:
7208
7209      QUERY PLAN     
7210 --------------------
7211  Seq Scan on t5
7212    Filter: (id = 1)
7213 (2 rows)
7214
7215 /*+ IndexOnlyScanRegexp(t5 t5_[^i].*)*/
7216 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7217 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_val t5_pkey
7218 LOG:  pg_hint_plan:
7219 used hint:
7220 IndexOnlyScanRegexp(t5 t5_[^i].*)
7221 not used hint:
7222 duplication hint:
7223 error hint:
7224
7225              QUERY PLAN              
7226 -------------------------------------
7227  Index Only Scan using t5_pkey on t5
7228    Index Cond: (id = 1)
7229 (2 rows)
7230
7231 /*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
7232 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7233 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_id3 t5_id2 t5_id1
7234 LOG:  pg_hint_plan:
7235 used hint:
7236 IndexOnlyScanRegexp(t5 t5_id[0-9].*)
7237 not used hint:
7238 duplication hint:
7239 error hint:
7240
7241              QUERY PLAN             
7242 ------------------------------------
7243  Index Only Scan using t5_id3 on t5
7244    Index Cond: (id = 1)
7245 (2 rows)
7246
7247 /*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
7248 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7249 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7250 LOG:  pg_hint_plan:
7251 used hint:
7252 IndexOnlyScanRegexp(t5 t5[^_].*)
7253 not used hint:
7254 duplication hint:
7255 error hint:
7256
7257      QUERY PLAN     
7258 --------------------
7259  Seq Scan on t5
7260    Filter: (id = 1)
7261 (2 rows)
7262
7263 /*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7264 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7265 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7266 LOG:  pg_hint_plan:
7267 used hint:
7268 IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7269 not used hint:
7270 duplication hint:
7271 error hint:
7272
7273      QUERY PLAN     
7274 --------------------
7275  Seq Scan on t5
7276    Filter: (id = 1)
7277 (2 rows)
7278
7279 /*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
7280 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7281 LOG:  available indexes for IndexOnlyScan(t5):
7282 LOG:  pg_hint_plan:
7283 used hint:
7284 IndexOnlyScan(t5 t5_id[0-9].*)
7285 not used hint:
7286 duplication hint:
7287 error hint:
7288
7289      QUERY PLAN     
7290 --------------------
7291  Seq Scan on t5
7292    Filter: (id = 1)
7293 (2 rows)
7294
7295 /*+ BitmapScanRegexp(t5 t5_[^i].*)*/
7296 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7297 LOG:  available indexes for BitmapScanRegexp(t5): t5_val t5_pkey
7298 LOG:  pg_hint_plan:
7299 used hint:
7300 BitmapScanRegexp(t5 t5_[^i].*)
7301 not used hint:
7302 duplication hint:
7303 error hint:
7304
7305              QUERY PLAN             
7306 ------------------------------------
7307  Bitmap Heap Scan on t5
7308    Recheck Cond: (id = 1)
7309    ->  Bitmap Index Scan on t5_pkey
7310          Index Cond: (id = 1)
7311 (4 rows)
7312
7313 /*+ BitmapScanRegexp(t5 t5_id[0-9].*)*/
7314 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7315 LOG:  available indexes for BitmapScanRegexp(t5): t5_id3 t5_id2 t5_id1
7316 LOG:  pg_hint_plan:
7317 used hint:
7318 BitmapScanRegexp(t5 t5_id[0-9].*)
7319 not used hint:
7320 duplication hint:
7321 error hint:
7322
7323             QUERY PLAN             
7324 -----------------------------------
7325  Bitmap Heap Scan on t5
7326    Recheck Cond: (id = 1)
7327    ->  Bitmap Index Scan on t5_id3
7328          Index Cond: (id = 1)
7329 (4 rows)
7330
7331 /*+ BitmapScanRegexp(t5 t5[^_].*)*/
7332 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7333 LOG:  available indexes for BitmapScanRegexp(t5):
7334 LOG:  pg_hint_plan:
7335 used hint:
7336 BitmapScanRegexp(t5 t5[^_].*)
7337 not used hint:
7338 duplication hint:
7339 error hint:
7340
7341      QUERY PLAN     
7342 --------------------
7343  Seq Scan on t5
7344    Filter: (id = 1)
7345 (2 rows)
7346
7347 /*+ BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7348 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7349 LOG:  available indexes for BitmapScanRegexp(t5):
7350 LOG:  pg_hint_plan:
7351 used hint:
7352 BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7353 not used hint:
7354 duplication hint:
7355 error hint:
7356
7357      QUERY PLAN     
7358 --------------------
7359  Seq Scan on t5
7360    Filter: (id = 1)
7361 (2 rows)
7362
7363 /*+ BitmapScan(t5 t5_id[0-9].*)*/
7364 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7365 LOG:  available indexes for BitmapScan(t5):
7366 LOG:  pg_hint_plan:
7367 used hint:
7368 BitmapScan(t5 t5_id[0-9].*)
7369 not used hint:
7370 duplication hint:
7371 error hint:
7372
7373      QUERY PLAN     
7374 --------------------
7375  Seq Scan on t5
7376    Filter: (id = 1)
7377 (2 rows)
7378
7379 -- Inheritance
7380 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7381          QUERY PLAN         
7382 ----------------------------
7383  Append
7384    ->  Seq Scan on p1
7385          Filter: (val = 1)
7386    ->  Seq Scan on p1_c1
7387          Filter: (val = 1)
7388    ->  Seq Scan on p1_c2
7389          Filter: (val = 1)
7390    ->  Seq Scan on p1_c3
7391          Filter: (val = 1)
7392    ->  Seq Scan on p1_c4
7393          Filter: (val = 1)
7394    ->  Seq Scan on p1_c1_c1
7395          Filter: (val = 1)
7396    ->  Seq Scan on p1_c1_c2
7397          Filter: (val = 1)
7398    ->  Seq Scan on p1_c3_c1
7399          Filter: (val = 1)
7400    ->  Seq Scan on p1_c3_c2
7401          Filter: (val = 1)
7402 (19 rows)
7403
7404 /*+ IndexScanRegexp(p1 p1_.*[^0-9]$)*/
7405 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7406 LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
7407 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_pkey
7408 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_pkey
7409 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_pkey
7410 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_pkey
7411 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7412 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7413 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7414 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7415 LOG:  pg_hint_plan:
7416 used hint:
7417 IndexScanRegexp(p1 p1_.*[^0-9]$)
7418 not used hint:
7419 duplication hint:
7420 error hint:
7421
7422          QUERY PLAN         
7423 ----------------------------
7424  Append
7425    ->  Seq Scan on p1
7426          Filter: (val = 1)
7427    ->  Seq Scan on p1_c1
7428          Filter: (val = 1)
7429    ->  Seq Scan on p1_c2
7430          Filter: (val = 1)
7431    ->  Seq Scan on p1_c3
7432          Filter: (val = 1)
7433    ->  Seq Scan on p1_c4
7434          Filter: (val = 1)
7435    ->  Seq Scan on p1_c1_c1
7436          Filter: (val = 1)
7437    ->  Seq Scan on p1_c1_c2
7438          Filter: (val = 1)
7439    ->  Seq Scan on p1_c3_c1
7440          Filter: (val = 1)
7441    ->  Seq Scan on p1_c3_c2
7442          Filter: (val = 1)
7443 (19 rows)
7444
7445 /*+ IndexScanRegexp(p1 p1_.*val2.*)*/
7446 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7447 LOG:  available indexes for IndexScanRegexp(p1): p1_val2
7448 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_val2
7449 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_val2
7450 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_val2
7451 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_val2
7452 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_val2
7453 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_val2
7454 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_val2
7455 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_val2
7456 LOG:  pg_hint_plan:
7457 used hint:
7458 IndexScanRegexp(p1 p1_.*val2.*)
7459 not used hint:
7460 duplication hint:
7461 error hint:
7462
7463                     QUERY PLAN                    
7464 --------------------------------------------------
7465  Append
7466    ->  Index Scan using p1_val2 on p1
7467          Index Cond: (val = 1)
7468    ->  Index Scan using p1_c1_val2 on p1_c1
7469          Index Cond: (val = 1)
7470    ->  Index Scan using p1_c2_val2 on p1_c2
7471          Index Cond: (val = 1)
7472    ->  Index Scan using p1_c3_val2 on p1_c3
7473          Index Cond: (val = 1)
7474    ->  Index Scan using p1_c4_val2 on p1_c4
7475          Index Cond: (val = 1)
7476    ->  Index Scan using p1_c1_c1_val2 on p1_c1_c1
7477          Index Cond: (val = 1)
7478    ->  Index Scan using p1_c1_c2_val2 on p1_c1_c2
7479          Index Cond: (val = 1)
7480    ->  Index Scan using p1_c3_c1_val2 on p1_c3_c1
7481          Index Cond: (val = 1)
7482    ->  Index Scan using p1_c3_c2_val2 on p1_c3_c2
7483          Index Cond: (val = 1)
7484 (19 rows)
7485
7486 /*+ IndexScanRegexp(p1 p1[^_].*)*/
7487 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7488 LOG:  available indexes for IndexScanRegexp(p1):
7489 LOG:  available indexes for IndexScanRegexp(p1_c1):
7490 LOG:  available indexes for IndexScanRegexp(p1_c2):
7491 LOG:  available indexes for IndexScanRegexp(p1_c3):
7492 LOG:  available indexes for IndexScanRegexp(p1_c4):
7493 LOG:  available indexes for IndexScanRegexp(p1_c1_c1):
7494 LOG:  available indexes for IndexScanRegexp(p1_c1_c2):
7495 LOG:  available indexes for IndexScanRegexp(p1_c3_c1):
7496 LOG:  available indexes for IndexScanRegexp(p1_c3_c2):
7497 LOG:  pg_hint_plan:
7498 used hint:
7499 IndexScanRegexp(p1 p1[^_].*)
7500 not used hint:
7501 duplication hint:
7502 error hint:
7503
7504          QUERY PLAN         
7505 ----------------------------
7506  Append
7507    ->  Seq Scan on p1
7508          Filter: (val = 1)
7509    ->  Seq Scan on p1_c1
7510          Filter: (val = 1)
7511    ->  Seq Scan on p1_c2
7512          Filter: (val = 1)
7513    ->  Seq Scan on p1_c3
7514          Filter: (val = 1)
7515    ->  Seq Scan on p1_c4
7516          Filter: (val = 1)
7517    ->  Seq Scan on p1_c1_c1
7518          Filter: (val = 1)
7519    ->  Seq Scan on p1_c1_c2
7520          Filter: (val = 1)
7521    ->  Seq Scan on p1_c3_c1
7522          Filter: (val = 1)
7523    ->  Seq Scan on p1_c3_c2
7524          Filter: (val = 1)
7525 (19 rows)
7526
7527 /*+ IndexScan(p1 p1_.*val2.*)*/
7528 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7529 LOG:  available indexes for IndexScan(p1):
7530 LOG:  available indexes for IndexScan(p1_c1):
7531 LOG:  available indexes for IndexScan(p1_c2):
7532 LOG:  available indexes for IndexScan(p1_c3):
7533 LOG:  available indexes for IndexScan(p1_c4):
7534 LOG:  available indexes for IndexScan(p1_c1_c1):
7535 LOG:  available indexes for IndexScan(p1_c1_c2):
7536 LOG:  available indexes for IndexScan(p1_c3_c1):
7537 LOG:  available indexes for IndexScan(p1_c3_c2):
7538 LOG:  pg_hint_plan:
7539 used hint:
7540 IndexScan(p1 p1_.*val2.*)
7541 not used hint:
7542 duplication hint:
7543 error hint:
7544
7545          QUERY PLAN         
7546 ----------------------------
7547  Append
7548    ->  Seq Scan on p1
7549          Filter: (val = 1)
7550    ->  Seq Scan on p1_c1
7551          Filter: (val = 1)
7552    ->  Seq Scan on p1_c2
7553          Filter: (val = 1)
7554    ->  Seq Scan on p1_c3
7555          Filter: (val = 1)
7556    ->  Seq Scan on p1_c4
7557          Filter: (val = 1)
7558    ->  Seq Scan on p1_c1_c1
7559          Filter: (val = 1)
7560    ->  Seq Scan on p1_c1_c2
7561          Filter: (val = 1)
7562    ->  Seq Scan on p1_c3_c1
7563          Filter: (val = 1)
7564    ->  Seq Scan on p1_c3_c2
7565          Filter: (val = 1)
7566 (19 rows)
7567
7568 /*+ IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)*/
7569 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7570 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_pkey
7571 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_pkey
7572 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_pkey
7573 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_pkey
7574 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_pkey
7575 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7576 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7577 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7578 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7579 LOG:  pg_hint_plan:
7580 used hint:
7581 IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)
7582 not used hint:
7583 duplication hint:
7584 error hint:
7585
7586          QUERY PLAN         
7587 ----------------------------
7588  Append
7589    ->  Seq Scan on p1
7590          Filter: (val = 1)
7591    ->  Seq Scan on p1_c1
7592          Filter: (val = 1)
7593    ->  Seq Scan on p1_c2
7594          Filter: (val = 1)
7595    ->  Seq Scan on p1_c3
7596          Filter: (val = 1)
7597    ->  Seq Scan on p1_c4
7598          Filter: (val = 1)
7599    ->  Seq Scan on p1_c1_c1
7600          Filter: (val = 1)
7601    ->  Seq Scan on p1_c1_c2
7602          Filter: (val = 1)
7603    ->  Seq Scan on p1_c3_c1
7604          Filter: (val = 1)
7605    ->  Seq Scan on p1_c3_c2
7606          Filter: (val = 1)
7607 (19 rows)
7608
7609 /*+ IndexOnlyScanRegexp(p1 p1_.*val2.*)*/
7610 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7611 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_val2
7612 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_val2
7613 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_val2
7614 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_val2
7615 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_val2
7616 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_val2
7617 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_val2
7618 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_val2
7619 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_val2
7620 LOG:  pg_hint_plan:
7621 used hint:
7622 IndexOnlyScanRegexp(p1 p1_.*val2.*)
7623 not used hint:
7624 duplication hint:
7625 error hint:
7626
7627                       QUERY PLAN                       
7628 -------------------------------------------------------
7629  Append
7630    ->  Index Only Scan using p1_val2 on p1
7631          Index Cond: (val = 1)
7632    ->  Index Only Scan using p1_c1_val2 on p1_c1
7633          Index Cond: (val = 1)
7634    ->  Index Only Scan using p1_c2_val2 on p1_c2
7635          Index Cond: (val = 1)
7636    ->  Index Only Scan using p1_c3_val2 on p1_c3
7637          Index Cond: (val = 1)
7638    ->  Index Only Scan using p1_c4_val2 on p1_c4
7639          Index Cond: (val = 1)
7640    ->  Index Only Scan using p1_c1_c1_val2 on p1_c1_c1
7641          Index Cond: (val = 1)
7642    ->  Index Only Scan using p1_c1_c2_val2 on p1_c1_c2
7643          Index Cond: (val = 1)
7644    ->  Index Only Scan using p1_c3_c1_val2 on p1_c3_c1
7645          Index Cond: (val = 1)
7646    ->  Index Only Scan using p1_c3_c2_val2 on p1_c3_c2
7647          Index Cond: (val = 1)
7648 (19 rows)
7649
7650 /*+ IndexOnlyScanRegexp(p1 p1[^_].*)*/
7651 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7652 LOG:  available indexes for IndexOnlyScanRegexp(p1):
7653 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1):
7654 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2):
7655 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3):
7656 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4):
7657 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1):
7658 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2):
7659 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1):
7660 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2):
7661 LOG:  pg_hint_plan:
7662 used hint:
7663 IndexOnlyScanRegexp(p1 p1[^_].*)
7664 not used hint:
7665 duplication hint:
7666 error hint:
7667
7668          QUERY PLAN         
7669 ----------------------------
7670  Append
7671    ->  Seq Scan on p1
7672          Filter: (val = 1)
7673    ->  Seq Scan on p1_c1
7674          Filter: (val = 1)
7675    ->  Seq Scan on p1_c2
7676          Filter: (val = 1)
7677    ->  Seq Scan on p1_c3
7678          Filter: (val = 1)
7679    ->  Seq Scan on p1_c4
7680          Filter: (val = 1)
7681    ->  Seq Scan on p1_c1_c1
7682          Filter: (val = 1)
7683    ->  Seq Scan on p1_c1_c2
7684          Filter: (val = 1)
7685    ->  Seq Scan on p1_c3_c1
7686          Filter: (val = 1)
7687    ->  Seq Scan on p1_c3_c2
7688          Filter: (val = 1)
7689 (19 rows)
7690
7691 /*+ IndexOnlyScan(p1 p1_.*val2.*)*/
7692 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7693 LOG:  available indexes for IndexOnlyScan(p1):
7694 LOG:  available indexes for IndexOnlyScan(p1_c1):
7695 LOG:  available indexes for IndexOnlyScan(p1_c2):
7696 LOG:  available indexes for IndexOnlyScan(p1_c3):
7697 LOG:  available indexes for IndexOnlyScan(p1_c4):
7698 LOG:  available indexes for IndexOnlyScan(p1_c1_c1):
7699 LOG:  available indexes for IndexOnlyScan(p1_c1_c2):
7700 LOG:  available indexes for IndexOnlyScan(p1_c3_c1):
7701 LOG:  available indexes for IndexOnlyScan(p1_c3_c2):
7702 LOG:  pg_hint_plan:
7703 used hint:
7704 IndexOnlyScan(p1 p1_.*val2.*)
7705 not used hint:
7706 duplication hint:
7707 error hint:
7708
7709          QUERY PLAN         
7710 ----------------------------
7711  Append
7712    ->  Seq Scan on p1
7713          Filter: (val = 1)
7714    ->  Seq Scan on p1_c1
7715          Filter: (val = 1)
7716    ->  Seq Scan on p1_c2
7717          Filter: (val = 1)
7718    ->  Seq Scan on p1_c3
7719          Filter: (val = 1)
7720    ->  Seq Scan on p1_c4
7721          Filter: (val = 1)
7722    ->  Seq Scan on p1_c1_c1
7723          Filter: (val = 1)
7724    ->  Seq Scan on p1_c1_c2
7725          Filter: (val = 1)
7726    ->  Seq Scan on p1_c3_c1
7727          Filter: (val = 1)
7728    ->  Seq Scan on p1_c3_c2
7729          Filter: (val = 1)
7730 (19 rows)
7731
7732 /*+ BitmapScanRegexp(p1 p1_.*[^0-9]$)*/
7733 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7734 LOG:  available indexes for BitmapScanRegexp(p1): p1_pkey
7735 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_pkey
7736 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_pkey
7737 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_pkey
7738 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_pkey
7739 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7740 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7741 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7742 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7743 LOG:  pg_hint_plan:
7744 used hint:
7745 BitmapScanRegexp(p1 p1_.*[^0-9]$)
7746 not used hint:
7747 duplication hint:
7748 error hint:
7749
7750          QUERY PLAN         
7751 ----------------------------
7752  Append
7753    ->  Seq Scan on p1
7754          Filter: (val = 1)
7755    ->  Seq Scan on p1_c1
7756          Filter: (val = 1)
7757    ->  Seq Scan on p1_c2
7758          Filter: (val = 1)
7759    ->  Seq Scan on p1_c3
7760          Filter: (val = 1)
7761    ->  Seq Scan on p1_c4
7762          Filter: (val = 1)
7763    ->  Seq Scan on p1_c1_c1
7764          Filter: (val = 1)
7765    ->  Seq Scan on p1_c1_c2
7766          Filter: (val = 1)
7767    ->  Seq Scan on p1_c3_c1
7768          Filter: (val = 1)
7769    ->  Seq Scan on p1_c3_c2
7770          Filter: (val = 1)
7771 (19 rows)
7772
7773 /*+ BitmapScanRegexp(p1 p1_.*val2.*)*/
7774 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7775 LOG:  available indexes for BitmapScanRegexp(p1): p1_val2
7776 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_val2
7777 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_val2
7778 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_val2
7779 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_val2
7780 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_val2
7781 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_val2
7782 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_val2
7783 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_val2
7784 LOG:  pg_hint_plan:
7785 used hint:
7786 BitmapScanRegexp(p1 p1_.*val2.*)
7787 not used hint:
7788 duplication hint:
7789 error hint:
7790
7791                    QUERY PLAN                   
7792 ------------------------------------------------
7793  Append
7794    ->  Bitmap Heap Scan on p1
7795          Recheck Cond: (val = 1)
7796          ->  Bitmap Index Scan on p1_val2
7797                Index Cond: (val = 1)
7798    ->  Bitmap Heap Scan on p1_c1
7799          Recheck Cond: (val = 1)
7800          ->  Bitmap Index Scan on p1_c1_val2
7801                Index Cond: (val = 1)
7802    ->  Bitmap Heap Scan on p1_c2
7803          Recheck Cond: (val = 1)
7804          ->  Bitmap Index Scan on p1_c2_val2
7805                Index Cond: (val = 1)
7806    ->  Bitmap Heap Scan on p1_c3
7807          Recheck Cond: (val = 1)
7808          ->  Bitmap Index Scan on p1_c3_val2
7809                Index Cond: (val = 1)
7810    ->  Bitmap Heap Scan on p1_c4
7811          Recheck Cond: (val = 1)
7812          ->  Bitmap Index Scan on p1_c4_val2
7813                Index Cond: (val = 1)
7814    ->  Bitmap Heap Scan on p1_c1_c1
7815          Recheck Cond: (val = 1)
7816          ->  Bitmap Index Scan on p1_c1_c1_val2
7817                Index Cond: (val = 1)
7818    ->  Bitmap Heap Scan on p1_c1_c2
7819          Recheck Cond: (val = 1)
7820          ->  Bitmap Index Scan on p1_c1_c2_val2
7821                Index Cond: (val = 1)
7822    ->  Bitmap Heap Scan on p1_c3_c1
7823          Recheck Cond: (val = 1)
7824          ->  Bitmap Index Scan on p1_c3_c1_val2
7825                Index Cond: (val = 1)
7826    ->  Bitmap Heap Scan on p1_c3_c2
7827          Recheck Cond: (val = 1)
7828          ->  Bitmap Index Scan on p1_c3_c2_val2
7829                Index Cond: (val = 1)
7830 (37 rows)
7831
7832 /*+ BitmapScanRegexp(p1 p1[^_].*)*/
7833 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7834 LOG:  available indexes for BitmapScanRegexp(p1):
7835 LOG:  available indexes for BitmapScanRegexp(p1_c1):
7836 LOG:  available indexes for BitmapScanRegexp(p1_c2):
7837 LOG:  available indexes for BitmapScanRegexp(p1_c3):
7838 LOG:  available indexes for BitmapScanRegexp(p1_c4):
7839 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1):
7840 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2):
7841 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1):
7842 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2):
7843 LOG:  pg_hint_plan:
7844 used hint:
7845 BitmapScanRegexp(p1 p1[^_].*)
7846 not used hint:
7847 duplication hint:
7848 error hint:
7849
7850          QUERY PLAN         
7851 ----------------------------
7852  Append
7853    ->  Seq Scan on p1
7854          Filter: (val = 1)
7855    ->  Seq Scan on p1_c1
7856          Filter: (val = 1)
7857    ->  Seq Scan on p1_c2
7858          Filter: (val = 1)
7859    ->  Seq Scan on p1_c3
7860          Filter: (val = 1)
7861    ->  Seq Scan on p1_c4
7862          Filter: (val = 1)
7863    ->  Seq Scan on p1_c1_c1
7864          Filter: (val = 1)
7865    ->  Seq Scan on p1_c1_c2
7866          Filter: (val = 1)
7867    ->  Seq Scan on p1_c3_c1
7868          Filter: (val = 1)
7869    ->  Seq Scan on p1_c3_c2
7870          Filter: (val = 1)
7871 (19 rows)
7872
7873 /*+ BitmapScan(p1 p1_.*val2.*)*/
7874 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7875 LOG:  available indexes for BitmapScan(p1):
7876 LOG:  available indexes for BitmapScan(p1_c1):
7877 LOG:  available indexes for BitmapScan(p1_c2):
7878 LOG:  available indexes for BitmapScan(p1_c3):
7879 LOG:  available indexes for BitmapScan(p1_c4):
7880 LOG:  available indexes for BitmapScan(p1_c1_c1):
7881 LOG:  available indexes for BitmapScan(p1_c1_c2):
7882 LOG:  available indexes for BitmapScan(p1_c3_c1):
7883 LOG:  available indexes for BitmapScan(p1_c3_c2):
7884 LOG:  pg_hint_plan:
7885 used hint:
7886 BitmapScan(p1 p1_.*val2.*)
7887 not used hint:
7888 duplication hint:
7889 error hint:
7890
7891          QUERY PLAN         
7892 ----------------------------
7893  Append
7894    ->  Seq Scan on p1
7895          Filter: (val = 1)
7896    ->  Seq Scan on p1_c1
7897          Filter: (val = 1)
7898    ->  Seq Scan on p1_c2
7899          Filter: (val = 1)
7900    ->  Seq Scan on p1_c3
7901          Filter: (val = 1)
7902    ->  Seq Scan on p1_c4
7903          Filter: (val = 1)
7904    ->  Seq Scan on p1_c1_c1
7905          Filter: (val = 1)
7906    ->  Seq Scan on p1_c1_c2
7907          Filter: (val = 1)
7908    ->  Seq Scan on p1_c3_c1
7909          Filter: (val = 1)
7910    ->  Seq Scan on p1_c3_c2
7911          Filter: (val = 1)
7912 (19 rows)
7913
7914 -- search from hint table
7915 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7916 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
7917 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
7918 SELECT * FROM hint_plan.hints ORDER BY id;
7919  id |                    norm_query_string                     | application_name |     hints      
7920 ----+----------------------------------------------------------+------------------+----------------
7921   1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;  |                  | SeqScan(t1)
7922   2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; |                  | IndexScan(t1)
7923   3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;                |                  | BitmapScan(t1)
7924 (3 rows)
7925
7926 SET pg_hint_plan.enable_hint_table = on;
7927 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7928 LOG:  pg_hint_plan:
7929 used hint:
7930 SeqScan(t1)
7931 not used hint:
7932 duplication hint:
7933 error hint:
7934
7935      QUERY PLAN     
7936 --------------------
7937  Seq Scan on t1
7938    Filter: (id = 1)
7939 (2 rows)
7940
7941 SET pg_hint_plan.enable_hint_table = off;
7942 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7943            QUERY PLAN           
7944 --------------------------------
7945  Index Scan using t1_pkey on t1
7946    Index Cond: (id = 1)
7947 (2 rows)
7948
7949 TRUNCATE hint_plan.hints;
7950 VACUUM ANALYZE hint_plan.hints;
7951 -- plpgsql test
7952 EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = 1;
7953              QUERY PLAN              
7954 -------------------------------------
7955  Index Only Scan using t1_pkey on t1
7956    Index Cond: (id = 1)
7957 (2 rows)
7958
7959 -- static function
7960 CREATE FUNCTION testfunc() RETURNS RECORD AS $$
7961 DECLARE
7962   ret record;
7963 BEGIN
7964   SELECT /*+ SeqScan(t1) */ * INTO ret FROM t1 LIMIT 1;
7965   RETURN ret;
7966 END;
7967 $$ LANGUAGE plpgsql;
7968 SELECT testfunc();
7969 LOG:  pg_hint_plan:
7970 used hint:
7971 SeqScan(t1)
7972 not used hint:
7973 duplication hint:
7974 error hint:
7975
7976 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ *          FROM t1 LIMIT 1"
7977 PL/pgSQL function testfunc() line 5 at SQL statement
7978  testfunc 
7979 ----------
7980  (1,1)
7981 (1 row)
7982
7983 -- dynamic function
7984 DROP FUNCTION testfunc();
7985 CREATE FUNCTION testfunc() RETURNS void AS $$
7986 BEGIN
7987   EXECUTE format('/*+ SeqScan(t1) */ SELECT * FROM t1');
7988 END;
7989 $$ LANGUAGE plpgsql;
7990 SELECT testfunc();
7991 LOG:  pg_hint_plan:
7992 used hint:
7993 SeqScan(t1)
7994 not used hint:
7995 duplication hint:
7996 error hint:
7997
7998 CONTEXT:  SQL statement "/*+ SeqScan(t1) */ SELECT * FROM t1"
7999 PL/pgSQL function testfunc() line 3 at EXECUTE
8000  testfunc 
8001 ----------
8002  
8003 (1 row)
8004
8005 -- This should not use SeqScan(t1)
8006 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
8007 LOG:  pg_hint_plan:
8008 used hint:
8009 IndexScan(t1)
8010 not used hint:
8011 duplication hint:
8012 error hint:
8013
8014  id | val 
8015 ----+-----
8016   1 |   1
8017 (1 row)
8018
8019 -- Perform
8020 DROP FUNCTION testfunc();
8021 CREATE FUNCTION testfunc() RETURNS void AS $$
8022 BEGIN
8023   PERFORM  1, /*+ SeqScan(t1) */ * from t1;
8024 END;
8025 $$ LANGUAGE plpgsql;
8026 SELECT testfunc();
8027 LOG:  pg_hint_plan:
8028 used hint:
8029 SeqScan(t1)
8030 not used hint:
8031 duplication hint:
8032 error hint:
8033
8034 CONTEXT:  SQL statement "SELECT 1, /*+ SeqScan(t1) */ * from t1"
8035 PL/pgSQL function testfunc() line 3 at PERFORM
8036  testfunc 
8037 ----------
8038  
8039 (1 row)
8040
8041 -- FOR loop
8042 DROP FUNCTION testfunc();
8043 CREATE FUNCTION testfunc() RETURNS int AS $$
8044 DECLARE
8045   sum int;
8046   v int;
8047 BEGIN
8048   sum := 0;
8049   FOR v IN SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id LOOP
8050     sum := sum + v;
8051   END LOOP;
8052   RETURN v;
8053 END;
8054 $$ LANGUAGE plpgsql;
8055 SELECT testfunc();
8056 LOG:  pg_hint_plan:
8057 used hint:
8058 SeqScan(t1)
8059 not used hint:
8060 duplication hint:
8061 error hint:
8062
8063 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id"
8064 PL/pgSQL function testfunc() line 7 at FOR over SELECT rows
8065  testfunc 
8066 ----------
8067          
8068 (1 row)
8069
8070 -- Dynamic FOR loop
8071 DROP FUNCTION testfunc();
8072 CREATE FUNCTION testfunc() RETURNS int AS $$
8073 DECLARE
8074   sum int;
8075   v int;
8076   i   int;
8077 BEGIN
8078   sum := 0;
8079   FOR v IN EXECUTE 'SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id' LOOP
8080     sum := sum + v;
8081   END LOOP;
8082   RETURN v;
8083 END;
8084 $$ LANGUAGE plpgsql;
8085 SELECT testfunc();
8086 LOG:  pg_hint_plan:
8087 used hint:
8088 SeqScan(t1)
8089 not used hint:
8090 duplication hint:
8091 error hint:
8092
8093 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id"
8094 PL/pgSQL function testfunc() line 8 at FOR over EXECUTE statement
8095  testfunc 
8096 ----------
8097         0
8098 (1 row)
8099
8100 -- Cursor FOR loop
8101 DROP FUNCTION testfunc();
8102 CREATE FUNCTION testfunc() RETURNS int AS $$
8103 DECLARE
8104   ref CURSOR FOR SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8105   rec record;
8106   sum int := 0;
8107 BEGIN
8108   FOR rec IN ref LOOP
8109     sum := sum + rec.val;
8110   END LOOP;
8111   RETURN sum;
8112 END;
8113 $$ LANGUAGE plpgsql;
8114 SELECT testfunc();
8115 LOG:  pg_hint_plan:
8116 used hint:
8117 SeqScan(t1)
8118 not used hint:
8119 duplication hint:
8120 error hint:
8121
8122 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8123 PL/pgSQL function testfunc() line 7 at FOR over cursor
8124  testfunc 
8125 ----------
8126    495000
8127 (1 row)
8128
8129 -- RETURN QUERY
8130 DROP FUNCTION testfunc();
8131 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8132 BEGIN
8133   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8134 END;
8135 $$ LANGUAGE plpgsql;
8136 SELECT * FROM testfunc() LIMIT 1;
8137 LOG:  pg_hint_plan:
8138 used hint:
8139 SeqScan(t1)
8140 not used hint:
8141 duplication hint:
8142 error hint:
8143
8144 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8145 PL/pgSQL function testfunc() line 3 at RETURN QUERY
8146  id | val 
8147 ----+-----
8148   1 |   1
8149 (1 row)
8150
8151 -- Test for error exit from inner SQL statement.
8152 DROP FUNCTION testfunc();
8153 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8154 BEGIN
8155   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id;
8156 END;
8157 $$ LANGUAGE plpgsql;
8158 SELECT * FROM testfunc() LIMIT 1;
8159 ERROR:  relation "ttx" does not exist
8160 LINE 1: SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8161                                          ^
8162 QUERY:  SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8163 CONTEXT:  PL/pgSQL function testfunc() line 3 at RETURN QUERY
8164 -- this should not use SeqScan(t1) hint.
8165 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
8166 LOG:  pg_hint_plan:
8167 used hint:
8168 IndexScan(t1)
8169 not used hint:
8170 duplication hint:
8171 error hint:
8172
8173  id | val 
8174 ----+-----
8175   1 |   1
8176 (1 row)
8177
8178 DROP FUNCTION testfunc();
8179 DROP EXTENSION pg_hint_plan;
8180 --
8181 -- Rows hint tests
8182 --
8183 -- Explain result includes "Planning time" if COSTS is enabled, but
8184 -- this test needs it enabled for get rows count. So do tests via psql
8185 -- and grep -v the mutable line.
8186 -- value types
8187 \o results/pg_hint_plan.tmpout
8188 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8189 \o
8190 \! sql/maskout.sh results/pg_hint_plan.tmpout
8191                                   QUERY PLAN                                  
8192 ------------------------------------------------------------------------------
8193  Merge Join  (cost=xxx rows=1000 width=xxx)
8194    Merge Cond: (t1.id = t2.id)
8195    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8196    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8197 (4 rows)
8198
8199 \o results/pg_hint_plan.tmpout
8200 /*+ Rows(t1 t2 #99) */
8201 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8202 LOG:  pg_hint_plan:
8203 used hint:
8204 Rows(t1 t2 #99)
8205 not used hint:
8206 duplication hint:
8207 error hint:
8208
8209 \o
8210 \! sql/maskout.sh results/pg_hint_plan.tmpout
8211                                   QUERY PLAN                                  
8212 ------------------------------------------------------------------------------
8213  Merge Join  (cost=xxx rows=99 width=xxx)
8214    Merge Cond: (t1.id = t2.id)
8215    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8216    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8217 (4 rows)
8218
8219 \o results/pg_hint_plan.tmpout
8220 /*+ Rows(t1 t2 +99) */
8221 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8222 LOG:  pg_hint_plan:
8223 used hint:
8224 Rows(t1 t2 +99)
8225 not used hint:
8226 duplication hint:
8227 error hint:
8228
8229 \o
8230 \! sql/maskout.sh results/pg_hint_plan.tmpout
8231                                   QUERY PLAN                                  
8232 ------------------------------------------------------------------------------
8233  Merge Join  (cost=xxx rows=1099 width=xxx)
8234    Merge Cond: (t1.id = t2.id)
8235    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8236    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8237 (4 rows)
8238
8239 \o results/pg_hint_plan.tmpout
8240 /*+ Rows(t1 t2 -99) */
8241 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8242 LOG:  pg_hint_plan:
8243 used hint:
8244 Rows(t1 t2 -99)
8245 not used hint:
8246 duplication hint:
8247 error hint:
8248
8249 \o
8250 \! sql/maskout.sh results/pg_hint_plan.tmpout
8251                                   QUERY PLAN                                  
8252 ------------------------------------------------------------------------------
8253  Merge Join  (cost=xxx rows=901 width=xxx)
8254    Merge Cond: (t1.id = t2.id)
8255    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8256    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8257 (4 rows)
8258
8259 \o results/pg_hint_plan.tmpout
8260 /*+ Rows(t1 t2 *99) */
8261 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8262 LOG:  pg_hint_plan:
8263 used hint:
8264 Rows(t1 t2 *99)
8265 not used hint:
8266 duplication hint:
8267 error hint:
8268
8269 \o
8270 \! sql/maskout.sh results/pg_hint_plan.tmpout
8271                                   QUERY PLAN                                  
8272 ------------------------------------------------------------------------------
8273  Merge Join  (cost=xxx rows=99000 width=xxx)
8274    Merge Cond: (t1.id = t2.id)
8275    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8276    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8277 (4 rows)
8278
8279 \o results/pg_hint_plan.tmpout
8280 /*+ Rows(t1 t2 *0.01) */
8281 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8282 LOG:  pg_hint_plan:
8283 used hint:
8284 Rows(t1 t2 *0.01)
8285 not used hint:
8286 duplication hint:
8287 error hint:
8288
8289 \o
8290 \! sql/maskout.sh results/pg_hint_plan.tmpout
8291                                   QUERY PLAN                                  
8292 ------------------------------------------------------------------------------
8293  Merge Join  (cost=xxx rows=10 width=xxx)
8294    Merge Cond: (t1.id = t2.id)
8295    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8296    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8297 (4 rows)
8298
8299 \o results/pg_hint_plan.tmpout
8300 /*+ Rows(t1 t2 #aa) */
8301 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8302 INFO:  pg_hint_plan: hint syntax error at or near "aa"
8303 DETAIL:  Rows hint requires valid number as rows estimation.
8304 LOG:  pg_hint_plan:
8305 used hint:
8306 not used hint:
8307 duplication hint:
8308 error hint:
8309 Rows(t1 t2 #aa)
8310
8311 \o
8312 \! sql/maskout.sh results/pg_hint_plan.tmpout
8313                                   QUERY PLAN                                  
8314 ------------------------------------------------------------------------------
8315  Merge Join  (cost=xxx rows=1000 width=xxx)
8316    Merge Cond: (t1.id = t2.id)
8317    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8318    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8319 (4 rows)
8320
8321 \o results/pg_hint_plan.tmpout
8322 /*+ Rows(t1 t2 /99) */
8323 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8324 INFO:  pg_hint_plan: hint syntax error at or near "/99"
8325 DETAIL:  Unrecognized rows value type notation.
8326 LOG:  pg_hint_plan:
8327 used hint:
8328 not used hint:
8329 duplication hint:
8330 error hint:
8331 Rows(t1 t2 /99)
8332
8333 \o
8334 \! sql/maskout.sh results/pg_hint_plan.tmpout
8335                                   QUERY PLAN                                  
8336 ------------------------------------------------------------------------------
8337  Merge Join  (cost=xxx rows=1000 width=xxx)
8338    Merge Cond: (t1.id = t2.id)
8339    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8340    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8341 (4 rows)
8342
8343 -- round up to 1
8344 \o results/pg_hint_plan.tmpout
8345 /*+ Rows(t1 t2 -99999) */
8346 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8347 WARNING:  Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 -99999) 
8348 LOG:  pg_hint_plan:
8349 used hint:
8350 Rows(t1 t2 -99999)
8351 not used hint:
8352 duplication hint:
8353 error hint:
8354
8355 \o
8356 \! sql/maskout.sh results/pg_hint_plan.tmpout
8357                                   QUERY PLAN                                  
8358 ------------------------------------------------------------------------------
8359  Merge Join  (cost=xxx rows=1 width=xxx)
8360    Merge Cond: (t1.id = t2.id)
8361    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8362    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8363 (4 rows)
8364
8365 -- complex join tree
8366 \o results/pg_hint_plan.tmpout
8367 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8368 \o
8369 \! sql/maskout.sh results/pg_hint_plan.tmpout
8370                                      QUERY PLAN                                     
8371 ------------------------------------------------------------------------------------
8372  Merge Join  (cost=xxx rows=10 width=xxx)
8373    Merge Cond: (t1.id = t3.id)
8374    ->  Merge Join  (cost=xxx rows=1000 width=xxx)
8375          Merge Cond: (t1.id = t2.id)
8376          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8377          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8378    ->  Sort  (cost=xxx rows=100 width=xxx)
8379          Sort Key: t3.id
8380          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8381 (9 rows)
8382
8383 \o results/pg_hint_plan.tmpout
8384 /*+ Rows(t1 t2 #22) */
8385 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8386 LOG:  pg_hint_plan:
8387 used hint:
8388 Rows(t1 t2 #22)
8389 not used hint:
8390 duplication hint:
8391 error hint:
8392
8393 \o
8394 \! sql/maskout.sh results/pg_hint_plan.tmpout
8395                                      QUERY PLAN                                     
8396 ------------------------------------------------------------------------------------
8397  Merge Join  (cost=xxx rows=1 width=xxx)
8398    Merge Cond: (t1.id = t3.id)
8399    ->  Merge Join  (cost=xxx rows=22 width=xxx)
8400          Merge Cond: (t1.id = t2.id)
8401          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8402          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8403    ->  Sort  (cost=xxx rows=100 width=xxx)
8404          Sort Key: t3.id
8405          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8406 (9 rows)
8407
8408 \o results/pg_hint_plan.tmpout
8409 /*+ Rows(t1 t3 *10) */
8410 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8411 LOG:  pg_hint_plan:
8412 used hint:
8413 Rows(t1 t3 *10)
8414 not used hint:
8415 duplication hint:
8416 error hint:
8417
8418 \o
8419 set max_parallel_workers_per_gather to DEFAULT;
8420 \! sql/maskout.sh results/pg_hint_plan.tmpout
8421                                      QUERY PLAN                                     
8422 ------------------------------------------------------------------------------------
8423  Merge Join  (cost=xxx rows=100 width=xxx)
8424    Merge Cond: (t1.id = t3.id)
8425    ->  Merge Join  (cost=xxx rows=1000 width=xxx)
8426          Merge Cond: (t1.id = t2.id)
8427          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8428          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8429    ->  Sort  (cost=xxx rows=100 width=xxx)
8430          Sort Key: t3.id
8431          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8432 (9 rows)
8433
8434 \! rm results/pg_hint_plan.tmpout
8435 -- hint error level
8436 set client_min_messages to 'DEBUG1';
8437 set pg_hint_plan.debug_level to 'verbose';
8438 /*+ SeqScan( */ SELECT 1;
8439 INFO:  pg_hint_plan: hint syntax error at or near ""
8440 DETAIL:  Closing parenthesis is necessary.
8441  ?column? 
8442 ----------
8443         1
8444 (1 row)
8445
8446 /*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
8447 LOG:  pg_hint_plan:
8448 used hint:
8449 SeqScan(t1)
8450 not used hint:
8451 duplication hint:
8452 error hint:
8453
8454  id | val 
8455 ----+-----
8456 (0 rows)
8457
8458 set pg_hint_plan.message_level to 'DEBUG1';
8459 set pg_hint_plan.parse_messages to 'NOTICE';
8460 /*+ SeqScan( */ SELECT 1;
8461 NOTICE:  pg_hint_plan: hint syntax error at or near ""
8462 DETAIL:  Closing parenthesis is necessary.
8463  ?column? 
8464 ----------
8465         1
8466 (1 row)
8467
8468 /*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
8469 DEBUG:  pg_hint_plan:
8470 used hint:
8471 SeqScan(t1)
8472 not used hint:
8473 duplication hint:
8474 error hint:
8475
8476  id | val 
8477 ----+-----
8478 (0 rows)
8479