OSDN Git Service

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