OSDN Git Service

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