OSDN Git Service

リファクタリング:Hintの種別コードをHint構造体にもたせ、
[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 /*+NestLoop(p1 t1)*/
3547 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3548 LOG:  pg_hint_plan:
3549 used hint:
3550 NestLoop(p1 t1)
3551 not used hint:
3552 duplication hint:
3553 error hint:
3554
3555                                  QUERY PLAN                                  
3556 -----------------------------------------------------------------------------
3557  Nested Loop
3558    Join Filter: (public.p1.id = t1.id)
3559    ->  Append
3560          ->  Seq Scan on p1
3561                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3562          ->  Seq Scan on p1_c1 p1
3563                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3564          ->  Seq Scan on p1_c2 p1
3565                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3566          ->  Seq Scan on p1_c3 p1
3567                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3568          ->  Tid Scan on p1_c4 p1
3569                TID Cond: (ctid = '(1,1)'::tid)
3570                Filter: ((id >= 50) AND (id <= 51))
3571          ->  Tid Scan on p1_c1_c1 p1
3572                TID Cond: (ctid = '(1,1)'::tid)
3573                Filter: ((id >= 50) AND (id <= 51))
3574          ->  Tid Scan on p1_c1_c2 p1
3575                TID Cond: (ctid = '(1,1)'::tid)
3576                Filter: ((id >= 50) AND (id <= 51))
3577          ->  Tid Scan on p1_c3_c1 p1
3578                TID Cond: (ctid = '(1,1)'::tid)
3579                Filter: ((id >= 50) AND (id <= 51))
3580          ->  Tid Scan on p1_c3_c2 p1
3581                TID Cond: (ctid = '(1,1)'::tid)
3582                Filter: ((id >= 50) AND (id <= 51))
3583    ->  Materialize
3584          ->  Index Scan using t1_pkey on t1
3585                Index Cond: (id < 10)
3586 (29 rows)
3587
3588 /*+MergeJoin(p1 t1)*/
3589 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;
3590 LOG:  pg_hint_plan:
3591 used hint:
3592 MergeJoin(p1 t1)
3593 not used hint:
3594 duplication hint:
3595 error hint:
3596
3597                                     QUERY PLAN                                     
3598 -----------------------------------------------------------------------------------
3599  Merge Join
3600    Merge Cond: (public.p1.id = t1.id)
3601    ->  Sort
3602          Sort Key: public.p1.id
3603          ->  Append
3604                ->  Seq Scan on p1
3605                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3606                ->  Seq Scan on p1_c1 p1
3607                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3608                ->  Seq Scan on p1_c2 p1
3609                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3610                ->  Seq Scan on p1_c3 p1
3611                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3612                ->  Tid Scan on p1_c4 p1
3613                      TID Cond: (ctid = '(1,1)'::tid)
3614                      Filter: ((id >= 50) AND (id <= 51))
3615                ->  Tid Scan on p1_c1_c1 p1
3616                      TID Cond: (ctid = '(1,1)'::tid)
3617                      Filter: ((id >= 50) AND (id <= 51))
3618                ->  Tid Scan on p1_c1_c2 p1
3619                      TID Cond: (ctid = '(1,1)'::tid)
3620                      Filter: ((id >= 50) AND (id <= 51))
3621                ->  Tid Scan on p1_c3_c1 p1
3622                      TID Cond: (ctid = '(1,1)'::tid)
3623                      Filter: ((id >= 50) AND (id <= 51))
3624                ->  Tid Scan on p1_c3_c2 p1
3625                      TID Cond: (ctid = '(1,1)'::tid)
3626                      Filter: ((id >= 50) AND (id <= 51))
3627    ->  Index Scan using t1_pkey on t1
3628          Index Cond: (id < 10)
3629 (30 rows)
3630
3631 /*+HashJoin(p1 t1)*/
3632 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;
3633 LOG:  pg_hint_plan:
3634 used hint:
3635 HashJoin(p1 t1)
3636 not used hint:
3637 duplication hint:
3638 error hint:
3639
3640                                  QUERY PLAN                                  
3641 -----------------------------------------------------------------------------
3642  Hash Join
3643    Hash Cond: (public.p1.id = t1.id)
3644    ->  Append
3645          ->  Seq Scan on p1
3646                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3647          ->  Seq Scan on p1_c1 p1
3648                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3649          ->  Seq Scan on p1_c2 p1
3650                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3651          ->  Seq Scan on p1_c3 p1
3652                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3653          ->  Tid Scan on p1_c4 p1
3654                TID Cond: (ctid = '(1,1)'::tid)
3655                Filter: ((id >= 50) AND (id <= 51))
3656          ->  Tid Scan on p1_c1_c1 p1
3657                TID Cond: (ctid = '(1,1)'::tid)
3658                Filter: ((id >= 50) AND (id <= 51))
3659          ->  Tid Scan on p1_c1_c2 p1
3660                TID Cond: (ctid = '(1,1)'::tid)
3661                Filter: ((id >= 50) AND (id <= 51))
3662          ->  Tid Scan on p1_c3_c1 p1
3663                TID Cond: (ctid = '(1,1)'::tid)
3664                Filter: ((id >= 50) AND (id <= 51))
3665          ->  Tid Scan on p1_c3_c2 p1
3666                TID Cond: (ctid = '(1,1)'::tid)
3667                Filter: ((id >= 50) AND (id <= 51))
3668    ->  Hash
3669          ->  Index Scan using t1_pkey on t1
3670                Index Cond: (id < 10)
3671 (29 rows)
3672
3673 SET constraint_exclusion TO on;
3674 /*+SeqScan(p1)*/
3675 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;
3676 LOG:  pg_hint_plan:
3677 used hint:
3678 SeqScan(p1)
3679 not used hint:
3680 duplication hint:
3681 error hint:
3682
3683                                     QUERY PLAN                                     
3684 -----------------------------------------------------------------------------------
3685  Merge Join
3686    Merge Cond: (public.p1.id = t1.id)
3687    ->  Sort
3688          Sort Key: public.p1.id
3689          ->  Append
3690                ->  Seq Scan on p1
3691                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3692                ->  Seq Scan on p1_c1 p1
3693                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3694                ->  Seq Scan on p1_c1_c1 p1
3695                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3696                ->  Seq Scan on p1_c1_c2 p1
3697                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3698    ->  Index Scan using t1_pkey on t1
3699          Index Cond: (id < 10)
3700 (15 rows)
3701
3702 /*+IndexScan(p1)*/
3703 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;
3704 LOG:  pg_hint_plan:
3705 used hint:
3706 IndexScan(p1)
3707 not used hint:
3708 duplication hint:
3709 error hint:
3710
3711                         QUERY PLAN                         
3712 -----------------------------------------------------------
3713  Merge Join
3714    Merge Cond: (public.p1.id = t1.id)
3715    ->  Merge Append
3716          Sort Key: public.p1.id
3717          ->  Index Scan using p1_pkey on p1
3718                Index Cond: ((id >= 50) AND (id <= 51))
3719                Filter: (ctid = '(1,1)'::tid)
3720          ->  Index Scan using p1_c1_pkey on p1_c1 p1
3721                Index Cond: ((id >= 50) AND (id <= 51))
3722                Filter: (ctid = '(1,1)'::tid)
3723          ->  Index Scan using p1_c1_c1_pkey on p1_c1_c1 p1
3724                Index Cond: ((id >= 50) AND (id <= 51))
3725                Filter: (ctid = '(1,1)'::tid)
3726          ->  Index Scan using p1_c1_c2_pkey on p1_c1_c2 p1
3727                Index Cond: ((id >= 50) AND (id <= 51))
3728                Filter: (ctid = '(1,1)'::tid)
3729    ->  Index Scan using t1_pkey on t1
3730          Index Cond: (id < 10)
3731 (18 rows)
3732
3733 /*+BitmapScan(p1)*/
3734 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;
3735 LOG:  pg_hint_plan:
3736 used hint:
3737 BitmapScan(p1)
3738 not used hint:
3739 duplication hint:
3740 error hint:
3741
3742                             QUERY PLAN                             
3743 -------------------------------------------------------------------
3744  Merge Join
3745    Merge Cond: (public.p1.id = t1.id)
3746    ->  Sort
3747          Sort Key: public.p1.id
3748          ->  Append
3749                ->  Bitmap Heap Scan on p1
3750                      Recheck Cond: ((id >= 50) AND (id <= 51))
3751                      Filter: (ctid = '(1,1)'::tid)
3752                      ->  Bitmap Index Scan on p1_pkey
3753                            Index Cond: ((id >= 50) AND (id <= 51))
3754                ->  Bitmap Heap Scan on p1_c1 p1
3755                      Recheck Cond: ((id >= 50) AND (id <= 51))
3756                      Filter: (ctid = '(1,1)'::tid)
3757                      ->  Bitmap Index Scan on p1_c1_pkey
3758                            Index Cond: ((id >= 50) AND (id <= 51))
3759                ->  Bitmap Heap Scan on p1_c1_c1 p1
3760                      Recheck Cond: ((id >= 50) AND (id <= 51))
3761                      Filter: (ctid = '(1,1)'::tid)
3762                      ->  Bitmap Index Scan on p1_c1_c1_pkey
3763                            Index Cond: ((id >= 50) AND (id <= 51))
3764                ->  Bitmap Heap Scan on p1_c1_c2 p1
3765                      Recheck Cond: ((id >= 50) AND (id <= 51))
3766                      Filter: (ctid = '(1,1)'::tid)
3767                      ->  Bitmap Index Scan on p1_c1_c2_pkey
3768                            Index Cond: ((id >= 50) AND (id <= 51))
3769    ->  Index Scan using t1_pkey on t1
3770          Index Cond: (id < 10)
3771 (27 rows)
3772
3773 /*+TidScan(p1)*/
3774 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;
3775 LOG:  pg_hint_plan:
3776 used hint:
3777 TidScan(p1)
3778 not used hint:
3779 duplication hint:
3780 error hint:
3781
3782                        QUERY PLAN                        
3783 ---------------------------------------------------------
3784  Merge Join
3785    Merge Cond: (public.p1.id = t1.id)
3786    ->  Sort
3787          Sort Key: public.p1.id
3788          ->  Append
3789                ->  Tid Scan on p1
3790                      TID Cond: (ctid = '(1,1)'::tid)
3791                      Filter: ((id >= 50) AND (id <= 51))
3792                ->  Tid Scan on p1_c1 p1
3793                      TID Cond: (ctid = '(1,1)'::tid)
3794                      Filter: ((id >= 50) AND (id <= 51))
3795                ->  Tid Scan on p1_c1_c1 p1
3796                      TID Cond: (ctid = '(1,1)'::tid)
3797                      Filter: ((id >= 50) AND (id <= 51))
3798                ->  Tid Scan on p1_c1_c2 p1
3799                      TID Cond: (ctid = '(1,1)'::tid)
3800                      Filter: ((id >= 50) AND (id <= 51))
3801    ->  Index Scan using t1_pkey on t1
3802          Index Cond: (id < 10)
3803 (19 rows)
3804
3805 /*+NestLoop(p1 t1)*/
3806 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3807 LOG:  pg_hint_plan:
3808 used hint:
3809 NestLoop(p1 t1)
3810 not used hint:
3811 duplication hint:
3812 error hint:
3813
3814                                     QUERY PLAN                                     
3815 -----------------------------------------------------------------------------------
3816  Nested Loop
3817    Join Filter: (public.p1.id = t1.id)
3818    ->  Index Scan using t1_pkey on t1
3819          Index Cond: (id < 10)
3820    ->  Materialize
3821          ->  Append
3822                ->  Seq Scan on p1
3823                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3824                ->  Seq Scan on p1_c1 p1
3825                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3826                ->  Tid Scan on p1_c1_c1 p1
3827                      TID Cond: (ctid = '(1,1)'::tid)
3828                      Filter: ((id >= 50) AND (id <= 51))
3829                ->  Tid Scan on p1_c1_c2 p1
3830                      TID Cond: (ctid = '(1,1)'::tid)
3831                      Filter: ((id >= 50) AND (id <= 51))
3832 (16 rows)
3833
3834 /*+MergeJoin(p1 t1)*/
3835 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;
3836 LOG:  pg_hint_plan:
3837 used hint:
3838 MergeJoin(p1 t1)
3839 not used hint:
3840 duplication hint:
3841 error hint:
3842
3843                                     QUERY PLAN                                     
3844 -----------------------------------------------------------------------------------
3845  Merge Join
3846    Merge Cond: (public.p1.id = t1.id)
3847    ->  Sort
3848          Sort Key: public.p1.id
3849          ->  Append
3850                ->  Seq Scan on p1
3851                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3852                ->  Seq Scan on p1_c1 p1
3853                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3854                ->  Tid Scan on p1_c1_c1 p1
3855                      TID Cond: (ctid = '(1,1)'::tid)
3856                      Filter: ((id >= 50) AND (id <= 51))
3857                ->  Tid Scan on p1_c1_c2 p1
3858                      TID Cond: (ctid = '(1,1)'::tid)
3859                      Filter: ((id >= 50) AND (id <= 51))
3860    ->  Index Scan using t1_pkey on t1
3861          Index Cond: (id < 10)
3862 (17 rows)
3863
3864 /*+HashJoin(p1 t1)*/
3865 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3866 LOG:  pg_hint_plan:
3867 used hint:
3868 HashJoin(p1 t1)
3869 not used hint:
3870 duplication hint:
3871 error hint:
3872
3873                                     QUERY PLAN                                     
3874 -----------------------------------------------------------------------------------
3875  Hash Join
3876    Hash Cond: (t1.id = public.p1.id)
3877    ->  Index Scan using t1_pkey on t1
3878          Index Cond: (id < 10)
3879    ->  Hash
3880          ->  Append
3881                ->  Seq Scan on p1
3882                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3883                ->  Seq Scan on p1_c1 p1
3884                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3885                ->  Tid Scan on p1_c1_c1 p1
3886                      TID Cond: (ctid = '(1,1)'::tid)
3887                      Filter: ((id >= 50) AND (id <= 51))
3888                ->  Tid Scan on p1_c1_c2 p1
3889                      TID Cond: (ctid = '(1,1)'::tid)
3890                      Filter: ((id >= 50) AND (id <= 51))
3891 (16 rows)
3892
3893 SET constraint_exclusion TO off;
3894 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3895                            QUERY PLAN                            
3896 -----------------------------------------------------------------
3897  Seq Scan on p1
3898    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3899 (2 rows)
3900
3901 SET constraint_exclusion TO on;
3902 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3903                            QUERY PLAN                            
3904 -----------------------------------------------------------------
3905  Seq Scan on p1
3906    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3907 (2 rows)
3908
3909 SET constraint_exclusion TO off;
3910 /*+SeqScan(p1)*/
3911 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3912 LOG:  pg_hint_plan:
3913 used hint:
3914 SeqScan(p1)
3915 not used hint:
3916 duplication hint:
3917 error hint:
3918
3919                            QUERY PLAN                            
3920 -----------------------------------------------------------------
3921  Seq Scan on p1
3922    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3923 (2 rows)
3924
3925 /*+IndexScan(p1)*/
3926 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3927 LOG:  pg_hint_plan:
3928 used hint:
3929 IndexScan(p1)
3930 not used hint:
3931 duplication hint:
3932 error hint:
3933
3934                 QUERY PLAN                 
3935 -------------------------------------------
3936  Index Scan using p1_pkey on p1
3937    Index Cond: ((id >= 50) AND (id <= 51))
3938    Filter: (ctid = '(1,1)'::tid)
3939 (3 rows)
3940
3941 /*+BitmapScan(p1)*/
3942 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3943 LOG:  pg_hint_plan:
3944 used hint:
3945 BitmapScan(p1)
3946 not used hint:
3947 duplication hint:
3948 error hint:
3949
3950                    QUERY PLAN                    
3951 -------------------------------------------------
3952  Bitmap Heap Scan on p1
3953    Recheck Cond: ((id >= 50) AND (id <= 51))
3954    Filter: (ctid = '(1,1)'::tid)
3955    ->  Bitmap Index Scan on p1_pkey
3956          Index Cond: ((id >= 50) AND (id <= 51))
3957 (5 rows)
3958
3959 /*+TidScan(p1)*/
3960 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3961 LOG:  pg_hint_plan:
3962 used hint:
3963 TidScan(p1)
3964 not used hint:
3965 duplication hint:
3966 error hint:
3967
3968               QUERY PLAN               
3969 ---------------------------------------
3970  Tid Scan on p1
3971    TID Cond: (ctid = '(1,1)'::tid)
3972    Filter: ((id >= 50) AND (id <= 51))
3973 (3 rows)
3974
3975 /*+NestLoop(p1 t1)*/
3976 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;
3977 LOG:  pg_hint_plan:
3978 used hint:
3979 NestLoop(p1 t1)
3980 not used hint:
3981 duplication hint:
3982 error hint:
3983
3984                               QUERY PLAN                               
3985 -----------------------------------------------------------------------
3986  Nested Loop
3987    ->  Seq Scan on p1
3988          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3989    ->  Index Scan using t1_pkey on t1
3990          Index Cond: ((id < 10) AND (id = p1.id))
3991 (5 rows)
3992
3993 /*+MergeJoin(p1 t1)*/
3994 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;
3995 LOG:  pg_hint_plan:
3996 used hint:
3997 MergeJoin(p1 t1)
3998 not used hint:
3999 duplication hint:
4000 error hint:
4001
4002                                  QUERY PLAN                                  
4003 -----------------------------------------------------------------------------
4004  Merge Join
4005    Merge Cond: (p1.id = t1.id)
4006    ->  Sort
4007          Sort Key: p1.id
4008          ->  Seq Scan on p1
4009                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4010    ->  Index Scan using t1_pkey on t1
4011          Index Cond: (id < 10)
4012 (8 rows)
4013
4014 /*+HashJoin(p1 t1)*/
4015 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;
4016 LOG:  pg_hint_plan:
4017 used hint:
4018 HashJoin(p1 t1)
4019 not used hint:
4020 duplication hint:
4021 error hint:
4022
4023                                  QUERY PLAN                                  
4024 -----------------------------------------------------------------------------
4025  Hash Join
4026    Hash Cond: (t1.id = p1.id)
4027    ->  Index Scan using t1_pkey on t1
4028          Index Cond: (id < 10)
4029    ->  Hash
4030          ->  Seq Scan on p1
4031                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4032 (7 rows)
4033
4034 SET constraint_exclusion TO on;
4035 /*+SeqScan(p1)*/
4036 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4037 LOG:  pg_hint_plan:
4038 used hint:
4039 SeqScan(p1)
4040 not used hint:
4041 duplication hint:
4042 error hint:
4043
4044                            QUERY PLAN                            
4045 -----------------------------------------------------------------
4046  Seq Scan on p1
4047    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4048 (2 rows)
4049
4050 /*+IndexScan(p1)*/
4051 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4052 LOG:  pg_hint_plan:
4053 used hint:
4054 IndexScan(p1)
4055 not used hint:
4056 duplication hint:
4057 error hint:
4058
4059                 QUERY PLAN                 
4060 -------------------------------------------
4061  Index Scan using p1_pkey on p1
4062    Index Cond: ((id >= 50) AND (id <= 51))
4063    Filter: (ctid = '(1,1)'::tid)
4064 (3 rows)
4065
4066 /*+BitmapScan(p1)*/
4067 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4068 LOG:  pg_hint_plan:
4069 used hint:
4070 BitmapScan(p1)
4071 not used hint:
4072 duplication hint:
4073 error hint:
4074
4075                    QUERY PLAN                    
4076 -------------------------------------------------
4077  Bitmap Heap Scan on p1
4078    Recheck Cond: ((id >= 50) AND (id <= 51))
4079    Filter: (ctid = '(1,1)'::tid)
4080    ->  Bitmap Index Scan on p1_pkey
4081          Index Cond: ((id >= 50) AND (id <= 51))
4082 (5 rows)
4083
4084 /*+TidScan(p1)*/
4085 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4086 LOG:  pg_hint_plan:
4087 used hint:
4088 TidScan(p1)
4089 not used hint:
4090 duplication hint:
4091 error hint:
4092
4093               QUERY PLAN               
4094 ---------------------------------------
4095  Tid Scan on p1
4096    TID Cond: (ctid = '(1,1)'::tid)
4097    Filter: ((id >= 50) AND (id <= 51))
4098 (3 rows)
4099
4100 /*+NestLoop(p1 t1)*/
4101 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;
4102 LOG:  pg_hint_plan:
4103 used hint:
4104 NestLoop(p1 t1)
4105 not used hint:
4106 duplication hint:
4107 error hint:
4108
4109                               QUERY PLAN                               
4110 -----------------------------------------------------------------------
4111  Nested Loop
4112    ->  Seq Scan on p1
4113          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4114    ->  Index Scan using t1_pkey on t1
4115          Index Cond: ((id < 10) AND (id = p1.id))
4116 (5 rows)
4117
4118 /*+MergeJoin(p1 t1)*/
4119 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;
4120 LOG:  pg_hint_plan:
4121 used hint:
4122 MergeJoin(p1 t1)
4123 not used hint:
4124 duplication hint:
4125 error hint:
4126
4127                                  QUERY PLAN                                  
4128 -----------------------------------------------------------------------------
4129  Merge Join
4130    Merge Cond: (p1.id = t1.id)
4131    ->  Sort
4132          Sort Key: p1.id
4133          ->  Seq Scan on p1
4134                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4135    ->  Index Scan using t1_pkey on t1
4136          Index Cond: (id < 10)
4137 (8 rows)
4138
4139 /*+HashJoin(p1 t1)*/
4140 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;
4141 LOG:  pg_hint_plan:
4142 used hint:
4143 HashJoin(p1 t1)
4144 not used hint:
4145 duplication hint:
4146 error hint:
4147
4148                                  QUERY PLAN                                  
4149 -----------------------------------------------------------------------------
4150  Hash Join
4151    Hash Cond: (t1.id = p1.id)
4152    ->  Index Scan using t1_pkey on t1
4153          Index Cond: (id < 10)
4154    ->  Hash
4155          ->  Seq Scan on p1
4156                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4157 (7 rows)
4158
4159 SET constraint_exclusion TO off;
4160 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;
4161                               QUERY PLAN                               
4162 -----------------------------------------------------------------------
4163  Nested Loop
4164    ->  Seq Scan on p1
4165          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4166    ->  Index Scan using t1_pkey on t1
4167          Index Cond: ((id < 10) AND (id = p1.id))
4168 (5 rows)
4169
4170 SET constraint_exclusion TO on;
4171 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;
4172                               QUERY PLAN                               
4173 -----------------------------------------------------------------------
4174  Nested Loop
4175    ->  Seq Scan on p1
4176          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4177    ->  Index Scan using t1_pkey on t1
4178          Index Cond: ((id < 10) AND (id = p1.id))
4179 (5 rows)
4180
4181 SET constraint_exclusion TO off;
4182 /*+SeqScan(p1)*/
4183 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;
4184 LOG:  pg_hint_plan:
4185 used hint:
4186 SeqScan(p1)
4187 not used hint:
4188 duplication hint:
4189 error hint:
4190
4191                               QUERY PLAN                               
4192 -----------------------------------------------------------------------
4193  Nested Loop
4194    ->  Seq Scan on p1
4195          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4196    ->  Index Scan using t1_pkey on t1
4197          Index Cond: ((id < 10) AND (id = p1.id))
4198 (5 rows)
4199
4200 /*+IndexScan(p1)*/
4201 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;
4202 LOG:  pg_hint_plan:
4203 used hint:
4204 IndexScan(p1)
4205 not used hint:
4206 duplication hint:
4207 error hint:
4208
4209                     QUERY PLAN                    
4210 --------------------------------------------------
4211  Nested Loop
4212    ->  Index Scan using p1_pkey on p1
4213          Index Cond: ((id >= 50) AND (id <= 51))
4214          Filter: (ctid = '(1,1)'::tid)
4215    ->  Index Scan using t1_pkey on t1
4216          Index Cond: ((id < 10) AND (id = p1.id))
4217 (6 rows)
4218
4219 /*+BitmapScan(p1)*/
4220 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;
4221 LOG:  pg_hint_plan:
4222 used hint:
4223 BitmapScan(p1)
4224 not used hint:
4225 duplication hint:
4226 error hint:
4227
4228                       QUERY PLAN                       
4229 -------------------------------------------------------
4230  Nested Loop
4231    ->  Bitmap Heap Scan on p1
4232          Recheck Cond: ((id >= 50) AND (id <= 51))
4233          Filter: (ctid = '(1,1)'::tid)
4234          ->  Bitmap Index Scan on p1_pkey
4235                Index Cond: ((id >= 50) AND (id <= 51))
4236    ->  Index Scan using t1_pkey on t1
4237          Index Cond: ((id < 10) AND (id = p1.id))
4238 (8 rows)
4239
4240 /*+TidScan(p1)*/
4241 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;
4242 LOG:  pg_hint_plan:
4243 used hint:
4244 TidScan(p1)
4245 not used hint:
4246 duplication hint:
4247 error hint:
4248
4249                     QUERY PLAN                    
4250 --------------------------------------------------
4251  Nested Loop
4252    ->  Tid Scan on p1
4253          TID Cond: (ctid = '(1,1)'::tid)
4254          Filter: ((id >= 50) AND (id <= 51))
4255    ->  Index Scan using t1_pkey on t1
4256          Index Cond: ((id < 10) AND (id = p1.id))
4257 (6 rows)
4258
4259 SET constraint_exclusion TO on;
4260 /*+SeqScan(p1)*/
4261 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;
4262 LOG:  pg_hint_plan:
4263 used hint:
4264 SeqScan(p1)
4265 not used hint:
4266 duplication hint:
4267 error hint:
4268
4269                               QUERY PLAN                               
4270 -----------------------------------------------------------------------
4271  Nested Loop
4272    ->  Seq Scan on p1
4273          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4274    ->  Index Scan using t1_pkey on t1
4275          Index Cond: ((id < 10) AND (id = p1.id))
4276 (5 rows)
4277
4278 /*+IndexScan(p1)*/
4279 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;
4280 LOG:  pg_hint_plan:
4281 used hint:
4282 IndexScan(p1)
4283 not used hint:
4284 duplication hint:
4285 error hint:
4286
4287                     QUERY PLAN                    
4288 --------------------------------------------------
4289  Nested Loop
4290    ->  Index Scan using p1_pkey on p1
4291          Index Cond: ((id >= 50) AND (id <= 51))
4292          Filter: (ctid = '(1,1)'::tid)
4293    ->  Index Scan using t1_pkey on t1
4294          Index Cond: ((id < 10) AND (id = p1.id))
4295 (6 rows)
4296
4297 /*+BitmapScan(p1)*/
4298 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;
4299 LOG:  pg_hint_plan:
4300 used hint:
4301 BitmapScan(p1)
4302 not used hint:
4303 duplication hint:
4304 error hint:
4305
4306                       QUERY PLAN                       
4307 -------------------------------------------------------
4308  Nested Loop
4309    ->  Bitmap Heap Scan on p1
4310          Recheck Cond: ((id >= 50) AND (id <= 51))
4311          Filter: (ctid = '(1,1)'::tid)
4312          ->  Bitmap Index Scan on p1_pkey
4313                Index Cond: ((id >= 50) AND (id <= 51))
4314    ->  Index Scan using t1_pkey on t1
4315          Index Cond: ((id < 10) AND (id = p1.id))
4316 (8 rows)
4317
4318 /*+TidScan(p1)*/
4319 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;
4320 LOG:  pg_hint_plan:
4321 used hint:
4322 TidScan(p1)
4323 not used hint:
4324 duplication hint:
4325 error hint:
4326
4327                     QUERY PLAN                    
4328 --------------------------------------------------
4329  Nested Loop
4330    ->  Tid Scan on p1
4331          TID Cond: (ctid = '(1,1)'::tid)
4332          Filter: ((id >= 50) AND (id <= 51))
4333    ->  Index Scan using t1_pkey on t1
4334          Index Cond: ((id < 10) AND (id = p1.id))
4335 (6 rows)
4336
4337 -- quote test
4338 /*+SeqScan("""t1 )      ")IndexScan("t  2 """)HashJoin("""t1 )  "T3"t   2 """)Leading("""t1 )   "T3"t   2 """)Set(application_name"a    a       a""     a       A")*/
4339 EXPLAIN (COSTS false) SELECT * FROM t1 """t1 )  ", t2 "t        2 """, t3 "T3" WHERE """t1 )    ".id = "t       2 """.id AND """t1 )    ".id = "T3".id;
4340 LOG:  pg_hint_plan:
4341 used hint:
4342 SeqScan("""t1 ) ")
4343 IndexScan("t    2 """)
4344 HashJoin("""t1 )        " T3 "t 2 """)
4345 Leading("""t1 ) " T3 "t 2 """)
4346 Set(application_name "a a       a""     a       A")
4347 not used hint:
4348 duplication hint:
4349 error hint:
4350
4351                        QUERY PLAN                        
4352 ---------------------------------------------------------
4353  Hash Join
4354    Hash Cond: ("t        2 """.id = """t1 )      ".id)
4355    ->  Index Scan using t2_pkey on t2 "t 2 """
4356    ->  Hash
4357          ->  Hash Join
4358                Hash Cond: ("""t1 )       ".id = "T3".id)
4359                ->  Seq Scan on t1 """t1 )        "
4360                ->  Hash
4361                      ->  Seq Scan on t3 "T3"
4362 (9 rows)
4363
4364 -- duplicate hint test
4365 /*+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)*/
4366 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
4367 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)"
4368 DETAIL:  Conflict scan method hint.
4369 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)"
4370 DETAIL:  Conflict scan method hint.
4371 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)"
4372 DETAIL:  Conflict scan method hint.
4373 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)"
4374 DETAIL:  Conflict scan method hint.
4375 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)"
4376 DETAIL:  Conflict scan method hint.
4377 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)"
4378 DETAIL:  Conflict scan method hint.
4379 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)"
4380 DETAIL:  Conflict join method hint.
4381 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)"
4382 DETAIL:  Conflict join method hint.
4383 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)"
4384 DETAIL:  Conflict leading hint.
4385 INFO:  hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4386 DETAIL:  Conflict set hint.
4387 LOG:  pg_hint_plan:
4388 used hint:
4389 TidScan(t1)
4390 TidScan(t2)
4391 MergeJoin(t1 t2)
4392 Leading(t2 t1)
4393 Set(enable_mergejoin on)
4394 Set(enable_seqscan on)
4395 not used hint:
4396 duplication hint:
4397 SeqScan(t1)
4398 IndexScan(t1)
4399 BitmapScan(t1)
4400 SeqScan(t2)
4401 IndexScan(t2)
4402 BitmapScan(t2)
4403 HashJoin(t1 t2)
4404 NestLoop(t1 t2)
4405 Leading(t1 t2)
4406 Set(enable_seqscan off)
4407 error hint:
4408
4409                   QUERY PLAN                   
4410 -----------------------------------------------
4411  Merge Join
4412    Merge Cond: (t1.id = t2.id)
4413    ->  Sort
4414          Sort Key: t1.id
4415          ->  Tid Scan on t1
4416                TID Cond: (ctid = '(1,1)'::tid)
4417    ->  Sort
4418          Sort Key: t2.id
4419          ->  Tid Scan on t2
4420                TID Cond: (ctid = '(1,1)'::tid)
4421 (10 rows)
4422
4423 -- sub query Leading hint test
4424 SET from_collapse_limit TO 100;
4425 SET geqo_threshold TO 100;
4426 EXPLAIN (COSTS false)
4427 WITH c1_1(id) AS (
4428 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
4429 )
4430 SELECT t1_1.id, (
4431 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
4432 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4433 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
4434 ) 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 = (
4435 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 
4436 );
4437                                QUERY PLAN                                
4438 -------------------------------------------------------------------------
4439  Nested Loop
4440    CTE c1_1
4441      ->  Aggregate
4442            ->  Merge Join
4443                  Merge Cond: (t1_5.id = t3_5.id)
4444                  ->  Merge Join
4445                        Merge Cond: (t1_5.id = t2_5.id)
4446                        ->  Index Scan using t1_pkey on t1 t1_5
4447                        ->  Index Scan using t2_pkey on t2 t2_5
4448                  ->  Sort
4449                        Sort Key: t3_5.id
4450                        ->  Seq Scan on t3 t3_5
4451    InitPlan 2 (returns $1)
4452      ->  Aggregate
4453            ->  Merge Join
4454                  Merge Cond: (t1_2.id = t3_2.id)
4455                  ->  Merge Join
4456                        Merge Cond: (t1_2.id = t2_2.id)
4457                        ->  Index Scan using t1_pkey on t1 t1_2
4458                        ->  Index Scan using t2_pkey on t2 t2_2
4459                  ->  Sort
4460                        Sort Key: t3_2.id
4461                        ->  Seq Scan on t3 t3_2
4462    InitPlan 3 (returns $2)
4463      ->  Aggregate
4464            ->  Merge Join
4465                  Merge Cond: (t1_4.id = t3_4.id)
4466                  ->  Merge Join
4467                        Merge Cond: (t1_4.id = t2_4.id)
4468                        ->  Index Scan using t1_pkey on t1 t1_4
4469                        ->  Index Scan using t2_pkey on t2 t2_4
4470                  ->  Sort
4471                        Sort Key: t3_4.id
4472                        ->  Seq Scan on t3 t3_4
4473    ->  Nested Loop
4474          ->  Nested Loop
4475                ->  Nested Loop
4476                      ->  Nested Loop
4477                            ->  Nested Loop
4478                                  ->  Index Scan using t1_pkey on t1 t1_1
4479                                        Index Cond: (id = $2)
4480                                  ->  Seq Scan on t3 t3_1
4481                                        Filter: (id = $2)
4482                            ->  Index Scan using t2_pkey on t2 t2_1
4483                                  Index Cond: (id = $2)
4484                      ->  Index Scan using t1_pkey on t1 t1_3
4485                            Index Cond: (id = $2)
4486                ->  Index Scan using t2_pkey on t2 t2_3
4487                      Index Cond: (id = $2)
4488          ->  Seq Scan on t3 t3_3
4489                Filter: (id = $2)
4490    ->  CTE Scan on c1_1
4491          Filter: (id = $2)
4492 (53 rows)
4493
4494 /*+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)*/
4495 EXPLAIN (COSTS false)
4496 WITH c1_1(id) AS (
4497 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
4498 )
4499 SELECT t1_1.id, (
4500 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
4501 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4502 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
4503 ) 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 = (
4504 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 
4505 );
4506 LOG:  pg_hint_plan:
4507 used hint:
4508 HashJoin(t1_1 t3_1)
4509 NestLoop(t1_2 t2_2)
4510 MergeJoin(t1_3 t3_3)
4511 NestLoop(t1_4 t2_4)
4512 NestLoop(t1_5 t2_5)
4513 not used hint:
4514 duplication hint:
4515 error hint:
4516
4517                                QUERY PLAN                                
4518 -------------------------------------------------------------------------
4519  Nested Loop
4520    CTE c1_1
4521      ->  Aggregate
4522            ->  Merge Join
4523                  Merge Cond: (t1_5.id = t3_5.id)
4524                  ->  Nested Loop
4525                        ->  Index Scan using t2_pkey on t2 t2_5
4526                        ->  Index Scan using t1_pkey on t1 t1_5
4527                              Index Cond: (id = t2_5.id)
4528                  ->  Sort
4529                        Sort Key: t3_5.id
4530                        ->  Seq Scan on t3 t3_5
4531    InitPlan 2 (returns $2)
4532      ->  Aggregate
4533            ->  Merge Join
4534                  Merge Cond: (t1_2.id = t3_2.id)
4535                  ->  Nested Loop
4536                        ->  Index Scan using t2_pkey on t2 t2_2
4537                        ->  Index Scan using t1_pkey on t1 t1_2
4538                              Index Cond: (id = t2_2.id)
4539                  ->  Sort
4540                        Sort Key: t3_2.id
4541                        ->  Seq Scan on t3 t3_2
4542    InitPlan 3 (returns $3)
4543      ->  Aggregate
4544            ->  Merge Join
4545                  Merge Cond: (t1_4.id = t3_4.id)
4546                  ->  Nested Loop
4547                        ->  Index Scan using t2_pkey on t2 t2_4
4548                        ->  Index Scan using t1_pkey on t1 t1_4
4549                              Index Cond: (id = t2_4.id)
4550                  ->  Sort
4551                        Sort Key: t3_4.id
4552                        ->  Seq Scan on t3 t3_4
4553    ->  Nested Loop
4554          ->  Nested Loop
4555                ->  Nested Loop
4556                      ->  Nested Loop
4557                            ->  Nested Loop
4558                                  ->  Index Scan using t2_pkey on t2 t2_1
4559                                        Index Cond: (id = $3)
4560                                  ->  Seq Scan on t3 t3_1
4561                                        Filter: (id = $3)
4562                            ->  Index Scan using t1_pkey on t1 t1_1
4563                                  Index Cond: (id = $3)
4564                      ->  Index Scan using t1_pkey on t1 t1_3
4565                            Index Cond: (id = $3)
4566                ->  Index Scan using t2_pkey on t2 t2_3
4567                      Index Cond: (id = $3)
4568          ->  Seq Scan on t3 t3_3
4569                Filter: (id = $3)
4570    ->  CTE Scan on c1_1
4571          Filter: (id = $3)
4572 (53 rows)
4573
4574 /*+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)*/
4575 EXPLAIN (COSTS false)
4576 WITH c1_1(id) AS (
4577 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
4578 )
4579 SELECT t1_1.id, (
4580 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
4581 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4582 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
4583 ) 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 = (
4584 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 
4585 );
4586 LOG:  pg_hint_plan:
4587 used hint:
4588 HashJoin(t1_1 t3_1)
4589 NestLoop(t1_2 t2_2)
4590 MergeJoin(t1_3 t3_3)
4591 NestLoop(t1_4 t2_4)
4592 NestLoop(t1_5 t2_5)
4593 not used hint:
4594 Leading(a t1_1 t1_2 t1_4 t1_5)
4595 duplication hint:
4596 error hint:
4597
4598                                QUERY PLAN                                
4599 -------------------------------------------------------------------------
4600  Nested Loop
4601    CTE c1_1
4602      ->  Aggregate
4603            ->  Merge Join
4604                  Merge Cond: (t1_5.id = t3_5.id)
4605                  ->  Nested Loop
4606                        ->  Index Scan using t2_pkey on t2 t2_5
4607                        ->  Index Scan using t1_pkey on t1 t1_5
4608                              Index Cond: (id = t2_5.id)
4609                  ->  Sort
4610                        Sort Key: t3_5.id
4611                        ->  Seq Scan on t3 t3_5
4612    InitPlan 2 (returns $2)
4613      ->  Aggregate
4614            ->  Merge Join
4615                  Merge Cond: (t1_2.id = t3_2.id)
4616                  ->  Nested Loop
4617                        ->  Index Scan using t2_pkey on t2 t2_2
4618                        ->  Index Scan using t1_pkey on t1 t1_2
4619                              Index Cond: (id = t2_2.id)
4620                  ->  Sort
4621                        Sort Key: t3_2.id
4622                        ->  Seq Scan on t3 t3_2
4623    InitPlan 3 (returns $3)
4624      ->  Aggregate
4625            ->  Merge Join
4626                  Merge Cond: (t1_4.id = t3_4.id)
4627                  ->  Nested Loop
4628                        ->  Index Scan using t2_pkey on t2 t2_4
4629                        ->  Index Scan using t1_pkey on t1 t1_4
4630                              Index Cond: (id = t2_4.id)
4631                  ->  Sort
4632                        Sort Key: t3_4.id
4633                        ->  Seq Scan on t3 t3_4
4634    ->  Nested Loop
4635          ->  Nested Loop
4636                ->  Nested Loop
4637                      ->  Nested Loop
4638                            ->  Nested Loop
4639                                  ->  Index Scan using t2_pkey on t2 t2_1
4640                                        Index Cond: (id = $3)
4641                                  ->  Seq Scan on t3 t3_1
4642                                        Filter: (id = $3)
4643                            ->  Index Scan using t1_pkey on t1 t1_1
4644                                  Index Cond: (id = $3)
4645                      ->  Index Scan using t1_pkey on t1 t1_3
4646                            Index Cond: (id = $3)
4647                ->  Index Scan using t2_pkey on t2 t2_3
4648                      Index Cond: (id = $3)
4649          ->  Seq Scan on t3 t3_3
4650                Filter: (id = $3)
4651    ->  CTE Scan on c1_1
4652          Filter: (id = $3)
4653 (53 rows)
4654
4655 /*+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)*/
4656 EXPLAIN (COSTS false)
4657 WITH c1_1(id) AS (
4658 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
4659 )
4660 SELECT t1_1.id, (
4661 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
4662 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4663 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
4664 ) 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 = (
4665 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 
4666 );
4667 LOG:  pg_hint_plan:
4668 used hint:
4669 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)
4670 not used hint:
4671 HashJoin(t1_1 t3_1)
4672 NestLoop(t1_2 t2_2)
4673 MergeJoin(t1_3 t3_3)
4674 NestLoop(t1_4 t2_4)
4675 NestLoop(t1_5 t2_5)
4676 duplication hint:
4677 error hint:
4678
4679                             QUERY PLAN                             
4680 -------------------------------------------------------------------
4681  Nested Loop
4682    CTE c1_1
4683      ->  Aggregate
4684            ->  Merge Join
4685                  Merge Cond: (t2_5.id = t1_5.id)
4686                  ->  Merge Join
4687                        Merge Cond: (t2_5.id = t3_5.id)
4688                        ->  Index Scan using t2_pkey on t2 t2_5
4689                        ->  Sort
4690                              Sort Key: t3_5.id
4691                              ->  Seq Scan on t3 t3_5
4692                  ->  Index Scan using t1_pkey on t1 t1_5
4693    InitPlan 2 (returns $1)
4694      ->  Aggregate
4695            ->  Merge Join
4696                  Merge Cond: (t2_2.id = t1_2.id)
4697                  ->  Merge Join
4698                        Merge Cond: (t2_2.id = t3_2.id)
4699                        ->  Index Scan using t2_pkey on t2 t2_2
4700                        ->  Sort
4701                              Sort Key: t3_2.id
4702                              ->  Seq Scan on t3 t3_2
4703                  ->  Index Scan using t1_pkey on t1 t1_2
4704    InitPlan 3 (returns $2)
4705      ->  Aggregate
4706            ->  Merge Join
4707                  Merge Cond: (t2_4.id = t1_4.id)
4708                  ->  Merge Join
4709                        Merge Cond: (t2_4.id = t3_4.id)
4710                        ->  Index Scan using t2_pkey on t2 t2_4
4711                        ->  Sort
4712                              Sort Key: t3_4.id
4713                              ->  Seq Scan on t3 t3_4
4714                  ->  Index Scan using t1_pkey on t1 t1_4
4715    ->  Nested Loop
4716          ->  Nested Loop
4717                ->  Nested Loop
4718                      ->  Nested Loop
4719                            ->  Nested Loop
4720                                  ->  Seq Scan on t3 t3_3
4721                                        Filter: (id = $2)
4722                                  ->  CTE Scan on c1_1
4723                                        Filter: (id = $2)
4724                            ->  Index Scan using t2_pkey on t2 t2_3
4725                                  Index Cond: (id = $2)
4726                      ->  Index Scan using t1_pkey on t1 t1_3
4727                            Index Cond: (id = $2)
4728                ->  Seq Scan on t3 t3_1
4729                      Filter: (id = $2)
4730          ->  Index Scan using t2_pkey on t2 t2_1
4731                Index Cond: (id = $2)
4732    ->  Index Scan using t1_pkey on t1 t1_1
4733          Index Cond: (id = $2)
4734 (53 rows)
4735
4736 SET from_collapse_limit TO 1;
4737 EXPLAIN (COSTS false)
4738 WITH c1_1(id) AS (
4739 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
4740 )
4741 SELECT t1_1.id, (
4742 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
4743 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4744 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
4745 ) 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 = (
4746 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 
4747 );
4748                           QUERY PLAN                           
4749 ---------------------------------------------------------------
4750  Nested Loop
4751    CTE c1_1
4752      ->  Aggregate
4753            ->  Merge Join
4754                  Merge Cond: (t1_5.id = t3_5.id)
4755                  ->  Merge Join
4756                        Merge Cond: (t1_5.id = t2_5.id)
4757                        ->  Index Scan using t1_pkey on t1 t1_5
4758                        ->  Index Scan using t2_pkey on t2 t2_5
4759                  ->  Sort
4760                        Sort Key: t3_5.id
4761                        ->  Seq Scan on t3 t3_5
4762    InitPlan 2 (returns $1)
4763      ->  Aggregate
4764            ->  Merge Join
4765                  Merge Cond: (t1_2.id = t3_2.id)
4766                  ->  Merge Join
4767                        Merge Cond: (t1_2.id = t2_2.id)
4768                        ->  Index Scan using t1_pkey on t1 t1_2
4769                        ->  Index Scan using t2_pkey on t2 t2_2
4770                  ->  Sort
4771                        Sort Key: t3_2.id
4772                        ->  Seq Scan on t3 t3_2
4773    InitPlan 3 (returns $2)
4774      ->  Aggregate
4775            ->  Merge Join
4776                  Merge Cond: (t1_4.id = t3_4.id)
4777                  ->  Merge Join
4778                        Merge Cond: (t1_4.id = t2_4.id)
4779                        ->  Index Scan using t1_pkey on t1 t1_4
4780                        ->  Index Scan using t2_pkey on t2 t2_4
4781                  ->  Sort
4782                        Sort Key: t3_4.id
4783                        ->  Seq Scan on t3 t3_4
4784    ->  Nested Loop
4785          ->  Nested Loop
4786                ->  Nested Loop
4787                      ->  Index Scan using t1_pkey on t1 t1_1
4788                            Index Cond: (id = $2)
4789                      ->  Seq Scan on t3 t3_1
4790                            Filter: (id = $2)
4791                ->  Index Scan using t2_pkey on t2 t2_1
4792                      Index Cond: (id = $2)
4793          ->  Nested Loop
4794                ->  Nested Loop
4795                      ->  Index Scan using t1_pkey on t1 t1_3
4796                            Index Cond: (id = $2)
4797                      ->  Seq Scan on t3 t3_3
4798                            Filter: (id = $2)
4799                ->  Index Scan using t2_pkey on t2 t2_3
4800                      Index Cond: (id = $2)
4801    ->  CTE Scan on c1_1
4802          Filter: (id = $2)
4803 (53 rows)
4804
4805 /*+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)*/
4806 EXPLAIN (COSTS false)
4807 WITH c1_1(id) AS (
4808 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
4809 )
4810 SELECT t1_1.id, (
4811 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
4812 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4813 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
4814 ) 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 = (
4815 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 
4816 );
4817 LOG:  pg_hint_plan:
4818 used hint:
4819 HashJoin(t1_1 t3_1)
4820 NestLoop(t1_2 t2_2)
4821 MergeJoin(t1_3 t3_3)
4822 NestLoop(t1_4 t2_4)
4823 NestLoop(t1_5 t2_5)
4824 not used hint:
4825 duplication hint:
4826 error hint:
4827
4828                           QUERY PLAN                           
4829 ---------------------------------------------------------------
4830  Nested Loop
4831    CTE c1_1
4832      ->  Aggregate
4833            ->  Merge Join
4834                  Merge Cond: (t1_5.id = t3_5.id)
4835                  ->  Nested Loop
4836                        ->  Index Scan using t2_pkey on t2 t2_5
4837                        ->  Index Scan using t1_pkey on t1 t1_5
4838                              Index Cond: (id = t2_5.id)
4839                  ->  Sort
4840                        Sort Key: t3_5.id
4841                        ->  Seq Scan on t3 t3_5
4842    InitPlan 2 (returns $2)
4843      ->  Aggregate
4844            ->  Merge Join
4845                  Merge Cond: (t1_2.id = t3_2.id)
4846                  ->  Nested Loop
4847                        ->  Index Scan using t2_pkey on t2 t2_2
4848                        ->  Index Scan using t1_pkey on t1 t1_2
4849                              Index Cond: (id = t2_2.id)
4850                  ->  Sort
4851                        Sort Key: t3_2.id
4852                        ->  Seq Scan on t3 t3_2
4853    InitPlan 3 (returns $3)
4854      ->  Aggregate
4855            ->  Merge Join
4856                  Merge Cond: (t1_4.id = t3_4.id)
4857                  ->  Nested Loop
4858                        ->  Index Scan using t2_pkey on t2 t2_4
4859                        ->  Index Scan using t1_pkey on t1 t1_4
4860                              Index Cond: (id = t2_4.id)
4861                  ->  Sort
4862                        Sort Key: t3_4.id
4863                        ->  Seq Scan on t3 t3_4
4864    ->  Nested Loop
4865          ->  Nested Loop
4866                ->  Nested Loop
4867                      ->  Index Scan using t2_pkey on t2 t2_1
4868                            Index Cond: (id = $3)
4869                      ->  Seq Scan on t3 t3_1
4870                            Filter: (id = $3)
4871                ->  Index Scan using t1_pkey on t1 t1_1
4872                      Index Cond: (id = $3)
4873          ->  Nested Loop
4874                ->  Nested Loop
4875                      ->  Index Scan using t2_pkey on t2 t2_3
4876                            Index Cond: (id = $3)
4877                      ->  Seq Scan on t3 t3_3
4878                            Filter: (id = $3)
4879                ->  Index Scan using t1_pkey on t1 t1_3
4880                      Index Cond: (id = $3)
4881    ->  CTE Scan on c1_1
4882          Filter: (id = $3)
4883 (53 rows)
4884
4885 /*+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)*/
4886 EXPLAIN (COSTS false)
4887 WITH c1_1(id) AS (
4888 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
4889 )
4890 SELECT t1_1.id, (
4891 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
4892 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4893 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
4894 ) 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 = (
4895 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 
4896 );
4897 LOG:  pg_hint_plan:
4898 used hint:
4899 HashJoin(t1_1 t3_1)
4900 NestLoop(t1_2 t2_2)
4901 MergeJoin(t1_3 t3_3)
4902 NestLoop(t1_4 t2_4)
4903 NestLoop(t1_5 t2_5)
4904 not used hint:
4905 Leading(a t1_1 t1_2 t1_4 t1_5)
4906 duplication hint:
4907 error hint:
4908
4909                           QUERY PLAN                           
4910 ---------------------------------------------------------------
4911  Nested Loop
4912    CTE c1_1
4913      ->  Aggregate
4914            ->  Merge Join
4915                  Merge Cond: (t1_5.id = t3_5.id)
4916                  ->  Nested Loop
4917                        ->  Index Scan using t2_pkey on t2 t2_5
4918                        ->  Index Scan using t1_pkey on t1 t1_5
4919                              Index Cond: (id = t2_5.id)
4920                  ->  Sort
4921                        Sort Key: t3_5.id
4922                        ->  Seq Scan on t3 t3_5
4923    InitPlan 2 (returns $2)
4924      ->  Aggregate
4925            ->  Merge Join
4926                  Merge Cond: (t1_2.id = t3_2.id)
4927                  ->  Nested Loop
4928                        ->  Index Scan using t2_pkey on t2 t2_2
4929                        ->  Index Scan using t1_pkey on t1 t1_2
4930                              Index Cond: (id = t2_2.id)
4931                  ->  Sort
4932                        Sort Key: t3_2.id
4933                        ->  Seq Scan on t3 t3_2
4934    InitPlan 3 (returns $3)
4935      ->  Aggregate
4936            ->  Merge Join
4937                  Merge Cond: (t1_4.id = t3_4.id)
4938                  ->  Nested Loop
4939                        ->  Index Scan using t2_pkey on t2 t2_4
4940                        ->  Index Scan using t1_pkey on t1 t1_4
4941                              Index Cond: (id = t2_4.id)
4942                  ->  Sort
4943                        Sort Key: t3_4.id
4944                        ->  Seq Scan on t3 t3_4
4945    ->  Nested Loop
4946          ->  Nested Loop
4947                ->  Nested Loop
4948                      ->  Index Scan using t2_pkey on t2 t2_1
4949                            Index Cond: (id = $3)
4950                      ->  Seq Scan on t3 t3_1
4951                            Filter: (id = $3)
4952                ->  Index Scan using t1_pkey on t1 t1_1
4953                      Index Cond: (id = $3)
4954          ->  Nested Loop
4955                ->  Nested Loop
4956                      ->  Index Scan using t2_pkey on t2 t2_3
4957                            Index Cond: (id = $3)
4958                      ->  Seq Scan on t3 t3_3
4959                            Filter: (id = $3)
4960                ->  Index Scan using t1_pkey on t1 t1_3
4961                      Index Cond: (id = $3)
4962    ->  CTE Scan on c1_1
4963          Filter: (id = $3)
4964 (53 rows)
4965
4966 /*+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)*/
4967 EXPLAIN (COSTS false)
4968 WITH c1_1(id) AS (
4969 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
4970 )
4971 SELECT t1_1.id, (
4972 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
4973 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4974 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
4975 ) 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 = (
4976 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 
4977 );
4978 LOG:  pg_hint_plan:
4979 used hint:
4980 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)
4981 not used hint:
4982 HashJoin(t1_1 t3_1)
4983 NestLoop(t1_2 t2_2)
4984 MergeJoin(t1_3 t3_3)
4985 NestLoop(t1_4 t2_4)
4986 NestLoop(t1_5 t2_5)
4987 duplication hint:
4988 error hint:
4989
4990                                QUERY PLAN                                
4991 -------------------------------------------------------------------------
4992  Nested Loop
4993    CTE c1_1
4994      ->  Aggregate
4995            ->  Merge Join
4996                  Merge Cond: (t2_5.id = t1_5.id)
4997                  ->  Merge Join
4998                        Merge Cond: (t2_5.id = t3_5.id)
4999                        ->  Index Scan using t2_pkey on t2 t2_5
5000                        ->  Sort
5001                              Sort Key: t3_5.id
5002                              ->  Seq Scan on t3 t3_5
5003                  ->  Index Scan using t1_pkey on t1 t1_5
5004    InitPlan 2 (returns $1)
5005      ->  Aggregate
5006            ->  Merge Join
5007                  Merge Cond: (t2_2.id = t1_2.id)
5008                  ->  Merge Join
5009                        Merge Cond: (t2_2.id = t3_2.id)
5010                        ->  Index Scan using t2_pkey on t2 t2_2
5011                        ->  Sort
5012                              Sort Key: t3_2.id
5013                              ->  Seq Scan on t3 t3_2
5014                  ->  Index Scan using t1_pkey on t1 t1_2
5015    InitPlan 3 (returns $2)
5016      ->  Aggregate
5017            ->  Merge Join
5018                  Merge Cond: (t2_4.id = t1_4.id)
5019                  ->  Merge Join
5020                        Merge Cond: (t2_4.id = t3_4.id)
5021                        ->  Index Scan using t2_pkey on t2 t2_4
5022                        ->  Sort
5023                              Sort Key: t3_4.id
5024                              ->  Seq Scan on t3 t3_4
5025                  ->  Index Scan using t1_pkey on t1 t1_4
5026    ->  Nested Loop
5027          ->  Nested Loop
5028                ->  Nested Loop
5029                      ->  Nested Loop
5030                            ->  Nested Loop
5031                                  ->  Index Scan using t2_pkey on t2 t2_3
5032                                        Index Cond: (id = $2)
5033                                  ->  Seq Scan on t3 t3_3
5034                                        Filter: (id = $2)
5035                            ->  Index Scan using t1_pkey on t1 t1_3
5036                                  Index Cond: (id = $2)
5037                      ->  CTE Scan on c1_1
5038                            Filter: (id = $2)
5039                ->  Seq Scan on t3 t3_1
5040                      Filter: (id = $2)
5041          ->  Index Scan using t2_pkey on t2 t2_1
5042                Index Cond: (id = $2)
5043    ->  Index Scan using t1_pkey on t1 t1_1
5044          Index Cond: (id = $2)
5045 (53 rows)
5046