OSDN Git Service

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