OSDN Git Service

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