OSDN Git Service

Support PostgreSQL 9.6 RC1
[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    ->  Sort
3449          Sort Key: p1.id
3450          ->  Append
3451                ->  Seq Scan on p1
3452                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3453                ->  Seq Scan on p1_c1
3454                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3455                ->  Seq Scan on p1_c2
3456                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3457                ->  Seq Scan on p1_c3
3458                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3459                ->  Seq Scan on p1_c4
3460                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3461                ->  Seq Scan on p1_c1_c1
3462                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3463                ->  Seq Scan on p1_c1_c2
3464                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3465                ->  Seq Scan on p1_c3_c1
3466                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3467                ->  Seq Scan on p1_c3_c2
3468                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3469    ->  Index Scan using t1_pkey on t1
3470          Index Cond: (id < 10)
3471 (25 rows)
3472
3473 /*+BitmapScan(p1)*/
3474 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;
3475 LOG:  pg_hint_plan:
3476 used hint:
3477 BitmapScan(p1)
3478 not used hint:
3479 duplication hint:
3480 error hint:
3481
3482                                     QUERY PLAN                                     
3483 -----------------------------------------------------------------------------------
3484  Merge Join
3485    Merge Cond: (p1.id = t1.id)
3486    ->  Sort
3487          Sort Key: p1.id
3488          ->  Append
3489                ->  Seq Scan on p1
3490                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3491                ->  Seq Scan on p1_c1
3492                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3493                ->  Seq Scan on p1_c2
3494                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3495                ->  Seq Scan on p1_c3
3496                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3497                ->  Seq Scan on p1_c4
3498                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3499                ->  Seq Scan on p1_c1_c1
3500                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3501                ->  Seq Scan on p1_c1_c2
3502                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3503                ->  Seq Scan on p1_c3_c1
3504                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3505                ->  Seq Scan on p1_c3_c2
3506                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3507    ->  Index Scan using t1_pkey on t1
3508          Index Cond: (id < 10)
3509 (25 rows)
3510
3511 /*+TidScan(p1)*/
3512 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;
3513 LOG:  pg_hint_plan:
3514 used hint:
3515 TidScan(p1)
3516 not used hint:
3517 duplication hint:
3518 error hint:
3519
3520                                     QUERY PLAN                                     
3521 -----------------------------------------------------------------------------------
3522  Merge Join
3523    Merge Cond: (p1.id = t1.id)
3524    ->  Sort
3525          Sort Key: p1.id
3526          ->  Append
3527                ->  Seq Scan on p1
3528                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3529                ->  Seq Scan on p1_c1
3530                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3531                ->  Seq Scan on p1_c2
3532                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3533                ->  Seq Scan on p1_c3
3534                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3535                ->  Seq Scan on p1_c4
3536                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3537                ->  Seq Scan on p1_c1_c1
3538                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3539                ->  Seq Scan on p1_c1_c2
3540                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3541                ->  Seq Scan on p1_c3_c1
3542                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3543                ->  Seq Scan on p1_c3_c2
3544                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3545    ->  Index Scan using t1_pkey on t1
3546          Index Cond: (id < 10)
3547 (25 rows)
3548
3549 /*+NestLoop(p1 t1)*/
3550 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;
3551 LOG:  pg_hint_plan:
3552 used hint:
3553 NestLoop(p1 t1)
3554 not used hint:
3555 duplication hint:
3556 error hint:
3557
3558                                  QUERY PLAN                                  
3559 -----------------------------------------------------------------------------
3560  Nested Loop
3561    Join Filter: (p1.id = t1.id)
3562    ->  Append
3563          ->  Seq Scan on p1
3564                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3565          ->  Seq Scan on p1_c1
3566                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3567          ->  Seq Scan on p1_c2
3568                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3569          ->  Seq Scan on p1_c3
3570                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3571          ->  Seq Scan on p1_c4
3572                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3573          ->  Seq Scan on p1_c1_c1
3574                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3575          ->  Seq Scan on p1_c1_c2
3576                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3577          ->  Seq Scan on p1_c3_c1
3578                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3579          ->  Seq Scan on p1_c3_c2
3580                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3581    ->  Materialize
3582          ->  Index Scan using t1_pkey on t1
3583                Index Cond: (id < 10)
3584 (24 rows)
3585
3586 /*+MergeJoin(p1 t1)*/
3587 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;
3588 LOG:  pg_hint_plan:
3589 used hint:
3590 MergeJoin(p1 t1)
3591 not used hint:
3592 duplication hint:
3593 error hint:
3594
3595                                     QUERY PLAN                                     
3596 -----------------------------------------------------------------------------------
3597  Merge Join
3598    Merge Cond: (p1.id = t1.id)
3599    ->  Sort
3600          Sort Key: p1.id
3601          ->  Append
3602                ->  Seq Scan on p1
3603                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3604                ->  Seq Scan on p1_c1
3605                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3606                ->  Seq Scan on p1_c2
3607                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3608                ->  Seq Scan on p1_c3
3609                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3610                ->  Seq Scan on p1_c4
3611                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3612                ->  Seq Scan on p1_c1_c1
3613                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3614                ->  Seq Scan on p1_c1_c2
3615                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3616                ->  Seq Scan on p1_c3_c1
3617                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3618                ->  Seq Scan on p1_c3_c2
3619                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3620    ->  Index Scan using t1_pkey on t1
3621          Index Cond: (id < 10)
3622 (25 rows)
3623
3624 /*+HashJoin(p1 t1)*/
3625 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;
3626 LOG:  pg_hint_plan:
3627 used hint:
3628 HashJoin(p1 t1)
3629 not used hint:
3630 duplication hint:
3631 error hint:
3632
3633                                  QUERY PLAN                                  
3634 -----------------------------------------------------------------------------
3635  Hash Join
3636    Hash Cond: (p1.id = t1.id)
3637    ->  Append
3638          ->  Seq Scan on p1
3639                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3640          ->  Seq Scan on p1_c1
3641                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3642          ->  Seq Scan on p1_c2
3643                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3644          ->  Seq Scan on p1_c3
3645                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3646          ->  Seq Scan on p1_c4
3647                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3648          ->  Seq Scan on p1_c1_c1
3649                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3650          ->  Seq Scan on p1_c1_c2
3651                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3652          ->  Seq Scan on p1_c3_c1
3653                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3654          ->  Seq Scan on p1_c3_c2
3655                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3656    ->  Hash
3657          ->  Index Scan using t1_pkey on t1
3658                Index Cond: (id < 10)
3659 (24 rows)
3660
3661 SET constraint_exclusion TO on;
3662 /*+SeqScan(p1)*/
3663 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;
3664 LOG:  pg_hint_plan:
3665 used hint:
3666 SeqScan(p1)
3667 not used hint:
3668 duplication hint:
3669 error hint:
3670
3671                                     QUERY PLAN                                     
3672 -----------------------------------------------------------------------------------
3673  Merge Join
3674    Merge Cond: (p1.id = t1.id)
3675    ->  Sort
3676          Sort Key: p1.id
3677          ->  Append
3678                ->  Seq Scan on p1
3679                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3680                ->  Seq Scan on p1_c1
3681                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3682                ->  Seq Scan on p1_c1_c1
3683                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3684                ->  Seq Scan on p1_c1_c2
3685                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3686    ->  Index Scan using t1_pkey on t1
3687          Index Cond: (id < 10)
3688 (15 rows)
3689
3690 /*+IndexScan(p1)*/
3691 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;
3692 LOG:  pg_hint_plan:
3693 used hint:
3694 IndexScan(p1)
3695 not used hint:
3696 duplication hint:
3697 error hint:
3698
3699                                     QUERY PLAN                                     
3700 -----------------------------------------------------------------------------------
3701  Merge Join
3702    Merge Cond: (p1.id = t1.id)
3703    ->  Sort
3704          Sort Key: p1.id
3705          ->  Append
3706                ->  Seq Scan on p1
3707                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3708                ->  Seq Scan on p1_c1
3709                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3710                ->  Seq Scan on p1_c1_c1
3711                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3712                ->  Seq Scan on p1_c1_c2
3713                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3714    ->  Index Scan using t1_pkey on t1
3715          Index Cond: (id < 10)
3716 (15 rows)
3717
3718 /*+BitmapScan(p1)*/
3719 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;
3720 LOG:  pg_hint_plan:
3721 used hint:
3722 BitmapScan(p1)
3723 not used hint:
3724 duplication hint:
3725 error hint:
3726
3727                                     QUERY PLAN                                     
3728 -----------------------------------------------------------------------------------
3729  Merge Join
3730    Merge Cond: (p1.id = t1.id)
3731    ->  Sort
3732          Sort Key: p1.id
3733          ->  Append
3734                ->  Seq Scan on p1
3735                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3736                ->  Seq Scan on p1_c1
3737                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3738                ->  Seq Scan on p1_c1_c1
3739                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3740                ->  Seq Scan on p1_c1_c2
3741                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3742    ->  Index Scan using t1_pkey on t1
3743          Index Cond: (id < 10)
3744 (15 rows)
3745
3746 /*+TidScan(p1)*/
3747 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;
3748 LOG:  pg_hint_plan:
3749 used hint:
3750 TidScan(p1)
3751 not used hint:
3752 duplication hint:
3753 error hint:
3754
3755                                     QUERY PLAN                                     
3756 -----------------------------------------------------------------------------------
3757  Merge Join
3758    Merge Cond: (p1.id = t1.id)
3759    ->  Sort
3760          Sort Key: p1.id
3761          ->  Append
3762                ->  Seq Scan on p1
3763                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3764                ->  Seq Scan on p1_c1
3765                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3766                ->  Seq Scan on p1_c1_c1
3767                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3768                ->  Seq Scan on p1_c1_c2
3769                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3770    ->  Index Scan using t1_pkey on t1
3771          Index Cond: (id < 10)
3772 (15 rows)
3773
3774 /*+NestLoop(p1 t1)*/
3775 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
3776 LOG:  pg_hint_plan:
3777 used hint:
3778 NestLoop(p1 t1)
3779 not used hint:
3780 duplication hint:
3781 error hint:
3782
3783                                     QUERY PLAN                                     
3784 -----------------------------------------------------------------------------------
3785  Nested Loop
3786    Join Filter: (p1.id = t1.id)
3787    ->  Index Scan using t1_pkey on t1
3788          Index Cond: (id < 10)
3789    ->  Materialize
3790          ->  Append
3791                ->  Seq Scan on p1
3792                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3793                ->  Seq Scan on p1_c1
3794                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3795                ->  Seq Scan on p1_c1_c1
3796                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3797                ->  Seq Scan on p1_c1_c2
3798                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3799 (14 rows)
3800
3801 /*+MergeJoin(p1 t1)*/
3802 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;
3803 LOG:  pg_hint_plan:
3804 used hint:
3805 MergeJoin(p1 t1)
3806 not used hint:
3807 duplication hint:
3808 error hint:
3809
3810                                     QUERY PLAN                                     
3811 -----------------------------------------------------------------------------------
3812  Merge Join
3813    Merge Cond: (p1.id = t1.id)
3814    ->  Sort
3815          Sort Key: p1.id
3816          ->  Append
3817                ->  Seq Scan on p1
3818                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3819                ->  Seq Scan on p1_c1
3820                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3821                ->  Seq Scan on p1_c1_c1
3822                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3823                ->  Seq Scan on p1_c1_c2
3824                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3825    ->  Index Scan using t1_pkey on t1
3826          Index Cond: (id < 10)
3827 (15 rows)
3828
3829 /*+HashJoin(p1 t1)*/
3830 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;
3831 LOG:  pg_hint_plan:
3832 used hint:
3833 HashJoin(p1 t1)
3834 not used hint:
3835 duplication hint:
3836 error hint:
3837
3838                                     QUERY PLAN                                     
3839 -----------------------------------------------------------------------------------
3840  Hash Join
3841    Hash Cond: (t1.id = p1.id)
3842    ->  Index Scan using t1_pkey on t1
3843          Index Cond: (id < 10)
3844    ->  Hash
3845          ->  Append
3846                ->  Seq Scan on p1
3847                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3848                ->  Seq Scan on p1_c1
3849                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3850                ->  Seq Scan on p1_c1_c1
3851                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3852                ->  Seq Scan on p1_c1_c2
3853                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3854 (14 rows)
3855
3856 SET constraint_exclusion TO off;
3857 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3858                            QUERY PLAN                            
3859 -----------------------------------------------------------------
3860  Seq Scan on p1
3861    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3862 (2 rows)
3863
3864 SET constraint_exclusion TO on;
3865 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3866                            QUERY PLAN                            
3867 -----------------------------------------------------------------
3868  Seq Scan on p1
3869    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3870 (2 rows)
3871
3872 SET constraint_exclusion TO off;
3873 /*+SeqScan(p1)*/
3874 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3875 LOG:  pg_hint_plan:
3876 used hint:
3877 SeqScan(p1)
3878 not used hint:
3879 duplication hint:
3880 error hint:
3881
3882                            QUERY PLAN                            
3883 -----------------------------------------------------------------
3884  Seq Scan on p1
3885    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3886 (2 rows)
3887
3888 /*+IndexScan(p1)*/
3889 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3890 LOG:  pg_hint_plan:
3891 used hint:
3892 IndexScan(p1)
3893 not used hint:
3894 duplication hint:
3895 error hint:
3896
3897                 QUERY PLAN                 
3898 -------------------------------------------
3899  Index Scan using p1_pkey on p1
3900    Index Cond: ((id >= 50) AND (id <= 51))
3901    Filter: (ctid = '(1,1)'::tid)
3902 (3 rows)
3903
3904 /*+BitmapScan(p1)*/
3905 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3906 LOG:  pg_hint_plan:
3907 used hint:
3908 BitmapScan(p1)
3909 not used hint:
3910 duplication hint:
3911 error hint:
3912
3913                    QUERY PLAN                    
3914 -------------------------------------------------
3915  Bitmap Heap Scan on p1
3916    Recheck Cond: ((id >= 50) AND (id <= 51))
3917    Filter: (ctid = '(1,1)'::tid)
3918    ->  Bitmap Index Scan on p1_pkey
3919          Index Cond: ((id >= 50) AND (id <= 51))
3920 (5 rows)
3921
3922 /*+TidScan(p1)*/
3923 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
3924 LOG:  pg_hint_plan:
3925 used hint:
3926 TidScan(p1)
3927 not used hint:
3928 duplication hint:
3929 error hint:
3930
3931               QUERY PLAN               
3932 ---------------------------------------
3933  Tid Scan on p1
3934    TID Cond: (ctid = '(1,1)'::tid)
3935    Filter: ((id >= 50) AND (id <= 51))
3936 (3 rows)
3937
3938 /*+NestLoop(p1 t1)*/
3939 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;
3940 LOG:  pg_hint_plan:
3941 used hint:
3942 NestLoop(p1 t1)
3943 not used hint:
3944 duplication hint:
3945 error hint:
3946
3947                               QUERY PLAN                               
3948 -----------------------------------------------------------------------
3949  Nested Loop
3950    ->  Seq Scan on p1
3951          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3952    ->  Index Scan using t1_pkey on t1
3953          Index Cond: ((id = p1.id) AND (id < 10))
3954 (5 rows)
3955
3956 /*+MergeJoin(p1 t1)*/
3957 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;
3958 LOG:  pg_hint_plan:
3959 used hint:
3960 MergeJoin(p1 t1)
3961 not used hint:
3962 duplication hint:
3963 error hint:
3964
3965                                  QUERY PLAN                                  
3966 -----------------------------------------------------------------------------
3967  Merge Join
3968    Merge Cond: (p1.id = t1.id)
3969    ->  Sort
3970          Sort Key: p1.id
3971          ->  Seq Scan on p1
3972                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3973    ->  Index Scan using t1_pkey on t1
3974          Index Cond: (id < 10)
3975 (8 rows)
3976
3977 /*+HashJoin(p1 t1)*/
3978 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;
3979 LOG:  pg_hint_plan:
3980 used hint:
3981 HashJoin(p1 t1)
3982 not used hint:
3983 duplication hint:
3984 error hint:
3985
3986                                  QUERY PLAN                                  
3987 -----------------------------------------------------------------------------
3988  Hash Join
3989    Hash Cond: (t1.id = p1.id)
3990    ->  Index Scan using t1_pkey on t1
3991          Index Cond: (id < 10)
3992    ->  Hash
3993          ->  Seq Scan on p1
3994                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
3995 (7 rows)
3996
3997 SET constraint_exclusion TO on;
3998 /*+SeqScan(p1)*/
3999 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4000 LOG:  pg_hint_plan:
4001 used hint:
4002 SeqScan(p1)
4003 not used hint:
4004 duplication hint:
4005 error hint:
4006
4007                            QUERY PLAN                            
4008 -----------------------------------------------------------------
4009  Seq Scan on p1
4010    Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4011 (2 rows)
4012
4013 /*+IndexScan(p1)*/
4014 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4015 LOG:  pg_hint_plan:
4016 used hint:
4017 IndexScan(p1)
4018 not used hint:
4019 duplication hint:
4020 error hint:
4021
4022                 QUERY PLAN                 
4023 -------------------------------------------
4024  Index Scan using p1_pkey on p1
4025    Index Cond: ((id >= 50) AND (id <= 51))
4026    Filter: (ctid = '(1,1)'::tid)
4027 (3 rows)
4028
4029 /*+BitmapScan(p1)*/
4030 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4031 LOG:  pg_hint_plan:
4032 used hint:
4033 BitmapScan(p1)
4034 not used hint:
4035 duplication hint:
4036 error hint:
4037
4038                    QUERY PLAN                    
4039 -------------------------------------------------
4040  Bitmap Heap Scan on p1
4041    Recheck Cond: ((id >= 50) AND (id <= 51))
4042    Filter: (ctid = '(1,1)'::tid)
4043    ->  Bitmap Index Scan on p1_pkey
4044          Index Cond: ((id >= 50) AND (id <= 51))
4045 (5 rows)
4046
4047 /*+TidScan(p1)*/
4048 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
4049 LOG:  pg_hint_plan:
4050 used hint:
4051 TidScan(p1)
4052 not used hint:
4053 duplication hint:
4054 error hint:
4055
4056               QUERY PLAN               
4057 ---------------------------------------
4058  Tid Scan on p1
4059    TID Cond: (ctid = '(1,1)'::tid)
4060    Filter: ((id >= 50) AND (id <= 51))
4061 (3 rows)
4062
4063 /*+NestLoop(p1 t1)*/
4064 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;
4065 LOG:  pg_hint_plan:
4066 used hint:
4067 NestLoop(p1 t1)
4068 not used hint:
4069 duplication hint:
4070 error hint:
4071
4072                               QUERY PLAN                               
4073 -----------------------------------------------------------------------
4074  Nested Loop
4075    ->  Seq Scan on p1
4076          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4077    ->  Index Scan using t1_pkey on t1
4078          Index Cond: ((id = p1.id) AND (id < 10))
4079 (5 rows)
4080
4081 /*+MergeJoin(p1 t1)*/
4082 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;
4083 LOG:  pg_hint_plan:
4084 used hint:
4085 MergeJoin(p1 t1)
4086 not used hint:
4087 duplication hint:
4088 error hint:
4089
4090                                  QUERY PLAN                                  
4091 -----------------------------------------------------------------------------
4092  Merge Join
4093    Merge Cond: (p1.id = t1.id)
4094    ->  Sort
4095          Sort Key: p1.id
4096          ->  Seq Scan on p1
4097                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4098    ->  Index Scan using t1_pkey on t1
4099          Index Cond: (id < 10)
4100 (8 rows)
4101
4102 /*+HashJoin(p1 t1)*/
4103 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;
4104 LOG:  pg_hint_plan:
4105 used hint:
4106 HashJoin(p1 t1)
4107 not used hint:
4108 duplication hint:
4109 error hint:
4110
4111                                  QUERY PLAN                                  
4112 -----------------------------------------------------------------------------
4113  Hash Join
4114    Hash Cond: (t1.id = p1.id)
4115    ->  Index Scan using t1_pkey on t1
4116          Index Cond: (id < 10)
4117    ->  Hash
4118          ->  Seq Scan on p1
4119                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4120 (7 rows)
4121
4122 SET constraint_exclusion TO off;
4123 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;
4124                               QUERY PLAN                               
4125 -----------------------------------------------------------------------
4126  Nested Loop
4127    ->  Seq Scan on p1
4128          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4129    ->  Index Scan using t1_pkey on t1
4130          Index Cond: ((id = p1.id) AND (id < 10))
4131 (5 rows)
4132
4133 SET constraint_exclusion TO on;
4134 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;
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 SET constraint_exclusion TO off;
4145 /*+SeqScan(p1)*/
4146 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;
4147 LOG:  pg_hint_plan:
4148 used hint:
4149 SeqScan(p1)
4150 not used hint:
4151 duplication hint:
4152 error hint:
4153
4154                               QUERY PLAN                               
4155 -----------------------------------------------------------------------
4156  Nested Loop
4157    ->  Seq Scan on p1
4158          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4159    ->  Index Scan using t1_pkey on t1
4160          Index Cond: ((id = p1.id) AND (id < 10))
4161 (5 rows)
4162
4163 /*+IndexScan(p1)*/
4164 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;
4165 LOG:  pg_hint_plan:
4166 used hint:
4167 IndexScan(p1)
4168 not used hint:
4169 duplication hint:
4170 error hint:
4171
4172                     QUERY PLAN                    
4173 --------------------------------------------------
4174  Nested Loop
4175    ->  Index Scan using p1_pkey on p1
4176          Index Cond: ((id >= 50) AND (id <= 51))
4177          Filter: (ctid = '(1,1)'::tid)
4178    ->  Index Scan using t1_pkey on t1
4179          Index Cond: ((id = p1.id) AND (id < 10))
4180 (6 rows)
4181
4182 /*+BitmapScan(p1)*/
4183 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4184 LOG:  pg_hint_plan:
4185 used hint:
4186 BitmapScan(p1)
4187 not used hint:
4188 duplication hint:
4189 error hint:
4190
4191                       QUERY PLAN                       
4192 -------------------------------------------------------
4193  Nested Loop
4194    ->  Bitmap Heap Scan on p1
4195          Recheck Cond: ((id >= 50) AND (id <= 51))
4196          Filter: (ctid = '(1,1)'::tid)
4197          ->  Bitmap Index Scan on p1_pkey
4198                Index Cond: ((id >= 50) AND (id <= 51))
4199    ->  Index Scan using t1_pkey on t1
4200          Index Cond: ((id = p1.id) AND (id < 10))
4201 (8 rows)
4202
4203 /*+TidScan(p1)*/
4204 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;
4205 LOG:  pg_hint_plan:
4206 used hint:
4207 TidScan(p1)
4208 not used hint:
4209 duplication hint:
4210 error hint:
4211
4212                     QUERY PLAN                    
4213 --------------------------------------------------
4214  Nested Loop
4215    ->  Tid Scan on p1
4216          TID Cond: (ctid = '(1,1)'::tid)
4217          Filter: ((id >= 50) AND (id <= 51))
4218    ->  Index Scan using t1_pkey on t1
4219          Index Cond: ((id = p1.id) AND (id < 10))
4220 (6 rows)
4221
4222 SET constraint_exclusion TO on;
4223 /*+SeqScan(p1)*/
4224 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;
4225 LOG:  pg_hint_plan:
4226 used hint:
4227 SeqScan(p1)
4228 not used hint:
4229 duplication hint:
4230 error hint:
4231
4232                               QUERY PLAN                               
4233 -----------------------------------------------------------------------
4234  Nested Loop
4235    ->  Seq Scan on p1
4236          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
4237    ->  Index Scan using t1_pkey on t1
4238          Index Cond: ((id = p1.id) AND (id < 10))
4239 (5 rows)
4240
4241 /*+IndexScan(p1)*/
4242 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;
4243 LOG:  pg_hint_plan:
4244 used hint:
4245 IndexScan(p1)
4246 not used hint:
4247 duplication hint:
4248 error hint:
4249
4250                     QUERY PLAN                    
4251 --------------------------------------------------
4252  Nested Loop
4253    ->  Index Scan using p1_pkey on p1
4254          Index Cond: ((id >= 50) AND (id <= 51))
4255          Filter: (ctid = '(1,1)'::tid)
4256    ->  Index Scan using t1_pkey on t1
4257          Index Cond: ((id = p1.id) AND (id < 10))
4258 (6 rows)
4259
4260 /*+BitmapScan(p1)*/
4261 EXPLAIN (COSTS false) SELECT * FROM ONLY p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
4262 LOG:  pg_hint_plan:
4263 used hint:
4264 BitmapScan(p1)
4265 not used hint:
4266 duplication hint:
4267 error hint:
4268
4269                       QUERY PLAN                       
4270 -------------------------------------------------------
4271  Nested Loop
4272    ->  Bitmap Heap Scan on p1
4273          Recheck Cond: ((id >= 50) AND (id <= 51))
4274          Filter: (ctid = '(1,1)'::tid)
4275          ->  Bitmap Index Scan on p1_pkey
4276                Index Cond: ((id >= 50) AND (id <= 51))
4277    ->  Index Scan using t1_pkey on t1
4278          Index Cond: ((id = p1.id) AND (id < 10))
4279 (8 rows)
4280
4281 /*+TidScan(p1)*/
4282 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;
4283 LOG:  pg_hint_plan:
4284 used hint:
4285 TidScan(p1)
4286 not used hint:
4287 duplication hint:
4288 error hint:
4289
4290                     QUERY PLAN                    
4291 --------------------------------------------------
4292  Nested Loop
4293    ->  Tid Scan on p1
4294          TID Cond: (ctid = '(1,1)'::tid)
4295          Filter: ((id >= 50) AND (id <= 51))
4296    ->  Index Scan using t1_pkey on t1
4297          Index Cond: ((id = p1.id) AND (id < 10))
4298 (6 rows)
4299
4300 -- quote test
4301 /*+SeqScan("""t1 )      ")IndexScan("t  2 """)HashJoin("""t1 )  "T3"t   2 """)Leading("""t1 )   "T3"t   2 """)Set(application_name"a    a       a""     a       A")*/
4302 EXPLAIN (COSTS false) SELECT * FROM t1 """t1 )  ", t2 "t        2 """, t3 "T3" WHERE """t1 )    ".id = "t       2 """.id AND """t1 )    ".id = "T3".id;
4303 LOG:  pg_hint_plan:
4304 used hint:
4305 SeqScan("""t1 ) ")
4306 IndexScan("t    2 """)
4307 HashJoin("""t1 )        " T3 "t 2 """)
4308 Leading("""t1 ) " T3 "t 2 """)
4309 Set(application_name "a a       a""     a       A")
4310 not used hint:
4311 duplication hint:
4312 error hint:
4313
4314                        QUERY PLAN                        
4315 ---------------------------------------------------------
4316  Hash Join
4317    Hash Cond: ("t        2 """.id = """t1 )      ".id)
4318    ->  Index Scan using t2_pkey on t2 "t 2 """
4319    ->  Hash
4320          ->  Hash Join
4321                Hash Cond: ("""t1 )       ".id = "T3".id)
4322                ->  Seq Scan on t1 """t1 )        "
4323                ->  Hash
4324                      ->  Seq Scan on t3 "T3"
4325 (9 rows)
4326
4327 -- duplicate hint test
4328 /*+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)*/
4329 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
4330 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)"
4331 DETAIL:  Conflict scan method hint.
4332 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)"
4333 DETAIL:  Conflict scan method hint.
4334 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)"
4335 DETAIL:  Conflict scan method hint.
4336 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)"
4337 DETAIL:  Conflict scan method hint.
4338 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)"
4339 DETAIL:  Conflict scan method hint.
4340 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)"
4341 DETAIL:  Conflict scan method hint.
4342 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)"
4343 DETAIL:  Conflict join method hint.
4344 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)"
4345 DETAIL:  Conflict join method hint.
4346 INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
4347 DETAIL:  Conflict set hint.
4348 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)"
4349 DETAIL:  Conflict leading hint.
4350 LOG:  pg_hint_plan:
4351 used hint:
4352 TidScan(t1)
4353 TidScan(t2)
4354 MergeJoin(t1 t2)
4355 Leading(t2 t1)
4356 Set(enable_mergejoin on)
4357 Set(enable_seqscan on)
4358 not used hint:
4359 duplication hint:
4360 SeqScan(t1)
4361 IndexScan(t1)
4362 BitmapScan(t1)
4363 SeqScan(t2)
4364 IndexScan(t2)
4365 BitmapScan(t2)
4366 HashJoin(t1 t2)
4367 NestLoop(t1 t2)
4368 Leading(t1 t2)
4369 Set(enable_seqscan off)
4370 error hint:
4371
4372                   QUERY PLAN                   
4373 -----------------------------------------------
4374  Merge Join
4375    Merge Cond: (t1.id = t2.id)
4376    ->  Sort
4377          Sort Key: t1.id
4378          ->  Tid Scan on t1
4379                TID Cond: (ctid = '(1,1)'::tid)
4380    ->  Sort
4381          Sort Key: t2.id
4382          ->  Tid Scan on t2
4383                TID Cond: (ctid = '(1,1)'::tid)
4384 (10 rows)
4385
4386 -- sub query Leading hint test
4387 SET from_collapse_limit TO 100;
4388 SET geqo_threshold TO 100;
4389 EXPLAIN (COSTS false)
4390 WITH c1_1(id) AS (
4391 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
4392 )
4393 SELECT t1_1.id, (
4394 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
4395 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4396 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
4397 ) 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 = (
4398 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 
4399 );
4400                                   QUERY PLAN                                  
4401 ------------------------------------------------------------------------------
4402  Nested Loop
4403    CTE c1_1
4404      ->  Aggregate
4405            ->  Merge Join
4406                  Merge Cond: (t1_5.id = t3_5.id)
4407                  ->  Merge Join
4408                        Merge Cond: (t1_5.id = t2_5.id)
4409                        ->  Index Only Scan using t1_pkey on t1 t1_5
4410                        ->  Index Only Scan using t2_pkey on t2 t2_5
4411                  ->  Sort
4412                        Sort Key: t3_5.id
4413                        ->  Seq Scan on t3 t3_5
4414    InitPlan 2 (returns $1)
4415      ->  Aggregate
4416            ->  Merge Join
4417                  Merge Cond: (t1_2.id = t3_2.id)
4418                  ->  Merge Join
4419                        Merge Cond: (t1_2.id = t2_2.id)
4420                        ->  Index Only Scan using t1_pkey on t1 t1_2
4421                        ->  Index Only Scan using t2_pkey on t2 t2_2
4422                  ->  Sort
4423                        Sort Key: t3_2.id
4424                        ->  Seq Scan on t3 t3_2
4425    InitPlan 3 (returns $2)
4426      ->  Aggregate
4427            ->  Merge Join
4428                  Merge Cond: (t1_4.id = t3_4.id)
4429                  ->  Merge Join
4430                        Merge Cond: (t1_4.id = t2_4.id)
4431                        ->  Index Only Scan using t1_pkey on t1 t1_4
4432                        ->  Index Only Scan using t2_pkey on t2 t2_4
4433                  ->  Sort
4434                        Sort Key: t3_4.id
4435                        ->  Seq Scan on t3 t3_4
4436    ->  Nested Loop
4437          ->  Nested Loop
4438                ->  Nested Loop
4439                      ->  Nested Loop
4440                            ->  Nested Loop
4441                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4442                                        Index Cond: (id = $2)
4443                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4444                                        Index Cond: (id = $2)
4445                            ->  Seq Scan on t3 t3_1
4446                                  Filter: (id = $2)
4447                      ->  Index Only Scan using t1_pkey on t1 t1_3
4448                            Index Cond: (id = $2)
4449                ->  Index Only Scan using t2_pkey on t2 t2_3
4450                      Index Cond: (id = $2)
4451          ->  Seq Scan on t3 t3_3
4452                Filter: (id = $2)
4453    ->  CTE Scan on c1_1
4454          Filter: (id = $2)
4455 (53 rows)
4456
4457 /*+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)*/
4458 EXPLAIN (COSTS false)
4459 WITH c1_1(id) AS (
4460 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
4461 )
4462 SELECT t1_1.id, (
4463 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
4464 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4465 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
4466 ) 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 = (
4467 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 
4468 );
4469 LOG:  pg_hint_plan:
4470 used hint:
4471 HashJoin(t1_1 t3_1)
4472 NestLoop(t1_2 t2_2)
4473 MergeJoin(t1_3 t3_3)
4474 NestLoop(t1_4 t2_4)
4475 NestLoop(t1_5 t2_5)
4476 not used hint:
4477 duplication hint:
4478 error hint:
4479
4480                                   QUERY PLAN                                  
4481 ------------------------------------------------------------------------------
4482  Nested Loop
4483    CTE c1_1
4484      ->  Aggregate
4485            ->  Merge Join
4486                  Merge Cond: (t1_5.id = t3_5.id)
4487                  ->  Nested Loop
4488                        ->  Index Only Scan using t2_pkey on t2 t2_5
4489                        ->  Index Only Scan using t1_pkey on t1 t1_5
4490                              Index Cond: (id = t2_5.id)
4491                  ->  Sort
4492                        Sort Key: t3_5.id
4493                        ->  Seq Scan on t3 t3_5
4494    InitPlan 2 (returns $3)
4495      ->  Aggregate
4496            ->  Merge Join
4497                  Merge Cond: (t1_2.id = t3_2.id)
4498                  ->  Nested Loop
4499                        ->  Index Only Scan using t2_pkey on t2 t2_2
4500                        ->  Index Only Scan using t1_pkey on t1 t1_2
4501                              Index Cond: (id = t2_2.id)
4502                  ->  Sort
4503                        Sort Key: t3_2.id
4504                        ->  Seq Scan on t3 t3_2
4505    InitPlan 3 (returns $5)
4506      ->  Aggregate
4507            ->  Merge Join
4508                  Merge Cond: (t1_4.id = t3_4.id)
4509                  ->  Nested Loop
4510                        ->  Index Only Scan using t2_pkey on t2 t2_4
4511                        ->  Index Only Scan using t1_pkey on t1 t1_4
4512                              Index Cond: (id = t2_4.id)
4513                  ->  Sort
4514                        Sort Key: t3_4.id
4515                        ->  Seq Scan on t3 t3_4
4516    ->  Nested Loop
4517          ->  Nested Loop
4518                ->  Nested Loop
4519                      ->  Nested Loop
4520                            ->  Nested Loop
4521                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4522                                        Index Cond: (id = $5)
4523                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4524                                        Index Cond: (id = $5)
4525                            ->  Seq Scan on t3 t3_1
4526                                  Filter: (id = $5)
4527                      ->  Index Only Scan using t1_pkey on t1 t1_3
4528                            Index Cond: (id = $5)
4529                ->  Index Only Scan using t2_pkey on t2 t2_3
4530                      Index Cond: (id = $5)
4531          ->  Seq Scan on t3 t3_3
4532                Filter: (id = $5)
4533    ->  CTE Scan on c1_1
4534          Filter: (id = $5)
4535 (53 rows)
4536
4537 /*+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)*/
4538 EXPLAIN (COSTS false)
4539 WITH c1_1(id) AS (
4540 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
4541 )
4542 SELECT t1_1.id, (
4543 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
4544 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4545 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
4546 ) 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 = (
4547 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 
4548 );
4549 LOG:  pg_hint_plan:
4550 used hint:
4551 HashJoin(t1_1 t3_1)
4552 NestLoop(t1_2 t2_2)
4553 MergeJoin(t1_3 t3_3)
4554 NestLoop(t1_4 t2_4)
4555 NestLoop(t1_5 t2_5)
4556 not used hint:
4557 Leading(a t1_1 t1_2 t1_4 t1_5)
4558 duplication hint:
4559 error hint:
4560
4561                                   QUERY PLAN                                  
4562 ------------------------------------------------------------------------------
4563  Nested Loop
4564    CTE c1_1
4565      ->  Aggregate
4566            ->  Merge Join
4567                  Merge Cond: (t1_5.id = t3_5.id)
4568                  ->  Nested Loop
4569                        ->  Index Only Scan using t2_pkey on t2 t2_5
4570                        ->  Index Only Scan using t1_pkey on t1 t1_5
4571                              Index Cond: (id = t2_5.id)
4572                  ->  Sort
4573                        Sort Key: t3_5.id
4574                        ->  Seq Scan on t3 t3_5
4575    InitPlan 2 (returns $3)
4576      ->  Aggregate
4577            ->  Merge Join
4578                  Merge Cond: (t1_2.id = t3_2.id)
4579                  ->  Nested Loop
4580                        ->  Index Only Scan using t2_pkey on t2 t2_2
4581                        ->  Index Only Scan using t1_pkey on t1 t1_2
4582                              Index Cond: (id = t2_2.id)
4583                  ->  Sort
4584                        Sort Key: t3_2.id
4585                        ->  Seq Scan on t3 t3_2
4586    InitPlan 3 (returns $5)
4587      ->  Aggregate
4588            ->  Merge Join
4589                  Merge Cond: (t1_4.id = t3_4.id)
4590                  ->  Nested Loop
4591                        ->  Index Only Scan using t2_pkey on t2 t2_4
4592                        ->  Index Only Scan using t1_pkey on t1 t1_4
4593                              Index Cond: (id = t2_4.id)
4594                  ->  Sort
4595                        Sort Key: t3_4.id
4596                        ->  Seq Scan on t3 t3_4
4597    ->  Nested Loop
4598          ->  Nested Loop
4599                ->  Nested Loop
4600                      ->  Nested Loop
4601                            ->  Nested Loop
4602                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4603                                        Index Cond: (id = $5)
4604                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4605                                        Index Cond: (id = $5)
4606                            ->  Seq Scan on t3 t3_1
4607                                  Filter: (id = $5)
4608                      ->  Index Only Scan using t1_pkey on t1 t1_3
4609                            Index Cond: (id = $5)
4610                ->  Index Only Scan using t2_pkey on t2 t2_3
4611                      Index Cond: (id = $5)
4612          ->  Seq Scan on t3 t3_3
4613                Filter: (id = $5)
4614    ->  CTE Scan on c1_1
4615          Filter: (id = $5)
4616 (53 rows)
4617
4618 /*+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)*/
4619 EXPLAIN (COSTS false)
4620 WITH c1_1(id) AS (
4621 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
4622 )
4623 SELECT t1_1.id, (
4624 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
4625 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4626 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
4627 ) 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 = (
4628 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 
4629 );
4630 LOG:  pg_hint_plan:
4631 used hint:
4632 HashJoin(t1_1 t3_1)
4633 NestLoop(t1_2 t2_2)
4634 MergeJoin(t1_3 t3_3)
4635 NestLoop(t1_4 t2_4)
4636 NestLoop(t1_5 t2_5)
4637 not used hint:
4638 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)
4639 duplication hint:
4640 error hint:
4641
4642                                   QUERY PLAN                                  
4643 ------------------------------------------------------------------------------
4644  Nested Loop
4645    CTE c1_1
4646      ->  Aggregate
4647            ->  Merge Join
4648                  Merge Cond: (t1_5.id = t3_5.id)
4649                  ->  Nested Loop
4650                        ->  Index Only Scan using t2_pkey on t2 t2_5
4651                        ->  Index Only Scan using t1_pkey on t1 t1_5
4652                              Index Cond: (id = t2_5.id)
4653                  ->  Sort
4654                        Sort Key: t3_5.id
4655                        ->  Seq Scan on t3 t3_5
4656    InitPlan 2 (returns $3)
4657      ->  Aggregate
4658            ->  Merge Join
4659                  Merge Cond: (t1_2.id = t3_2.id)
4660                  ->  Nested Loop
4661                        ->  Index Only Scan using t2_pkey on t2 t2_2
4662                        ->  Index Only Scan using t1_pkey on t1 t1_2
4663                              Index Cond: (id = t2_2.id)
4664                  ->  Sort
4665                        Sort Key: t3_2.id
4666                        ->  Seq Scan on t3 t3_2
4667    InitPlan 3 (returns $5)
4668      ->  Aggregate
4669            ->  Merge Join
4670                  Merge Cond: (t1_4.id = t3_4.id)
4671                  ->  Nested Loop
4672                        ->  Index Only Scan using t2_pkey on t2 t2_4
4673                        ->  Index Only Scan using t1_pkey on t1 t1_4
4674                              Index Cond: (id = t2_4.id)
4675                  ->  Sort
4676                        Sort Key: t3_4.id
4677                        ->  Seq Scan on t3 t3_4
4678    ->  Nested Loop
4679          ->  Nested Loop
4680                ->  Nested Loop
4681                      ->  Nested Loop
4682                            ->  Nested Loop
4683                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4684                                        Index Cond: (id = $5)
4685                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4686                                        Index Cond: (id = $5)
4687                            ->  Seq Scan on t3 t3_1
4688                                  Filter: (id = $5)
4689                      ->  Index Only Scan using t1_pkey on t1 t1_3
4690                            Index Cond: (id = $5)
4691                ->  Index Only Scan using t2_pkey on t2 t2_3
4692                      Index Cond: (id = $5)
4693          ->  Seq Scan on t3 t3_3
4694                Filter: (id = $5)
4695    ->  CTE Scan on c1_1
4696          Filter: (id = $5)
4697 (53 rows)
4698
4699 /*+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)*/
4700 EXPLAIN (COSTS false)
4701 WITH c1_1(id) AS (
4702 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
4703 )
4704 SELECT t1_1.id, (
4705 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
4706 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4707 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
4708 ) 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 = (
4709 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 
4710 );
4711 LOG:  pg_hint_plan:
4712 used hint:
4713 Leading(t3_5 t2_5 t1_5)
4714 Leading(t3_2 t2_2 t1_2)
4715 Leading(t3_4 t2_4 t1_4)
4716 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
4717 not used hint:
4718 HashJoin(t1_1 t3_1)
4719 NestLoop(t1_2 t2_2)
4720 MergeJoin(t1_3 t3_3)
4721 NestLoop(t1_4 t2_4)
4722 NestLoop(t1_5 t2_5)
4723 duplication hint:
4724 error hint:
4725
4726                                QUERY PLAN                               
4727 ------------------------------------------------------------------------
4728  Nested Loop
4729    CTE c1_1
4730      ->  Aggregate
4731            ->  Merge Join
4732                  Merge Cond: (t2_5.id = t1_5.id)
4733                  ->  Merge Join
4734                        Merge Cond: (t2_5.id = t3_5.id)
4735                        ->  Index Only Scan using t2_pkey on t2 t2_5
4736                        ->  Sort
4737                              Sort Key: t3_5.id
4738                              ->  Seq Scan on t3 t3_5
4739                  ->  Index Only Scan using t1_pkey on t1 t1_5
4740    InitPlan 2 (returns $1)
4741      ->  Aggregate
4742            ->  Merge Join
4743                  Merge Cond: (t2_2.id = t1_2.id)
4744                  ->  Merge Join
4745                        Merge Cond: (t2_2.id = t3_2.id)
4746                        ->  Index Only Scan using t2_pkey on t2 t2_2
4747                        ->  Sort
4748                              Sort Key: t3_2.id
4749                              ->  Seq Scan on t3 t3_2
4750                  ->  Index Only Scan using t1_pkey on t1 t1_2
4751    InitPlan 3 (returns $2)
4752      ->  Aggregate
4753            ->  Merge Join
4754                  Merge Cond: (t2_4.id = t1_4.id)
4755                  ->  Merge Join
4756                        Merge Cond: (t2_4.id = t3_4.id)
4757                        ->  Index Only Scan using t2_pkey on t2 t2_4
4758                        ->  Sort
4759                              Sort Key: t3_4.id
4760                              ->  Seq Scan on t3 t3_4
4761                  ->  Index Only Scan using t1_pkey on t1 t1_4
4762    ->  Nested Loop
4763          ->  Nested Loop
4764                ->  Nested Loop
4765                      ->  Nested Loop
4766                            ->  Nested Loop
4767                                  ->  Seq Scan on t3 t3_3
4768                                        Filter: (id = $2)
4769                                  ->  CTE Scan on c1_1
4770                                        Filter: (id = $2)
4771                            ->  Index Only Scan using t2_pkey on t2 t2_3
4772                                  Index Cond: (id = $2)
4773                      ->  Index Only Scan using t1_pkey on t1 t1_3
4774                            Index Cond: (id = $2)
4775                ->  Seq Scan on t3 t3_1
4776                      Filter: (id = $2)
4777          ->  Index Only Scan using t2_pkey on t2 t2_1
4778                Index Cond: (id = $2)
4779    ->  Index Only Scan using t1_pkey on t1 t1_1
4780          Index Cond: (id = $2)
4781 (53 rows)
4782
4783 SET from_collapse_limit TO 1;
4784 EXPLAIN (COSTS false)
4785 WITH c1_1(id) AS (
4786 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
4787 )
4788 SELECT t1_1.id, (
4789 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
4790 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4791 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
4792 ) 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 = (
4793 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 
4794 );
4795                              QUERY PLAN                             
4796 --------------------------------------------------------------------
4797  Nested Loop
4798    CTE c1_1
4799      ->  Aggregate
4800            ->  Merge Join
4801                  Merge Cond: (t1_5.id = t3_5.id)
4802                  ->  Merge Join
4803                        Merge Cond: (t1_5.id = t2_5.id)
4804                        ->  Index Only Scan using t1_pkey on t1 t1_5
4805                        ->  Index Only Scan using t2_pkey on t2 t2_5
4806                  ->  Sort
4807                        Sort Key: t3_5.id
4808                        ->  Seq Scan on t3 t3_5
4809    InitPlan 2 (returns $1)
4810      ->  Aggregate
4811            ->  Merge Join
4812                  Merge Cond: (t1_2.id = t3_2.id)
4813                  ->  Merge Join
4814                        Merge Cond: (t1_2.id = t2_2.id)
4815                        ->  Index Only Scan using t1_pkey on t1 t1_2
4816                        ->  Index Only Scan using t2_pkey on t2 t2_2
4817                  ->  Sort
4818                        Sort Key: t3_2.id
4819                        ->  Seq Scan on t3 t3_2
4820    InitPlan 3 (returns $2)
4821      ->  Aggregate
4822            ->  Merge Join
4823                  Merge Cond: (t1_4.id = t3_4.id)
4824                  ->  Merge Join
4825                        Merge Cond: (t1_4.id = t2_4.id)
4826                        ->  Index Only Scan using t1_pkey on t1 t1_4
4827                        ->  Index Only Scan using t2_pkey on t2 t2_4
4828                  ->  Sort
4829                        Sort Key: t3_4.id
4830                        ->  Seq Scan on t3 t3_4
4831    ->  Nested Loop
4832          ->  Nested Loop
4833                ->  Nested Loop
4834                      ->  Index Only Scan using t1_pkey on t1 t1_1
4835                            Index Cond: (id = $2)
4836                      ->  Index Only Scan using t2_pkey on t2 t2_1
4837                            Index Cond: (id = $2)
4838                ->  Seq Scan on t3 t3_1
4839                      Filter: (id = $2)
4840          ->  Nested Loop
4841                ->  Nested Loop
4842                      ->  Index Only Scan using t1_pkey on t1 t1_3
4843                            Index Cond: (id = $2)
4844                      ->  Index Only Scan using t2_pkey on t2 t2_3
4845                            Index Cond: (id = $2)
4846                ->  Seq Scan on t3 t3_3
4847                      Filter: (id = $2)
4848    ->  CTE Scan on c1_1
4849          Filter: (id = $2)
4850 (53 rows)
4851
4852 /*+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)*/
4853 EXPLAIN (COSTS false)
4854 WITH c1_1(id) AS (
4855 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
4856 )
4857 SELECT t1_1.id, (
4858 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
4859 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4860 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
4861 ) 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 = (
4862 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 
4863 );
4864 LOG:  pg_hint_plan:
4865 used hint:
4866 HashJoin(t1_1 t3_1)
4867 NestLoop(t1_2 t2_2)
4868 MergeJoin(t1_3 t3_3)
4869 NestLoop(t1_4 t2_4)
4870 NestLoop(t1_5 t2_5)
4871 not used hint:
4872 duplication hint:
4873 error hint:
4874
4875                              QUERY PLAN                             
4876 --------------------------------------------------------------------
4877  Nested Loop
4878    CTE c1_1
4879      ->  Aggregate
4880            ->  Merge Join
4881                  Merge Cond: (t1_5.id = t3_5.id)
4882                  ->  Nested Loop
4883                        ->  Index Only Scan using t2_pkey on t2 t2_5
4884                        ->  Index Only Scan using t1_pkey on t1 t1_5
4885                              Index Cond: (id = t2_5.id)
4886                  ->  Sort
4887                        Sort Key: t3_5.id
4888                        ->  Seq Scan on t3 t3_5
4889    InitPlan 2 (returns $3)
4890      ->  Aggregate
4891            ->  Merge Join
4892                  Merge Cond: (t1_2.id = t3_2.id)
4893                  ->  Nested Loop
4894                        ->  Index Only Scan using t2_pkey on t2 t2_2
4895                        ->  Index Only Scan using t1_pkey on t1 t1_2
4896                              Index Cond: (id = t2_2.id)
4897                  ->  Sort
4898                        Sort Key: t3_2.id
4899                        ->  Seq Scan on t3 t3_2
4900    InitPlan 3 (returns $5)
4901      ->  Aggregate
4902            ->  Merge Join
4903                  Merge Cond: (t1_4.id = t3_4.id)
4904                  ->  Nested Loop
4905                        ->  Index Only Scan using t2_pkey on t2 t2_4
4906                        ->  Index Only Scan using t1_pkey on t1 t1_4
4907                              Index Cond: (id = t2_4.id)
4908                  ->  Sort
4909                        Sort Key: t3_4.id
4910                        ->  Seq Scan on t3 t3_4
4911    ->  Nested Loop
4912          ->  Nested Loop
4913                ->  Nested Loop
4914                      ->  Index Only Scan using t1_pkey on t1 t1_1
4915                            Index Cond: (id = $5)
4916                      ->  Index Only Scan using t2_pkey on t2 t2_1
4917                            Index Cond: (id = $5)
4918                ->  Seq Scan on t3 t3_1
4919                      Filter: (id = $5)
4920          ->  Nested Loop
4921                ->  Nested Loop
4922                      ->  Index Only Scan using t1_pkey on t1 t1_3
4923                            Index Cond: (id = $5)
4924                      ->  Index Only Scan using t2_pkey on t2 t2_3
4925                            Index Cond: (id = $5)
4926                ->  Seq Scan on t3 t3_3
4927                      Filter: (id = $5)
4928    ->  CTE Scan on c1_1
4929          Filter: (id = $5)
4930 (53 rows)
4931
4932 /*+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)*/
4933 EXPLAIN (COSTS false)
4934 WITH c1_1(id) AS (
4935 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
4936 )
4937 SELECT t1_1.id, (
4938 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
4939 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4940 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
4941 ) 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 = (
4942 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 
4943 );
4944 LOG:  pg_hint_plan:
4945 used hint:
4946 HashJoin(t1_1 t3_1)
4947 NestLoop(t1_2 t2_2)
4948 MergeJoin(t1_3 t3_3)
4949 NestLoop(t1_4 t2_4)
4950 NestLoop(t1_5 t2_5)
4951 not used hint:
4952 Leading(a t1_1 t1_2 t1_4 t1_5)
4953 duplication hint:
4954 error hint:
4955
4956                              QUERY PLAN                             
4957 --------------------------------------------------------------------
4958  Nested Loop
4959    CTE c1_1
4960      ->  Aggregate
4961            ->  Merge Join
4962                  Merge Cond: (t1_5.id = t3_5.id)
4963                  ->  Nested Loop
4964                        ->  Index Only Scan using t2_pkey on t2 t2_5
4965                        ->  Index Only Scan using t1_pkey on t1 t1_5
4966                              Index Cond: (id = t2_5.id)
4967                  ->  Sort
4968                        Sort Key: t3_5.id
4969                        ->  Seq Scan on t3 t3_5
4970    InitPlan 2 (returns $3)
4971      ->  Aggregate
4972            ->  Merge Join
4973                  Merge Cond: (t1_2.id = t3_2.id)
4974                  ->  Nested Loop
4975                        ->  Index Only Scan using t2_pkey on t2 t2_2
4976                        ->  Index Only Scan using t1_pkey on t1 t1_2
4977                              Index Cond: (id = t2_2.id)
4978                  ->  Sort
4979                        Sort Key: t3_2.id
4980                        ->  Seq Scan on t3 t3_2
4981    InitPlan 3 (returns $5)
4982      ->  Aggregate
4983            ->  Merge Join
4984                  Merge Cond: (t1_4.id = t3_4.id)
4985                  ->  Nested Loop
4986                        ->  Index Only Scan using t2_pkey on t2 t2_4
4987                        ->  Index Only Scan using t1_pkey on t1 t1_4
4988                              Index Cond: (id = t2_4.id)
4989                  ->  Sort
4990                        Sort Key: t3_4.id
4991                        ->  Seq Scan on t3 t3_4
4992    ->  Nested Loop
4993          ->  Nested Loop
4994                ->  Nested Loop
4995                      ->  Index Only Scan using t1_pkey on t1 t1_1
4996                            Index Cond: (id = $5)
4997                      ->  Index Only Scan using t2_pkey on t2 t2_1
4998                            Index Cond: (id = $5)
4999                ->  Seq Scan on t3 t3_1
5000                      Filter: (id = $5)
5001          ->  Nested Loop
5002                ->  Nested Loop
5003                      ->  Index Only Scan using t1_pkey on t1 t1_3
5004                            Index Cond: (id = $5)
5005                      ->  Index Only Scan using t2_pkey on t2 t2_3
5006                            Index Cond: (id = $5)
5007                ->  Seq Scan on t3 t3_3
5008                      Filter: (id = $5)
5009    ->  CTE Scan on c1_1
5010          Filter: (id = $5)
5011 (53 rows)
5012
5013 /*+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)*/
5014 EXPLAIN (COSTS false)
5015 WITH c1_1(id) AS (
5016 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
5017 )
5018 SELECT t1_1.id, (
5019 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
5020 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5021 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
5022 ) 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 = (
5023 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 
5024 );
5025 LOG:  pg_hint_plan:
5026 used hint:
5027 HashJoin(t1_1 t3_1)
5028 NestLoop(t1_2 t2_2)
5029 MergeJoin(t1_3 t3_3)
5030 NestLoop(t1_4 t2_4)
5031 NestLoop(t1_5 t2_5)
5032 not used hint:
5033 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)
5034 duplication hint:
5035 error hint:
5036
5037                              QUERY PLAN                             
5038 --------------------------------------------------------------------
5039  Nested Loop
5040    CTE c1_1
5041      ->  Aggregate
5042            ->  Merge Join
5043                  Merge Cond: (t1_5.id = t3_5.id)
5044                  ->  Nested Loop
5045                        ->  Index Only Scan using t2_pkey on t2 t2_5
5046                        ->  Index Only Scan using t1_pkey on t1 t1_5
5047                              Index Cond: (id = t2_5.id)
5048                  ->  Sort
5049                        Sort Key: t3_5.id
5050                        ->  Seq Scan on t3 t3_5
5051    InitPlan 2 (returns $3)
5052      ->  Aggregate
5053            ->  Merge Join
5054                  Merge Cond: (t1_2.id = t3_2.id)
5055                  ->  Nested Loop
5056                        ->  Index Only Scan using t2_pkey on t2 t2_2
5057                        ->  Index Only Scan using t1_pkey on t1 t1_2
5058                              Index Cond: (id = t2_2.id)
5059                  ->  Sort
5060                        Sort Key: t3_2.id
5061                        ->  Seq Scan on t3 t3_2
5062    InitPlan 3 (returns $5)
5063      ->  Aggregate
5064            ->  Merge Join
5065                  Merge Cond: (t1_4.id = t3_4.id)
5066                  ->  Nested Loop
5067                        ->  Index Only Scan using t2_pkey on t2 t2_4
5068                        ->  Index Only Scan using t1_pkey on t1 t1_4
5069                              Index Cond: (id = t2_4.id)
5070                  ->  Sort
5071                        Sort Key: t3_4.id
5072                        ->  Seq Scan on t3 t3_4
5073    ->  Nested Loop
5074          ->  Nested Loop
5075                ->  Nested Loop
5076                      ->  Index Only Scan using t1_pkey on t1 t1_1
5077                            Index Cond: (id = $5)
5078                      ->  Index Only Scan using t2_pkey on t2 t2_1
5079                            Index Cond: (id = $5)
5080                ->  Seq Scan on t3 t3_1
5081                      Filter: (id = $5)
5082          ->  Nested Loop
5083                ->  Nested Loop
5084                      ->  Index Only Scan using t1_pkey on t1 t1_3
5085                            Index Cond: (id = $5)
5086                      ->  Index Only Scan using t2_pkey on t2 t2_3
5087                            Index Cond: (id = $5)
5088                ->  Seq Scan on t3 t3_3
5089                      Filter: (id = $5)
5090    ->  CTE Scan on c1_1
5091          Filter: (id = $5)
5092 (53 rows)
5093
5094 /*+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)*/
5095 EXPLAIN (COSTS false)
5096 WITH c1_1(id) AS (
5097 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
5098 )
5099 SELECT t1_1.id, (
5100 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
5101 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5102 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
5103 ) 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 = (
5104 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 
5105 );
5106 LOG:  pg_hint_plan:
5107 used hint:
5108 MergeJoin(t1_3 t3_3)
5109 Leading(t3_5 t2_5 t1_5)
5110 Leading(t3_2 t2_2 t1_2)
5111 Leading(t3_4 t2_4 t1_4)
5112 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
5113 not used hint:
5114 HashJoin(t1_1 t3_1)
5115 NestLoop(t1_2 t2_2)
5116 NestLoop(t1_4 t2_4)
5117 NestLoop(t1_5 t2_5)
5118 duplication hint:
5119 error hint:
5120
5121                                   QUERY PLAN                                  
5122 ------------------------------------------------------------------------------
5123  Nested Loop
5124    CTE c1_1
5125      ->  Aggregate
5126            ->  Merge Join
5127                  Merge Cond: (t2_5.id = t1_5.id)
5128                  ->  Merge Join
5129                        Merge Cond: (t2_5.id = t3_5.id)
5130                        ->  Index Only Scan using t2_pkey on t2 t2_5
5131                        ->  Sort
5132                              Sort Key: t3_5.id
5133                              ->  Seq Scan on t3 t3_5
5134                  ->  Index Only Scan using t1_pkey on t1 t1_5
5135    InitPlan 2 (returns $1)
5136      ->  Aggregate
5137            ->  Merge Join
5138                  Merge Cond: (t2_2.id = t1_2.id)
5139                  ->  Merge Join
5140                        Merge Cond: (t2_2.id = t3_2.id)
5141                        ->  Index Only Scan using t2_pkey on t2 t2_2
5142                        ->  Sort
5143                              Sort Key: t3_2.id
5144                              ->  Seq Scan on t3 t3_2
5145                  ->  Index Only Scan using t1_pkey on t1 t1_2
5146    InitPlan 3 (returns $2)
5147      ->  Aggregate
5148            ->  Merge Join
5149                  Merge Cond: (t2_4.id = t1_4.id)
5150                  ->  Merge Join
5151                        Merge Cond: (t2_4.id = t3_4.id)
5152                        ->  Index Only Scan using t2_pkey on t2 t2_4
5153                        ->  Sort
5154                              Sort Key: t3_4.id
5155                              ->  Seq Scan on t3 t3_4
5156                  ->  Index Only Scan using t1_pkey on t1 t1_4
5157    ->  Nested Loop
5158          ->  Nested Loop
5159                ->  Nested Loop
5160                      ->  Nested Loop
5161                            ->  Nested Loop
5162                                  ->  Index Only Scan using t1_pkey on t1 t1_3
5163                                        Index Cond: (id = $2)
5164                                  ->  Index Only Scan using t2_pkey on t2 t2_3
5165                                        Index Cond: (id = $2)
5166                            ->  Seq Scan on t3 t3_3
5167                                  Filter: (id = $2)
5168                      ->  CTE Scan on c1_1
5169                            Filter: (id = $2)
5170                ->  Seq Scan on t3 t3_1
5171                      Filter: (id = $2)
5172          ->  Index Only Scan using t2_pkey on t2 t2_1
5173                Index Cond: (id = $2)
5174    ->  Index Only Scan using t1_pkey on t1 t1_1
5175          Index Cond: (id = $2)
5176 (53 rows)
5177
5178 -- ambigous error
5179 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5180                    QUERY PLAN                    
5181 -------------------------------------------------
5182  Merge Join
5183    Merge Cond: (t1.id = t2.id)
5184    ->  Merge Join
5185          Merge Cond: (t1.id = t1_1.id)
5186          ->  Index Scan using t1_pkey on t1
5187          ->  Index Scan using t1_pkey on t1 t1_1
5188    ->  Index Scan using t2_pkey on t2
5189 (7 rows)
5190
5191 /*+NestLoop(t1 t2)*/
5192 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5193 INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t2)"
5194 DETAIL:  Relation name "t1" is ambiguous.
5195 LOG:  pg_hint_plan:
5196 used hint:
5197 not used hint:
5198 duplication hint:
5199 error hint:
5200 NestLoop(t1 t2)
5201
5202                    QUERY PLAN                    
5203 -------------------------------------------------
5204  Merge Join
5205    Merge Cond: (t1.id = t2.id)
5206    ->  Merge Join
5207          Merge Cond: (t1.id = t1_1.id)
5208          ->  Index Scan using t1_pkey on t1
5209          ->  Index Scan using t1_pkey on t1 t1_1
5210    ->  Index Scan using t2_pkey on t2
5211 (7 rows)
5212
5213 /*+Leading(t1 t2 t1)*/
5214 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5215 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t1)"
5216 DETAIL:  Relation name "t1" is ambiguous.
5217 LOG:  pg_hint_plan:
5218 used hint:
5219 not used hint:
5220 duplication hint:
5221 error hint:
5222 Leading(t1 t2 t1)
5223
5224                    QUERY PLAN                    
5225 -------------------------------------------------
5226  Merge Join
5227    Merge Cond: (t1.id = t2.id)
5228    ->  Merge Join
5229          Merge Cond: (t1.id = t1_1.id)
5230          ->  Index Scan using t1_pkey on t1
5231          ->  Index Scan using t1_pkey on t1 t1_1
5232    ->  Index Scan using t2_pkey on t2
5233 (7 rows)
5234
5235 -- identifier length test
5236 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5237                                                   QUERY PLAN                                                  
5238 --------------------------------------------------------------------------------------------------------------
5239  Merge Join
5240    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5241    ->  Merge Join
5242          Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id)
5243          ->  Index Scan using t1_pkey on t1 "123456789012345678901234567890123456789012345678901234567890123"
5244          ->  Index Scan using t2_pkey on t2
5245    ->  Sort
5246          Sort Key: t3.id
5247          ->  Seq Scan on t3
5248 (9 rows)
5249
5250 /*+
5251 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5252 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5253 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5254 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5255 */
5256 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5257 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5258 LOG:  pg_hint_plan:
5259 used hint:
5260 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5261 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5262 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5263 not used hint:
5264 duplication hint:
5265 error hint:
5266 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5267
5268                                              QUERY PLAN                                             
5269 ----------------------------------------------------------------------------------------------------
5270  Merge Join
5271    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5272    ->  Merge Join
5273          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5274          ->  Index Scan using t2_pkey on t2
5275          ->  Sort
5276                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5277                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5278    ->  Sort
5279          Sort Key: t3.id
5280          ->  Seq Scan on t3
5281 (11 rows)
5282
5283 /*+
5284 Leading(1234567890123456789012345678901234567890123456789012345678901234 t2 t3)
5285 SeqScan(1234567890123456789012345678901234567890123456789012345678901234)
5286 MergeJoin(1234567890123456789012345678901234567890123456789012345678901234 t2)
5287 Set(1234567890123456789012345678901234567890123456789012345678901234 1)
5288 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5289 */
5290 EXPLAIN (COSTS false) SELECT * FROM t1 "1234567890123456789012345678901234567890123456789012345678901234" JOIN t2 ON ("1234567890123456789012345678901234567890123456789012345678901234".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5291 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5292 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5293 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5294 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5295 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5296 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5297 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5298 LOG:  pg_hint_plan:
5299 used hint:
5300 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5301 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5302 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5303 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5304 not used hint:
5305 duplication hint:
5306 error hint:
5307 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5308
5309                                              QUERY PLAN                                             
5310 ----------------------------------------------------------------------------------------------------
5311  Merge Join
5312    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5313    ->  Merge Join
5314          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5315          ->  Index Scan using t2_pkey on t2
5316          ->  Sort
5317                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5318                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5319    ->  Sort
5320          Sort Key: t3.id
5321          ->  Seq Scan on t3
5322 (11 rows)
5323
5324 SET "123456789012345678901234567890123456789012345678901234567890123" TO 1;
5325 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5326 SET "1234567890123456789012345678901234567890123456789012345678901234" TO 1;
5327 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5328 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5329 SET cursor_tuple_fraction TO 1234567890123456789012345678901234567890123456789012345678901234;
5330 ERROR:  1.23457e+63 is outside the valid range for parameter "cursor_tuple_fraction" (0 .. 1)
5331 -- multi error
5332 /*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/
5333 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
5334 INFO:  parameter "enable_seqscan" requires a Boolean value
5335 INFO:  parameter "seq_page_cost" requires a numeric value
5336 LOG:  pg_hint_plan:
5337 used hint:
5338 not used hint:
5339 duplication hint:
5340 error hint:
5341 Set(enable_seqscan 100)
5342 Set(seq_page_cost on)
5343
5344               QUERY PLAN              
5345 --------------------------------------
5346  Merge Join
5347    Merge Cond: (t1.id = t2.id)
5348    ->  Index Scan using t1_pkey on t1
5349    ->  Index Scan using t2_pkey on t2
5350 (4 rows)
5351
5352 -- debug log of candidate index to use IndexScan
5353 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5354                                        QUERY PLAN                                       
5355 ----------------------------------------------------------------------------------------
5356  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
5357    Index Cond: (id = 1)
5358 (2 rows)
5359
5360 /*+IndexScan(t5 t5_id2)*/
5361 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5362 LOG:  available indexes for IndexScan(t5): t5_id2
5363 LOG:  pg_hint_plan:
5364 used hint:
5365 IndexScan(t5 t5_id2)
5366 not used hint:
5367 duplication hint:
5368 error hint:
5369
5370           QUERY PLAN           
5371 -------------------------------
5372  Index Scan using t5_id2 on t5
5373    Index Cond: (id = 1)
5374 (2 rows)
5375
5376 /*+IndexScan(t5 no_exist)*/
5377 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5378 LOG:  available indexes for IndexScan(t5):
5379 LOG:  pg_hint_plan:
5380 used hint:
5381 IndexScan(t5 no_exist)
5382 not used hint:
5383 duplication hint:
5384 error hint:
5385
5386      QUERY PLAN     
5387 --------------------
5388  Seq Scan on t5
5389    Filter: (id = 1)
5390 (2 rows)
5391
5392 /*+IndexScan(t5 t5_id1 t5_id2)*/
5393 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5394 LOG:  available indexes for IndexScan(t5): t5_id2 t5_id1
5395 LOG:  pg_hint_plan:
5396 used hint:
5397 IndexScan(t5 t5_id1 t5_id2)
5398 not used hint:
5399 duplication hint:
5400 error hint:
5401
5402           QUERY PLAN           
5403 -------------------------------
5404  Index Scan using t5_id2 on t5
5405    Index Cond: (id = 1)
5406 (2 rows)
5407
5408 /*+IndexScan(t5 no_exist t5_id2)*/
5409 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5410 LOG:  available indexes for IndexScan(t5): t5_id2
5411 LOG:  pg_hint_plan:
5412 used hint:
5413 IndexScan(t5 no_exist t5_id2)
5414 not used hint:
5415 duplication hint:
5416 error hint:
5417
5418           QUERY PLAN           
5419 -------------------------------
5420  Index Scan using t5_id2 on t5
5421    Index Cond: (id = 1)
5422 (2 rows)
5423
5424 /*+IndexScan(t5 no_exist5 no_exist2)*/
5425 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5426 LOG:  available indexes for IndexScan(t5):
5427 LOG:  pg_hint_plan:
5428 used hint:
5429 IndexScan(t5 no_exist5 no_exist2)
5430 not used hint:
5431 duplication hint:
5432 error hint:
5433
5434      QUERY PLAN     
5435 --------------------
5436  Seq Scan on t5
5437    Filter: (id = 1)
5438 (2 rows)
5439
5440 -- outer inner
5441 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5442                        QUERY PLAN                       
5443 --------------------------------------------------------
5444  Hash Join
5445    Hash Cond: (t3.val = t2.val)
5446    ->  Seq Scan on t3
5447    ->  Hash
5448          ->  Hash Join
5449                Hash Cond: (t2.id = t1.id)
5450                ->  Seq Scan on t2
5451                ->  Hash
5452                      ->  Index Scan using t1_pkey on t1
5453                            Index Cond: (id < 10)
5454 (10 rows)
5455
5456 /*+Leading((t1))*/
5457 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5458 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1))"
5459 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5460 LOG:  pg_hint_plan:
5461 used hint:
5462 not used hint:
5463 duplication hint:
5464 error hint:
5465 Leading((t1))
5466
5467                        QUERY PLAN                       
5468 --------------------------------------------------------
5469  Hash Join
5470    Hash Cond: (t3.val = t2.val)
5471    ->  Seq Scan on t3
5472    ->  Hash
5473          ->  Hash Join
5474                Hash Cond: (t2.id = t1.id)
5475                ->  Seq Scan on t2
5476                ->  Hash
5477                      ->  Index Scan using t1_pkey on t1
5478                            Index Cond: (id < 10)
5479 (10 rows)
5480
5481 /*+Leading((t1 t2))*/
5482 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5483 LOG:  pg_hint_plan:
5484 used hint:
5485 Leading((t1 t2))
5486 not used hint:
5487 duplication hint:
5488 error hint:
5489
5490                  QUERY PLAN                 
5491 --------------------------------------------
5492  Nested Loop
5493    Join Filter: (t2.val = t3.val)
5494    ->  Hash Join
5495          Hash Cond: (t1.id = t2.id)
5496          ->  Index Scan using t1_pkey on t1
5497                Index Cond: (id < 10)
5498          ->  Hash
5499                ->  Seq Scan on t2
5500    ->  Seq Scan on t3
5501 (9 rows)
5502
5503 /*+Leading((t1 t2 t3))*/
5504 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5505 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1 t2 t3))"
5506 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5507 LOG:  pg_hint_plan:
5508 used hint:
5509 not used hint:
5510 duplication hint:
5511 error hint:
5512 Leading((t1 t2 t3))
5513
5514                        QUERY PLAN                       
5515 --------------------------------------------------------
5516  Hash Join
5517    Hash Cond: (t3.val = t2.val)
5518    ->  Seq Scan on t3
5519    ->  Hash
5520          ->  Hash Join
5521                Hash Cond: (t2.id = t1.id)
5522                ->  Seq Scan on t2
5523                ->  Hash
5524                      ->  Index Scan using t1_pkey on t1
5525                            Index Cond: (id < 10)
5526 (10 rows)
5527
5528 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5529                  QUERY PLAN                 
5530 --------------------------------------------
5531  Hash Join
5532    Hash Cond: (t2.id = t1.id)
5533    ->  Seq Scan on t2
5534    ->  Hash
5535          ->  Index Scan using t1_pkey on t1
5536                Index Cond: (id < 10)
5537 (6 rows)
5538
5539 /*+Leading((t1 t2))*/
5540 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5541 LOG:  pg_hint_plan:
5542 used hint:
5543 Leading((t1 t2))
5544 not used hint:
5545 duplication hint:
5546 error hint:
5547
5548               QUERY PLAN              
5549 --------------------------------------
5550  Hash Join
5551    Hash Cond: (t1.id = t2.id)
5552    ->  Index Scan using t1_pkey on t1
5553          Index Cond: (id < 10)
5554    ->  Hash
5555          ->  Seq Scan on t2
5556 (6 rows)
5557
5558 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5559                        QUERY PLAN                       
5560 --------------------------------------------------------
5561  Hash Join
5562    Hash Cond: (t3.val = t2.val)
5563    ->  Seq Scan on t3
5564    ->  Hash
5565          ->  Hash Join
5566                Hash Cond: (t2.id = t1.id)
5567                ->  Seq Scan on t2
5568                ->  Hash
5569                      ->  Index Scan using t1_pkey on t1
5570                            Index Cond: (id < 10)
5571 (10 rows)
5572
5573 /*+Leading(((t1 t2) t3))*/
5574 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5575 LOG:  pg_hint_plan:
5576 used hint:
5577 Leading(((t1 t2) t3))
5578 not used hint:
5579 duplication hint:
5580 error hint:
5581
5582                  QUERY PLAN                 
5583 --------------------------------------------
5584  Nested Loop
5585    Join Filter: (t2.val = t3.val)
5586    ->  Hash Join
5587          Hash Cond: (t1.id = t2.id)
5588          ->  Index Scan using t1_pkey on t1
5589                Index Cond: (id < 10)
5590          ->  Hash
5591                ->  Seq Scan on t2
5592    ->  Seq Scan on t3
5593 (9 rows)
5594
5595 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;
5596                        QUERY PLAN                       
5597 --------------------------------------------------------
5598  Nested Loop
5599    ->  Merge Join
5600          Merge Cond: (t3.id = t4.id)
5601          ->  Nested Loop
5602                Join Filter: (t1.val = t3.val)
5603                ->  Index Scan using t3_pkey on t3
5604                ->  Materialize
5605                      ->  Index Scan using t1_pkey on t1
5606                            Index Cond: (id < 10)
5607          ->  Sort
5608                Sort Key: t4.id
5609                ->  Seq Scan on t4
5610    ->  Index Scan using t2_pkey on t2
5611          Index Cond: (id = t1.id)
5612 (14 rows)
5613
5614 /*+Leading((((t1 t2) t3) t4))*/
5615 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;
5616 LOG:  pg_hint_plan:
5617 used hint:
5618 Leading((((t1 t2) t3) t4))
5619 not used hint:
5620 duplication hint:
5621 error hint:
5622
5623                     QUERY PLAN                    
5624 --------------------------------------------------
5625  Nested Loop
5626    ->  Nested Loop
5627          Join Filter: (t1.val = t3.val)
5628          ->  Hash Join
5629                Hash Cond: (t1.id = t2.id)
5630                ->  Index Scan using t1_pkey on t1
5631                      Index Cond: (id < 10)
5632                ->  Hash
5633                      ->  Seq Scan on t2
5634          ->  Seq Scan on t3
5635    ->  Index Scan using t4_pkey on t4
5636          Index Cond: (id = t3.id)
5637 (12 rows)
5638
5639 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5640                        QUERY PLAN                       
5641 --------------------------------------------------------
5642  Hash Join
5643    Hash Cond: (t3.val = t2.val)
5644    ->  Seq Scan on t3
5645    ->  Hash
5646          ->  Hash Join
5647                Hash Cond: (t2.id = t1.id)
5648                ->  Seq Scan on t2
5649                ->  Hash
5650                      ->  Index Scan using t1_pkey on t1
5651                            Index Cond: (id < 10)
5652 (10 rows)
5653
5654 /*+Leading(((t1 t2) t3))*/
5655 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5656 LOG:  pg_hint_plan:
5657 used hint:
5658 Leading(((t1 t2) t3))
5659 not used hint:
5660 duplication hint:
5661 error hint:
5662
5663                  QUERY PLAN                 
5664 --------------------------------------------
5665  Nested Loop
5666    Join Filter: (t2.val = t3.val)
5667    ->  Hash Join
5668          Hash Cond: (t1.id = t2.id)
5669          ->  Index Scan using t1_pkey on t1
5670                Index Cond: (id < 10)
5671          ->  Hash
5672                ->  Seq Scan on t2
5673    ->  Seq Scan on t3
5674 (9 rows)
5675
5676 /*+Leading((t1 (t2 t3)))*/
5677 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5678 LOG:  pg_hint_plan:
5679 used hint:
5680 Leading((t1 (t2 t3)))
5681 not used hint:
5682 duplication hint:
5683 error hint:
5684
5685                  QUERY PLAN                 
5686 --------------------------------------------
5687  Hash Join
5688    Hash Cond: (t1.id = t2.id)
5689    ->  Index Scan using t1_pkey on t1
5690          Index Cond: (id < 10)
5691    ->  Hash
5692          ->  Hash Join
5693                Hash Cond: (t2.val = t3.val)
5694                ->  Seq Scan on t2
5695                ->  Hash
5696                      ->  Seq Scan on t3
5697 (10 rows)
5698
5699 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;
5700                        QUERY PLAN                       
5701 --------------------------------------------------------
5702  Nested Loop
5703    ->  Merge Join
5704          Merge Cond: (t3.id = t4.id)
5705          ->  Nested Loop
5706                Join Filter: (t1.val = t3.val)
5707                ->  Index Scan using t3_pkey on t3
5708                ->  Materialize
5709                      ->  Index Scan using t1_pkey on t1
5710                            Index Cond: (id < 10)
5711          ->  Sort
5712                Sort Key: t4.id
5713                ->  Seq Scan on t4
5714    ->  Index Scan using t2_pkey on t2
5715          Index Cond: (id = t1.id)
5716 (14 rows)
5717
5718 /*+Leading(((t1 t2) (t3 t4)))*/
5719 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;
5720 LOG:  pg_hint_plan:
5721 used hint:
5722 Leading(((t1 t2) (t3 t4)))
5723 not used hint:
5724 duplication hint:
5725 error hint:
5726
5727                  QUERY PLAN                 
5728 --------------------------------------------
5729  Nested Loop
5730    Join Filter: (t1.val = t3.val)
5731    ->  Hash Join
5732          Hash Cond: (t1.id = t2.id)
5733          ->  Index Scan using t1_pkey on t1
5734                Index Cond: (id < 10)
5735          ->  Hash
5736                ->  Seq Scan on t2
5737    ->  Merge Join
5738          Merge Cond: (t3.id = t4.id)
5739          ->  Index Scan using t3_pkey on t3
5740          ->  Sort
5741                Sort Key: t4.id
5742                ->  Seq Scan on t4
5743 (14 rows)
5744
5745 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);
5746                              QUERY PLAN                             
5747 --------------------------------------------------------------------
5748  Hash Join
5749    Hash Cond: (t2.val = t3.val)
5750    InitPlan 1 (returns $1)
5751      ->  Limit
5752            ->  Sort
5753                  Sort Key: t1_2.id
5754                  ->  Nested Loop
5755                        ->  Index Scan using t2_val on t2 t2_2
5756                              Index Cond: (val > 100)
5757                        ->  Index Only Scan using t1_pkey on t1 t1_2
5758                              Index Cond: (id = t2_2.id)
5759    ->  Merge Join
5760          Merge Cond: (t1.id = t2.id)
5761          ->  Index Scan using t1_pkey on t1
5762                Index Cond: (id < $1)
5763          ->  Index Scan using t2_pkey on t2
5764    ->  Hash
5765          ->  Seq Scan on t3
5766 (18 rows)
5767
5768 /*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
5769 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);
5770 INFO:  pg_hint_plan: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
5771 DETAIL:  Conflict leading hint.
5772 LOG:  pg_hint_plan:
5773 used hint:
5774 Leading(((t3 t1) t2))
5775 not used hint:
5776 duplication hint:
5777 Leading(((t1 t2) t3))
5778 error hint:
5779
5780                              QUERY PLAN                             
5781 --------------------------------------------------------------------
5782  Hash Join
5783    Hash Cond: (t1.id = t2.id)
5784    InitPlan 1 (returns $1)
5785      ->  Limit
5786            ->  Sort
5787                  Sort Key: t1_2.id
5788                  ->  Nested Loop
5789                        ->  Index Scan using t2_val on t2 t2_2
5790                              Index Cond: (val > 100)
5791                        ->  Index Only Scan using t1_pkey on t1 t1_2
5792                              Index Cond: (id = t2_2.id)
5793    ->  Hash Join
5794          Hash Cond: (t3.val = t1.val)
5795          ->  Seq Scan on t3
5796          ->  Hash
5797                ->  Index Scan using t1_pkey on t1
5798                      Index Cond: (id < $1)
5799    ->  Hash
5800          ->  Seq Scan on t2
5801 (19 rows)
5802
5803 /*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/
5804 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);
5805 LOG:  pg_hint_plan:
5806 used hint:
5807 Leading(((t1 t2) t3))
5808 Leading((t1_2 t2_2))
5809 not used hint:
5810 duplication hint:
5811 error hint:
5812
5813                           QUERY PLAN                          
5814 --------------------------------------------------------------
5815  Hash Join
5816    Hash Cond: (t2.val = t3.val)
5817    InitPlan 1 (returns $0)
5818      ->  Limit
5819            ->  Merge Join
5820                  Merge Cond: (t1_2.id = t2_2.id)
5821                  ->  Index Only Scan using t1_pkey on t1 t1_2
5822                  ->  Sort
5823                        Sort Key: t2_2.id
5824                        ->  Index Scan using t2_val on t2 t2_2
5825                              Index Cond: (val > 100)
5826    ->  Merge Join
5827          Merge Cond: (t1.id = t2.id)
5828          ->  Index Scan using t1_pkey on t1
5829                Index Cond: (id < $0)
5830          ->  Index Scan using t2_pkey on t2
5831    ->  Hash
5832          ->  Seq Scan on t3
5833 (18 rows)
5834
5835 /*+Leading(((((t1 t2) t3) t1_2) t2_2))*/
5836 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);
5837 LOG:  pg_hint_plan:
5838 used hint:
5839 not used hint:
5840 Leading(((((t1 t2) t3) t1_2) t2_2))
5841 duplication hint:
5842 error hint:
5843
5844                              QUERY PLAN                             
5845 --------------------------------------------------------------------
5846  Hash Join
5847    Hash Cond: (t2.val = t3.val)
5848    InitPlan 1 (returns $1)
5849      ->  Limit
5850            ->  Sort
5851                  Sort Key: t1_2.id
5852                  ->  Nested Loop
5853                        ->  Index Scan using t2_val on t2 t2_2
5854                              Index Cond: (val > 100)
5855                        ->  Index Only Scan using t1_pkey on t1 t1_2
5856                              Index Cond: (id = t2_2.id)
5857    ->  Merge Join
5858          Merge Cond: (t1.id = t2.id)
5859          ->  Index Scan using t1_pkey on t1
5860                Index Cond: (id < $1)
5861          ->  Index Scan using t2_pkey on t2
5862    ->  Hash
5863          ->  Seq Scan on t3
5864 (18 rows)
5865
5866 -- Specified outer/inner leading hint and join method hint at the same time
5867 /*+Leading(((t1 t2) t3))*/
5868 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5869 LOG:  pg_hint_plan:
5870 used hint:
5871 Leading(((t1 t2) t3))
5872 not used hint:
5873 duplication hint:
5874 error hint:
5875
5876                  QUERY PLAN                 
5877 --------------------------------------------
5878  Nested Loop
5879    Join Filter: (t2.val = t3.val)
5880    ->  Hash Join
5881          Hash Cond: (t1.id = t2.id)
5882          ->  Index Scan using t1_pkey on t1
5883                Index Cond: (id < 10)
5884          ->  Hash
5885                ->  Seq Scan on t2
5886    ->  Seq Scan on t3
5887 (9 rows)
5888
5889 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/
5890 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5891 LOG:  pg_hint_plan:
5892 used hint:
5893 MergeJoin(t1 t2)
5894 Leading(((t1 t2) t3))
5895 not used hint:
5896 duplication hint:
5897 error hint:
5898
5899                  QUERY PLAN                 
5900 --------------------------------------------
5901  Nested Loop
5902    Join Filter: (t2.val = t3.val)
5903    ->  Merge Join
5904          Merge Cond: (t1.id = t2.id)
5905          ->  Index Scan using t1_pkey on t1
5906                Index Cond: (id < 10)
5907          ->  Index Scan using t2_pkey on t2
5908    ->  Seq Scan on t3
5909 (8 rows)
5910
5911 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/
5912 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5913 LOG:  pg_hint_plan:
5914 used hint:
5915 MergeJoin(t1 t2 t3)
5916 Leading(((t1 t2) t3))
5917 not used hint:
5918 duplication hint:
5919 error hint:
5920
5921                     QUERY PLAN                    
5922 --------------------------------------------------
5923  Merge Join
5924    Merge Cond: (t2.val = t3.val)
5925    ->  Sort
5926          Sort Key: t2.val
5927          ->  Hash Join
5928                Hash Cond: (t1.id = t2.id)
5929                ->  Index Scan using t1_pkey on t1
5930                      Index Cond: (id < 10)
5931                ->  Hash
5932                      ->  Seq Scan on t2
5933    ->  Sort
5934          Sort Key: t3.val
5935          ->  Seq Scan on t3
5936 (13 rows)
5937
5938 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/
5939 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5940 LOG:  pg_hint_plan:
5941 used hint:
5942 Leading(((t1 t2) t3))
5943 not used hint:
5944 MergeJoin(t1 t3)
5945 duplication hint:
5946 error hint:
5947
5948                  QUERY PLAN                 
5949 --------------------------------------------
5950  Nested Loop
5951    Join Filter: (t2.val = t3.val)
5952    ->  Hash Join
5953          Hash Cond: (t1.id = t2.id)
5954          ->  Index Scan using t1_pkey on t1
5955                Index Cond: (id < 10)
5956          ->  Hash
5957                ->  Seq Scan on t2
5958    ->  Seq Scan on t3
5959 (9 rows)
5960
5961 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;
5962                        QUERY PLAN                       
5963 --------------------------------------------------------
5964  Nested Loop
5965    ->  Merge Join
5966          Merge Cond: (t3.id = t4.id)
5967          ->  Nested Loop
5968                Join Filter: (t1.val = t3.val)
5969                ->  Index Scan using t3_pkey on t3
5970                ->  Materialize
5971                      ->  Index Scan using t1_pkey on t1
5972                            Index Cond: (id < 10)
5973          ->  Sort
5974                Sort Key: t4.id
5975                ->  Seq Scan on t4
5976    ->  Index Scan using t2_pkey on t2
5977          Index Cond: (id = t1.id)
5978 (14 rows)
5979
5980 /*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/
5981 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;
5982 LOG:  pg_hint_plan:
5983 used hint:
5984 Leading(((t1 t2) t3))
5985 not used hint:
5986 MergeJoin(t3 t4)
5987 duplication hint:
5988 error hint:
5989
5990                     QUERY PLAN                    
5991 --------------------------------------------------
5992  Nested Loop
5993    Join Filter: (t3.id = t4.id)
5994    ->  Nested Loop
5995          Join Filter: (t1.val = t3.val)
5996          ->  Hash Join
5997                Hash Cond: (t1.id = t2.id)
5998                ->  Index Scan using t1_pkey on t1
5999                      Index Cond: (id < 10)
6000                ->  Hash
6001                      ->  Seq Scan on t2
6002          ->  Seq Scan on t3
6003    ->  Seq Scan on t4
6004 (12 rows)
6005
6006 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
6007 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;
6008 LOG:  pg_hint_plan:
6009 used hint:
6010 MergeJoin(t1 t2 t3 t4)
6011 Leading(((t1 t2) t3))
6012 not used hint:
6013 duplication hint:
6014 error hint:
6015
6016                        QUERY PLAN                       
6017 --------------------------------------------------------
6018  Merge Join
6019    Merge Cond: (t3.id = t4.id)
6020    ->  Sort
6021          Sort Key: t3.id
6022          ->  Nested Loop
6023                Join Filter: (t1.val = t3.val)
6024                ->  Hash Join
6025                      Hash Cond: (t1.id = t2.id)
6026                      ->  Index Scan using t1_pkey on t1
6027                            Index Cond: (id < 10)
6028                      ->  Hash
6029                            ->  Seq Scan on t2
6030                ->  Seq Scan on t3
6031    ->  Sort
6032          Sort Key: t4.id
6033          ->  Seq Scan on t4
6034 (16 rows)
6035
6036 /*+ Leading ( ( t1 ( t2 t3 ) ) ) */
6037 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6038 LOG:  pg_hint_plan:
6039 used hint:
6040 Leading((t1 (t2 t3)))
6041 not used hint:
6042 duplication hint:
6043 error hint:
6044
6045                  QUERY PLAN                 
6046 --------------------------------------------
6047  Hash Join
6048    Hash Cond: (t1.id = t2.id)
6049    ->  Index Scan using t1_pkey on t1
6050          Index Cond: (id < 10)
6051    ->  Hash
6052          ->  Hash Join
6053                Hash Cond: (t2.val = t3.val)
6054                ->  Seq Scan on t2
6055                ->  Hash
6056                      ->  Seq Scan on t3
6057 (10 rows)
6058
6059 /*+Leading((t1(t2 t3)))*/
6060 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6061 LOG:  pg_hint_plan:
6062 used hint:
6063 Leading((t1 (t2 t3)))
6064 not used hint:
6065 duplication hint:
6066 error hint:
6067
6068                  QUERY PLAN                 
6069 --------------------------------------------
6070  Hash Join
6071    Hash Cond: (t1.id = t2.id)
6072    ->  Index Scan using t1_pkey on t1
6073          Index Cond: (id < 10)
6074    ->  Hash
6075          ->  Hash Join
6076                Hash Cond: (t2.val = t3.val)
6077                ->  Seq Scan on t2
6078                ->  Hash
6079                      ->  Seq Scan on t3
6080 (10 rows)
6081
6082 /*+Leading(("t1(t2" "t3)"))*/
6083 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6084 LOG:  pg_hint_plan:
6085 used hint:
6086 not used hint:
6087 Leading(("t1(t2" "t3)"))
6088 duplication hint:
6089 error hint:
6090
6091                        QUERY PLAN                       
6092 --------------------------------------------------------
6093  Hash Join
6094    Hash Cond: (t3.val = t2.val)
6095    ->  Seq Scan on t3
6096    ->  Hash
6097          ->  Hash Join
6098                Hash Cond: (t2.id = t1.id)
6099                ->  Seq Scan on t2
6100                ->  Hash
6101                      ->  Index Scan using t1_pkey on t1
6102                            Index Cond: (id < 10)
6103 (10 rows)
6104
6105 /*+ Leading ( ( ( t1 t2 ) t3 ) ) */
6106 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6107 LOG:  pg_hint_plan:
6108 used hint:
6109 Leading(((t1 t2) t3))
6110 not used hint:
6111 duplication hint:
6112 error hint:
6113
6114                  QUERY PLAN                 
6115 --------------------------------------------
6116  Nested Loop
6117    Join Filter: (t2.val = t3.val)
6118    ->  Hash Join
6119          Hash Cond: (t1.id = t2.id)
6120          ->  Index Scan using t1_pkey on t1
6121                Index Cond: (id < 10)
6122          ->  Hash
6123                ->  Seq Scan on t2
6124    ->  Seq Scan on t3
6125 (9 rows)
6126
6127 /*+Leading(((t1 t2)t3))*/
6128 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6129 LOG:  pg_hint_plan:
6130 used hint:
6131 Leading(((t1 t2) t3))
6132 not used hint:
6133 duplication hint:
6134 error hint:
6135
6136                  QUERY PLAN                 
6137 --------------------------------------------
6138  Nested Loop
6139    Join Filter: (t2.val = t3.val)
6140    ->  Hash Join
6141          Hash Cond: (t1.id = t2.id)
6142          ->  Index Scan using t1_pkey on t1
6143                Index Cond: (id < 10)
6144          ->  Hash
6145                ->  Seq Scan on t2
6146    ->  Seq Scan on t3
6147 (9 rows)
6148
6149 /*+Leading(("(t1" "t2)t3"))*/
6150 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6151 LOG:  pg_hint_plan:
6152 used hint:
6153 not used hint:
6154 Leading(("(t1" "t2)t3"))
6155 duplication hint:
6156 error hint:
6157
6158                        QUERY PLAN                       
6159 --------------------------------------------------------
6160  Hash Join
6161    Hash Cond: (t3.val = t2.val)
6162    ->  Seq Scan on t3
6163    ->  Hash
6164          ->  Hash Join
6165                Hash Cond: (t2.id = t1.id)
6166                ->  Seq Scan on t2
6167                ->  Hash
6168                      ->  Index Scan using t1_pkey on t1
6169                            Index Cond: (id < 10)
6170 (10 rows)
6171
6172 /*+Leading((t1(t2(t3(t4 t5)))))*/
6173 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;
6174 LOG:  pg_hint_plan:
6175 used hint:
6176 Leading((t1 (t2 (t3 (t4 t5)))))
6177 not used hint:
6178 duplication hint:
6179 error hint:
6180
6181                                                             QUERY PLAN                                                            
6182 ----------------------------------------------------------------------------------------------------------------------------------
6183  Merge Join
6184    Merge Cond: (t1.id = t2.id)
6185    ->  Index Scan using t1_pkey on t1
6186    ->  Materialize
6187          ->  Merge Join
6188                Merge Cond: (t2.id = t3.id)
6189                ->  Index Scan using t2_pkey on t2
6190                ->  Materialize
6191                      ->  Merge Join
6192                            Merge Cond: (t3.id = t4.id)
6193                            ->  Index Scan using t3_pkey on t3
6194                            ->  Materialize
6195                                  ->  Merge Join
6196                                        Merge Cond: (t4.id = t5.id)
6197                                        ->  Index Scan using t4_pkey on t4
6198                                        ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6199 (16 rows)
6200
6201 /*+Leading((t5(t4(t3(t2 t1)))))*/
6202 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;
6203 LOG:  pg_hint_plan:
6204 used hint:
6205 Leading((t5 (t4 (t3 (t2 t1)))))
6206 not used hint:
6207 duplication hint:
6208 error hint:
6209
6210                                 QUERY PLAN                                
6211 --------------------------------------------------------------------------
6212  Hash Join
6213    Hash Cond: (t5.id = t1.id)
6214    ->  Seq Scan on t5
6215    ->  Hash
6216          ->  Merge Join
6217                Merge Cond: (t4.id = t1.id)
6218                ->  Sort
6219                      Sort Key: t4.id
6220                      ->  Seq Scan on t4
6221                ->  Materialize
6222                      ->  Merge Join
6223                            Merge Cond: (t3.id = t1.id)
6224                            ->  Sort
6225                                  Sort Key: t3.id
6226                                  ->  Seq Scan on t3
6227                            ->  Materialize
6228                                  ->  Merge Join
6229                                        Merge Cond: (t2.id = t1.id)
6230                                        ->  Index Scan using t2_pkey on t2
6231                                        ->  Index Scan using t1_pkey on t1
6232 (20 rows)
6233
6234 /*+Leading(((((t1 t2)t3)t4)t5))*/
6235 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;
6236 LOG:  pg_hint_plan:
6237 used hint:
6238 Leading(((((t1 t2) t3) t4) t5))
6239 not used hint:
6240 duplication hint:
6241 error hint:
6242
6243                                           QUERY PLAN                                          
6244 ----------------------------------------------------------------------------------------------
6245  Nested Loop
6246    ->  Merge Join
6247          Merge Cond: (t1.id = t4.id)
6248          ->  Merge Join
6249                Merge Cond: (t1.id = t3.id)
6250                ->  Merge Join
6251                      Merge Cond: (t1.id = t2.id)
6252                      ->  Index Scan using t1_pkey on t1
6253                      ->  Index Scan using t2_pkey on t2
6254                ->  Sort
6255                      Sort Key: t3.id
6256                      ->  Seq Scan on t3
6257          ->  Sort
6258                Sort Key: t4.id
6259                ->  Seq Scan on t4
6260    ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6261          Index Cond: (id = t1.id)
6262 (17 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  Nested Loop
6276    Join Filter: (t2.id = t1.id)
6277    ->  Nested Loop
6278          Join Filter: (t3.id = t2.id)
6279          ->  Merge Join
6280                Merge Cond: (t4.id = t3.id)
6281                ->  Merge Join
6282                      Merge Cond: (t5.id = t4.id)
6283                      ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6284                      ->  Sort
6285                            Sort Key: t4.id
6286                            ->  Seq Scan on t4
6287                ->  Index Scan using t3_pkey on t3
6288          ->  Index Scan using t2_pkey on t2
6289                Index Cond: (id = t5.id)
6290    ->  Index Scan using t1_pkey on t1
6291          Index Cond: (id = t5.id)
6292 (17 rows)
6293
6294 /*+Leading(((t1 t2)(t3(t4 t5))))*/
6295 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;
6296 LOG:  pg_hint_plan:
6297 used hint:
6298 Leading(((t1 t2) (t3 (t4 t5))))
6299 not used hint:
6300 duplication hint:
6301 error hint:
6302
6303                                                       QUERY PLAN                                                      
6304 ----------------------------------------------------------------------------------------------------------------------
6305  Merge Join
6306    Merge Cond: (t1.id = t3.id)
6307    ->  Merge Join
6308          Merge Cond: (t1.id = t2.id)
6309          ->  Index Scan using t1_pkey on t1
6310          ->  Index Scan using t2_pkey on t2
6311    ->  Materialize
6312          ->  Merge Join
6313                Merge Cond: (t3.id = t4.id)
6314                ->  Index Scan using t3_pkey on t3
6315                ->  Materialize
6316                      ->  Merge Join
6317                            Merge Cond: (t4.id = t5.id)
6318                            ->  Index Scan using t4_pkey on t4
6319                            ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6320 (15 rows)
6321
6322 /*+Leading(((t5 t4)(t3(t2 t1))))*/
6323 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;
6324 LOG:  pg_hint_plan:
6325 used hint:
6326 Leading(((t5 t4) (t3 (t2 t1))))
6327 not used hint:
6328 duplication hint:
6329 error hint:
6330
6331                                              QUERY PLAN                                             
6332 ----------------------------------------------------------------------------------------------------
6333  Merge Join
6334    Merge Cond: (t4.id = t1.id)
6335    ->  Merge Join
6336          Merge Cond: (t5.id = t4.id)
6337          ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6338          ->  Sort
6339                Sort Key: t4.id
6340                ->  Seq Scan on t4
6341    ->  Materialize
6342          ->  Merge Join
6343                Merge Cond: (t3.id = t1.id)
6344                ->  Sort
6345                      Sort Key: t3.id
6346                      ->  Seq Scan on t3
6347                ->  Materialize
6348                      ->  Merge Join
6349                            Merge Cond: (t2.id = t1.id)
6350                            ->  Index Scan using t2_pkey on t2
6351                            ->  Index Scan using t1_pkey on t1
6352 (19 rows)
6353
6354 /*+Leading((((t1 t2)t3)(t4 t5)))*/
6355 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;
6356 LOG:  pg_hint_plan:
6357 used hint:
6358 Leading((((t1 t2) t3) (t4 t5)))
6359 not used hint:
6360 duplication hint:
6361 error hint:
6362
6363                                                 QUERY PLAN                                                
6364 ----------------------------------------------------------------------------------------------------------
6365  Merge Join
6366    Merge Cond: (t1.id = t4.id)
6367    ->  Merge Join
6368          Merge Cond: (t1.id = t3.id)
6369          ->  Merge Join
6370                Merge Cond: (t1.id = t2.id)
6371                ->  Index Scan using t1_pkey on t1
6372                ->  Index Scan using t2_pkey on t2
6373          ->  Sort
6374                Sort Key: t3.id
6375                ->  Seq Scan on t3
6376    ->  Materialize
6377          ->  Merge Join
6378                Merge Cond: (t4.id = t5.id)
6379                ->  Index Scan using t4_pkey on t4
6380                ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6381 (16 rows)
6382
6383 /*+Leading((((t5 t4)t3)(t2 t1)))*/
6384 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;
6385 LOG:  pg_hint_plan:
6386 used hint:
6387 Leading((((t5 t4) t3) (t2 t1)))
6388 not used hint:
6389 duplication hint:
6390 error hint:
6391
6392                                                 QUERY PLAN                                                
6393 ----------------------------------------------------------------------------------------------------------
6394  Merge Join
6395    Merge Cond: (t3.id = t1.id)
6396    ->  Merge Join
6397          Merge Cond: (t4.id = t3.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          ->  Index Scan using t3_pkey on t3
6405    ->  Materialize
6406          ->  Merge Join
6407                Merge Cond: (t2.id = t1.id)
6408                ->  Index Scan using t2_pkey on t2
6409                ->  Index Scan using t1_pkey on t1
6410 (16 rows)
6411
6412 -- inherite table test to specify the index's name
6413 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6414                               QUERY PLAN                               
6415 -----------------------------------------------------------------------
6416  Append
6417    ->  Seq Scan on p2
6418          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6419    ->  Seq Scan on p2_c1
6420          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6421    ->  Seq Scan on p2_c1_c1
6422          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6423    ->  Seq Scan on p2_c1_c2
6424          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6425 (9 rows)
6426
6427 /*+IndexScan(p2 p2_pkey)*/
6428 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6429 LOG:  available indexes for IndexScan(p2): p2_pkey
6430 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6431 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6432 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6433 LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
6434 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6435 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6436 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6437 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6438 LOG:  pg_hint_plan:
6439 used hint:
6440 IndexScan(p2 p2_pkey)
6441 not used hint:
6442 duplication hint:
6443 error hint:
6444
6445                     QUERY PLAN                    
6446 --------------------------------------------------
6447  Append
6448    ->  Index Scan using p2_pkey on p2
6449          Index Cond: ((id >= 50) AND (id <= 51))
6450          Filter: (ctid = '(1,1)'::tid)
6451    ->  Index Scan using p2_c1_pkey on p2_c1
6452          Index Cond: ((id >= 50) AND (id <= 51))
6453          Filter: (ctid = '(1,1)'::tid)
6454    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6455          Index Cond: ((id >= 50) AND (id <= 51))
6456          Filter: (ctid = '(1,1)'::tid)
6457    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6458          Index Cond: ((id >= 50) AND (id <= 51))
6459          Filter: (ctid = '(1,1)'::tid)
6460 (13 rows)
6461
6462 /*+IndexScan(p2 p2_id_val_idx)*/
6463 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6464 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
6465 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6466 LOG:  available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
6467 LOG:  available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
6468 LOG:  available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
6469 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
6470 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
6471 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
6472 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
6473 LOG:  pg_hint_plan:
6474 used hint:
6475 IndexScan(p2 p2_id_val_idx)
6476 not used hint:
6477 duplication hint:
6478 error hint:
6479
6480                        QUERY PLAN                       
6481 --------------------------------------------------------
6482  Append
6483    ->  Index Scan using p2_id_val_idx on p2
6484          Index Cond: ((id >= 50) AND (id <= 51))
6485          Filter: (ctid = '(1,1)'::tid)
6486    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6487          Index Cond: ((id >= 50) AND (id <= 51))
6488          Filter: (ctid = '(1,1)'::tid)
6489    ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
6490          Index Cond: ((id >= 50) AND (id <= 51))
6491          Filter: (ctid = '(1,1)'::tid)
6492    ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
6493          Index Cond: ((id >= 50) AND (id <= 51))
6494          Filter: (ctid = '(1,1)'::tid)
6495 (13 rows)
6496
6497 /*+IndexScan(p2 p2_val_id_idx)*/
6498 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6499 LOG:  available indexes for IndexScan(p2): p2_val_id_idx
6500 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_id_idx
6501 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_id_idx
6502 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_id_idx
6503 LOG:  available indexes for IndexScan(p2_c4):
6504 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx
6505 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx
6506 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_id_idx
6507 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_id_idx
6508 LOG:  pg_hint_plan:
6509 used hint:
6510 IndexScan(p2 p2_val_id_idx)
6511 not used hint:
6512 duplication hint:
6513 error hint:
6514
6515                        QUERY PLAN                       
6516 --------------------------------------------------------
6517  Append
6518    ->  Index Scan using p2_val_id_idx on p2
6519          Index Cond: ((id >= 50) AND (id <= 51))
6520          Filter: (ctid = '(1,1)'::tid)
6521    ->  Index Scan using p2_c1_val_id_idx on p2_c1
6522          Index Cond: ((id >= 50) AND (id <= 51))
6523          Filter: (ctid = '(1,1)'::tid)
6524    ->  Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1
6525          Index Cond: ((id >= 50) AND (id <= 51))
6526          Filter: (ctid = '(1,1)'::tid)
6527    ->  Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2
6528          Index Cond: ((id >= 50) AND (id <= 51))
6529          Filter: (ctid = '(1,1)'::tid)
6530 (13 rows)
6531
6532 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6533                                        QUERY PLAN                                        
6534 -----------------------------------------------------------------------------------------
6535  Append
6536    ->  Seq Scan on p2
6537          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6538    ->  Seq Scan on p2_c1
6539          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6540    ->  Seq Scan on p2_c2
6541          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6542    ->  Seq Scan on p2_c3
6543          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6544    ->  Seq Scan on p2_c4
6545          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6546    ->  Seq Scan on p2_c1_c1
6547          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6548    ->  Seq Scan on p2_c1_c2
6549          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6550    ->  Seq Scan on p2_c3_c1
6551          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6552    ->  Seq Scan on p2_c3_c2
6553          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6554 (19 rows)
6555
6556 /*+IndexScan(p2 p2_val)*/
6557 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6558 LOG:  available indexes for IndexScan(p2):
6559 LOG:  available indexes for IndexScan(p2_c1):
6560 LOG:  available indexes for IndexScan(p2_c2):
6561 LOG:  available indexes for IndexScan(p2_c3):
6562 LOG:  available indexes for IndexScan(p2_c4):
6563 LOG:  available indexes for IndexScan(p2_c1_c1):
6564 LOG:  available indexes for IndexScan(p2_c1_c2):
6565 LOG:  available indexes for IndexScan(p2_c3_c1):
6566 LOG:  available indexes for IndexScan(p2_c3_c2):
6567 LOG:  pg_hint_plan:
6568 used hint:
6569 IndexScan(p2 p2_val)
6570 not used hint:
6571 duplication hint:
6572 error hint:
6573
6574                                        QUERY PLAN                                        
6575 -----------------------------------------------------------------------------------------
6576  Append
6577    ->  Seq Scan on p2
6578          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6579    ->  Seq Scan on p2_c1
6580          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6581    ->  Seq Scan on p2_c2
6582          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6583    ->  Seq Scan on p2_c3
6584          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6585    ->  Seq Scan on p2_c4
6586          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6587    ->  Seq Scan on p2_c1_c1
6588          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6589    ->  Seq Scan on p2_c1_c2
6590          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6591    ->  Seq Scan on p2_c3_c1
6592          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6593    ->  Seq Scan on p2_c3_c2
6594          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6595 (19 rows)
6596
6597 /*+IndexScan(p2 p2_pkey)*/
6598 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6599 LOG:  available indexes for IndexScan(p2): p2_pkey
6600 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6601 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6602 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6603 LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
6604 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6605 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6606 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6607 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6608 LOG:  pg_hint_plan:
6609 used hint:
6610 IndexScan(p2 p2_pkey)
6611 not used hint:
6612 duplication hint:
6613 error hint:
6614
6615                     QUERY PLAN                    
6616 --------------------------------------------------
6617  Append
6618    ->  Index Scan using p2_pkey on p2
6619          Index Cond: ((id >= 50) AND (id <= 51))
6620          Filter: (ctid = '(1,1)'::tid)
6621    ->  Index Scan using p2_c1_pkey on p2_c1
6622          Index Cond: ((id >= 50) AND (id <= 51))
6623          Filter: (ctid = '(1,1)'::tid)
6624    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6625          Index Cond: ((id >= 50) AND (id <= 51))
6626          Filter: (ctid = '(1,1)'::tid)
6627    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6628          Index Cond: ((id >= 50) AND (id <= 51))
6629          Filter: (ctid = '(1,1)'::tid)
6630 (13 rows)
6631
6632 /*+IndexScan(p2 p2_id2_val)*/
6633 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6634 LOG:  available indexes for IndexScan(p2): p2_id2_val
6635 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id2_val
6636 LOG:  available indexes for IndexScan(p2_c2): p2_c2_id2_val
6637 LOG:  available indexes for IndexScan(p2_c3):
6638 LOG:  available indexes for IndexScan(p2_c4):
6639 LOG:  available indexes for IndexScan(p2_c1_c1):
6640 LOG:  available indexes for IndexScan(p2_c1_c2):
6641 LOG:  available indexes for IndexScan(p2_c3_c1):
6642 LOG:  available indexes for IndexScan(p2_c3_c2):
6643 LOG:  pg_hint_plan:
6644 used hint:
6645 IndexScan(p2 p2_id2_val)
6646 not used hint:
6647 duplication hint:
6648 error hint:
6649
6650                               QUERY PLAN                               
6651 -----------------------------------------------------------------------
6652  Append
6653    ->  Index Scan using p2_id2_val on p2
6654          Index Cond: ((id >= 50) AND (id <= 51))
6655          Filter: (ctid = '(1,1)'::tid)
6656    ->  Index Scan using p2_c1_id2_val on p2_c1
6657          Index Cond: ((id >= 50) AND (id <= 51))
6658          Filter: (ctid = '(1,1)'::tid)
6659    ->  Seq Scan on p2_c1_c1
6660          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6661    ->  Seq Scan on p2_c1_c2
6662          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6663 (11 rows)
6664
6665 /*+IndexScan(p2 p2_val2_id)*/
6666 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6667 LOG:  available indexes for IndexScan(p2): p2_val2_id
6668 LOG:  available indexes for IndexScan(p2_c1):
6669 LOG:  available indexes for IndexScan(p2_c2):
6670 LOG:  available indexes for IndexScan(p2_c3):
6671 LOG:  available indexes for IndexScan(p2_c4):
6672 LOG:  available indexes for IndexScan(p2_c1_c1):
6673 LOG:  available indexes for IndexScan(p2_c1_c2):
6674 LOG:  available indexes for IndexScan(p2_c3_c1):
6675 LOG:  available indexes for IndexScan(p2_c3_c2):
6676 LOG:  pg_hint_plan:
6677 used hint:
6678 IndexScan(p2 p2_val2_id)
6679 not used hint:
6680 duplication hint:
6681 error hint:
6682
6683                               QUERY PLAN                               
6684 -----------------------------------------------------------------------
6685  Append
6686    ->  Index Scan using p2_val2_id on p2
6687          Index Cond: ((id >= 50) AND (id <= 51))
6688          Filter: (ctid = '(1,1)'::tid)
6689    ->  Seq Scan on p2_c1
6690          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6691    ->  Seq Scan on p2_c1_c1
6692          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6693    ->  Seq Scan on p2_c1_c2
6694          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6695 (10 rows)
6696
6697 /*+IndexScan(p2 p2_pkey)*/
6698 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6699 LOG:  available indexes for IndexScan(p2): p2_pkey
6700 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6701 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6702 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6703 LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
6704 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6705 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6706 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6707 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6708 LOG:  pg_hint_plan:
6709 used hint:
6710 IndexScan(p2 p2_pkey)
6711 not used hint:
6712 duplication hint:
6713 error hint:
6714
6715                     QUERY PLAN                    
6716 --------------------------------------------------
6717  Append
6718    ->  Index Scan using p2_pkey on p2
6719          Index Cond: ((id >= 50) AND (id <= 51))
6720          Filter: (ctid = '(1,1)'::tid)
6721    ->  Index Scan using p2_c1_pkey on p2_c1
6722          Index Cond: ((id >= 50) AND (id <= 51))
6723          Filter: (ctid = '(1,1)'::tid)
6724    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6725          Index Cond: ((id >= 50) AND (id <= 51))
6726          Filter: (ctid = '(1,1)'::tid)
6727    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6728          Index Cond: ((id >= 50) AND (id <= 51))
6729          Filter: (ctid = '(1,1)'::tid)
6730 (13 rows)
6731
6732 /*+IndexScan(p2 p2_c1_id_val_idx)*/
6733 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6734 LOG:  available indexes for IndexScan(p2):
6735 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6736 LOG:  available indexes for IndexScan(p2_c2):
6737 LOG:  available indexes for IndexScan(p2_c3):
6738 LOG:  available indexes for IndexScan(p2_c4):
6739 LOG:  available indexes for IndexScan(p2_c1_c1):
6740 LOG:  available indexes for IndexScan(p2_c1_c2):
6741 LOG:  available indexes for IndexScan(p2_c3_c1):
6742 LOG:  available indexes for IndexScan(p2_c3_c2):
6743 LOG:  pg_hint_plan:
6744 used hint:
6745 IndexScan(p2 p2_c1_id_val_idx)
6746 not used hint:
6747 duplication hint:
6748 error hint:
6749
6750                               QUERY PLAN                               
6751 -----------------------------------------------------------------------
6752  Append
6753    ->  Seq Scan on p2
6754          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6755    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6756          Index Cond: ((id >= 50) AND (id <= 51))
6757          Filter: (ctid = '(1,1)'::tid)
6758    ->  Seq Scan on p2_c1_c1
6759          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6760    ->  Seq Scan on p2_c1_c2
6761          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6762 (10 rows)
6763
6764 /*+IndexScan(p2 no_exist)*/
6765 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6766 LOG:  available indexes for IndexScan(p2):
6767 LOG:  available indexes for IndexScan(p2_c1):
6768 LOG:  available indexes for IndexScan(p2_c2):
6769 LOG:  available indexes for IndexScan(p2_c3):
6770 LOG:  available indexes for IndexScan(p2_c4):
6771 LOG:  available indexes for IndexScan(p2_c1_c1):
6772 LOG:  available indexes for IndexScan(p2_c1_c2):
6773 LOG:  available indexes for IndexScan(p2_c3_c1):
6774 LOG:  available indexes for IndexScan(p2_c3_c2):
6775 LOG:  pg_hint_plan:
6776 used hint:
6777 IndexScan(p2 no_exist)
6778 not used hint:
6779 duplication hint:
6780 error hint:
6781
6782                               QUERY PLAN                               
6783 -----------------------------------------------------------------------
6784  Append
6785    ->  Seq Scan on p2
6786          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6787    ->  Seq Scan on p2_c1
6788          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6789    ->  Seq Scan on p2_c1_c1
6790          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6791    ->  Seq Scan on p2_c1_c2
6792          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6793 (9 rows)
6794
6795 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
6796 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6797 LOG:  available indexes for IndexScan(p2): p2_pkey
6798 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6799 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6800 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6801 LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
6802 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6803 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6804 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6805 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6806 LOG:  pg_hint_plan:
6807 used hint:
6808 IndexScan(p2 p2_pkey p2_c1_id_val_idx)
6809 not used hint:
6810 duplication hint:
6811 error hint:
6812
6813                     QUERY PLAN                    
6814 --------------------------------------------------
6815  Append
6816    ->  Index Scan using p2_pkey on p2
6817          Index Cond: ((id >= 50) AND (id <= 51))
6818          Filter: (ctid = '(1,1)'::tid)
6819    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6820          Index Cond: ((id >= 50) AND (id <= 51))
6821          Filter: (ctid = '(1,1)'::tid)
6822    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6823          Index Cond: ((id >= 50) AND (id <= 51))
6824          Filter: (ctid = '(1,1)'::tid)
6825    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6826          Index Cond: ((id >= 50) AND (id <= 51))
6827          Filter: (ctid = '(1,1)'::tid)
6828 (13 rows)
6829
6830 /*+IndexScan(p2 p2_pkey no_exist)*/
6831 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6832 LOG:  available indexes for IndexScan(p2): p2_pkey
6833 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6834 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6835 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6836 LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
6837 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6838 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6839 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6840 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6841 LOG:  pg_hint_plan:
6842 used hint:
6843 IndexScan(p2 p2_pkey no_exist)
6844 not used hint:
6845 duplication hint:
6846 error hint:
6847
6848                     QUERY PLAN                    
6849 --------------------------------------------------
6850  Append
6851    ->  Index Scan using p2_pkey on p2
6852          Index Cond: ((id >= 50) AND (id <= 51))
6853          Filter: (ctid = '(1,1)'::tid)
6854    ->  Index Scan using p2_c1_pkey on p2_c1
6855          Index Cond: ((id >= 50) AND (id <= 51))
6856          Filter: (ctid = '(1,1)'::tid)
6857    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6858          Index Cond: ((id >= 50) AND (id <= 51))
6859          Filter: (ctid = '(1,1)'::tid)
6860    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6861          Index Cond: ((id >= 50) AND (id <= 51))
6862          Filter: (ctid = '(1,1)'::tid)
6863 (13 rows)
6864
6865 /*+IndexScan(p2 p2_c1_id_val_idx no_exist)*/
6866 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6867 LOG:  available indexes for IndexScan(p2):
6868 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6869 LOG:  available indexes for IndexScan(p2_c2):
6870 LOG:  available indexes for IndexScan(p2_c3):
6871 LOG:  available indexes for IndexScan(p2_c4):
6872 LOG:  available indexes for IndexScan(p2_c1_c1):
6873 LOG:  available indexes for IndexScan(p2_c1_c2):
6874 LOG:  available indexes for IndexScan(p2_c3_c1):
6875 LOG:  available indexes for IndexScan(p2_c3_c2):
6876 LOG:  pg_hint_plan:
6877 used hint:
6878 IndexScan(p2 p2_c1_id_val_idx no_exist)
6879 not used hint:
6880 duplication hint:
6881 error hint:
6882
6883                               QUERY PLAN                               
6884 -----------------------------------------------------------------------
6885  Append
6886    ->  Seq Scan on p2
6887          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6888    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6889          Index Cond: ((id >= 50) AND (id <= 51))
6890          Filter: (ctid = '(1,1)'::tid)
6891    ->  Seq Scan on p2_c1_c1
6892          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6893    ->  Seq Scan on p2_c1_c2
6894          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6895 (10 rows)
6896
6897 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
6898 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6899 LOG:  available indexes for IndexScan(p2): p2_pkey
6900 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6901 LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
6902 LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
6903 LOG:  available indexes for IndexScan(p2_c4): p2_c4_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:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
6907 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
6908 LOG:  pg_hint_plan:
6909 used hint:
6910 IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)
6911 not used hint:
6912 duplication hint:
6913 error hint:
6914
6915                     QUERY PLAN                    
6916 --------------------------------------------------
6917  Append
6918    ->  Index Scan using p2_pkey on p2
6919          Index Cond: ((id >= 50) AND (id <= 51))
6920          Filter: (ctid = '(1,1)'::tid)
6921    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6922          Index Cond: ((id >= 50) AND (id <= 51))
6923          Filter: (ctid = '(1,1)'::tid)
6924    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6925          Index Cond: ((id >= 50) AND (id <= 51))
6926          Filter: (ctid = '(1,1)'::tid)
6927    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6928          Index Cond: ((id >= 50) AND (id <= 51))
6929          Filter: (ctid = '(1,1)'::tid)
6930 (13 rows)
6931
6932 /*+IndexScan(p2 p2_val_idx)*/
6933 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6934 LOG:  available indexes for IndexScan(p2): p2_val_idx
6935 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx
6936 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx
6937 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx
6938 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx
6939 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx
6940 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx
6941 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx
6942 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx
6943 LOG:  pg_hint_plan:
6944 used hint:
6945 IndexScan(p2 p2_val_idx)
6946 not used hint:
6947 duplication hint:
6948 error hint:
6949
6950                             QUERY PLAN                             
6951 -------------------------------------------------------------------
6952  Append
6953    ->  Index Scan using p2_val_idx on p2
6954          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6955          Filter: (ctid = '(1,1)'::tid)
6956    ->  Index Scan using p2_c1_val_idx on p2_c1
6957          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6958          Filter: (ctid = '(1,1)'::tid)
6959    ->  Index Scan using p2_c2_val_idx on p2_c2
6960          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6961          Filter: (ctid = '(1,1)'::tid)
6962    ->  Index Scan using p2_c3_val_idx on p2_c3
6963          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6964          Filter: (ctid = '(1,1)'::tid)
6965    ->  Index Scan using p2_c4_val_idx on p2_c4
6966          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6967          Filter: (ctid = '(1,1)'::tid)
6968    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
6969          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6970          Filter: (ctid = '(1,1)'::tid)
6971    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
6972          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6973          Filter: (ctid = '(1,1)'::tid)
6974    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
6975          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6976          Filter: (ctid = '(1,1)'::tid)
6977    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
6978          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6979          Filter: (ctid = '(1,1)'::tid)
6980 (28 rows)
6981
6982 /*+IndexScan(p2 p2_expr)*/
6983 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6984 LOG:  available indexes for IndexScan(p2): p2_expr
6985 LOG:  available indexes for IndexScan(p2_c1): p2_c1_expr_idx
6986 LOG:  available indexes for IndexScan(p2_c2): p2_c2_expr_idx
6987 LOG:  available indexes for IndexScan(p2_c3): p2_c3_expr_idx
6988 LOG:  available indexes for IndexScan(p2_c4): p2_c4_expr_idx
6989 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_expr_idx
6990 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_expr_idx
6991 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_expr_idx
6992 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_expr_idx
6993 LOG:  pg_hint_plan:
6994 used hint:
6995 IndexScan(p2 p2_expr)
6996 not used hint:
6997 duplication hint:
6998 error hint:
6999
7000                                        QUERY PLAN                                        
7001 -----------------------------------------------------------------------------------------
7002  Append
7003    ->  Seq Scan on p2
7004          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7005    ->  Seq Scan on p2_c1
7006          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7007    ->  Seq Scan on p2_c2
7008          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7009    ->  Seq Scan on p2_c3
7010          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7011    ->  Seq Scan on p2_c4
7012          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7013    ->  Seq Scan on p2_c1_c1
7014          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7015    ->  Seq Scan on p2_c1_c2
7016          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7017    ->  Seq Scan on p2_c3_c1
7018          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7019    ->  Seq Scan on p2_c3_c2
7020          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7021 (19 rows)
7022
7023 /*+IndexScan(p2 p2_val_idx6)*/
7024 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7025 LOG:  available indexes for IndexScan(p2): p2_val_idx6
7026 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6
7027 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6
7028 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6
7029 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6
7030 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6
7031 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6
7032 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6
7033 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6
7034 LOG:  pg_hint_plan:
7035 used hint:
7036 IndexScan(p2 p2_val_idx6)
7037 not used hint:
7038 duplication hint:
7039 error hint:
7040
7041                                        QUERY PLAN                                        
7042 -----------------------------------------------------------------------------------------
7043  Append
7044    ->  Seq Scan on p2
7045          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7046    ->  Seq Scan on p2_c1
7047          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7048    ->  Seq Scan on p2_c2
7049          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7050    ->  Seq Scan on p2_c3
7051          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7052    ->  Seq Scan on p2_c4
7053          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7054    ->  Seq Scan on p2_c1_c1
7055          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7056    ->  Seq Scan on p2_c1_c2
7057          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7058    ->  Seq Scan on p2_c3_c1
7059          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7060    ->  Seq Scan on p2_c3_c2
7061          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7062 (19 rows)
7063
7064 /*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
7065 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7066 LOG:  available indexes for IndexScan(p2): p2_val_idx6 p2_val_idx
7067 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6 p2_c1_val_idx
7068 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6 p2_c2_val_idx
7069 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6 p2_c3_val_idx
7070 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6 p2_c4_val_idx
7071 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6 p2_c1_c1_val_idx
7072 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6 p2_c1_c2_val_idx
7073 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6 p2_c3_c1_val_idx
7074 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6 p2_c3_c2_val_idx
7075 LOG:  pg_hint_plan:
7076 used hint:
7077 IndexScan(p2 p2_val_idx p2_val_idx6)
7078 not used hint:
7079 duplication hint:
7080 error hint:
7081
7082                             QUERY PLAN                             
7083 -------------------------------------------------------------------
7084  Append
7085    ->  Index Scan using p2_val_idx on p2
7086          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7087          Filter: (ctid = '(1,1)'::tid)
7088    ->  Index Scan using p2_c1_val_idx on p2_c1
7089          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7090          Filter: (ctid = '(1,1)'::tid)
7091    ->  Index Scan using p2_c2_val_idx on p2_c2
7092          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7093          Filter: (ctid = '(1,1)'::tid)
7094    ->  Index Scan using p2_c3_val_idx on p2_c3
7095          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7096          Filter: (ctid = '(1,1)'::tid)
7097    ->  Index Scan using p2_c4_val_idx on p2_c4
7098          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7099          Filter: (ctid = '(1,1)'::tid)
7100    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
7101          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7102          Filter: (ctid = '(1,1)'::tid)
7103    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
7104          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7105          Filter: (ctid = '(1,1)'::tid)
7106    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
7107          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7108          Filter: (ctid = '(1,1)'::tid)
7109    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
7110          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7111          Filter: (ctid = '(1,1)'::tid)
7112 (28 rows)
7113
7114 -- regular expression
7115 -- ordinary table
7116 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7117                                          QUERY PLAN                                          
7118 ---------------------------------------------------------------------------------------------
7119  Index Only Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
7120    Index Cond: (id = 1)
7121 (2 rows)
7122
7123 /*+ IndexScanRegexp(t5 t5_[^i].*)*/
7124 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7125 LOG:  available indexes for IndexScanRegexp(t5): t5_val t5_pkey
7126 LOG:  pg_hint_plan:
7127 used hint:
7128 IndexScanRegexp(t5 t5_[^i].*)
7129 not used hint:
7130 duplication hint:
7131 error hint:
7132
7133            QUERY PLAN           
7134 --------------------------------
7135  Index Scan using t5_pkey on t5
7136    Index Cond: (id = 1)
7137 (2 rows)
7138
7139 /*+ IndexScanRegexp(t5 t5_id[0-9].*)*/
7140 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7141 LOG:  available indexes for IndexScanRegexp(t5): t5_id3 t5_id2 t5_id1
7142 LOG:  pg_hint_plan:
7143 used hint:
7144 IndexScanRegexp(t5 t5_id[0-9].*)
7145 not used hint:
7146 duplication hint:
7147 error hint:
7148
7149           QUERY PLAN           
7150 -------------------------------
7151  Index Scan using t5_id3 on t5
7152    Index Cond: (id = 1)
7153 (2 rows)
7154
7155 /*+ IndexScanRegexp(t5 t5[^_].*)*/
7156 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7157 LOG:  available indexes for IndexScanRegexp(t5):
7158 LOG:  pg_hint_plan:
7159 used hint:
7160 IndexScanRegexp(t5 t5[^_].*)
7161 not used hint:
7162 duplication hint:
7163 error hint:
7164
7165      QUERY PLAN     
7166 --------------------
7167  Seq Scan on t5
7168    Filter: (id = 1)
7169 (2 rows)
7170
7171 /*+ IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7172 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7173 LOG:  available indexes for IndexScanRegexp(t5):
7174 LOG:  pg_hint_plan:
7175 used hint:
7176 IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7177 not used hint:
7178 duplication hint:
7179 error hint:
7180
7181      QUERY PLAN     
7182 --------------------
7183  Seq Scan on t5
7184    Filter: (id = 1)
7185 (2 rows)
7186
7187 /*+ IndexScan(t5 t5_id[0-9].*)*/
7188 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7189 LOG:  available indexes for IndexScan(t5):
7190 LOG:  pg_hint_plan:
7191 used hint:
7192 IndexScan(t5 t5_id[0-9].*)
7193 not used hint:
7194 duplication hint:
7195 error hint:
7196
7197      QUERY PLAN     
7198 --------------------
7199  Seq Scan on t5
7200    Filter: (id = 1)
7201 (2 rows)
7202
7203 /*+ IndexOnlyScanRegexp(t5 t5_[^i].*)*/
7204 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7205 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_val t5_pkey
7206 LOG:  pg_hint_plan:
7207 used hint:
7208 IndexOnlyScanRegexp(t5 t5_[^i].*)
7209 not used hint:
7210 duplication hint:
7211 error hint:
7212
7213              QUERY PLAN              
7214 -------------------------------------
7215  Index Only Scan using t5_pkey on t5
7216    Index Cond: (id = 1)
7217 (2 rows)
7218
7219 /*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
7220 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7221 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_id3 t5_id2 t5_id1
7222 LOG:  pg_hint_plan:
7223 used hint:
7224 IndexOnlyScanRegexp(t5 t5_id[0-9].*)
7225 not used hint:
7226 duplication hint:
7227 error hint:
7228
7229              QUERY PLAN             
7230 ------------------------------------
7231  Index Only Scan using t5_id3 on t5
7232    Index Cond: (id = 1)
7233 (2 rows)
7234
7235 /*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
7236 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7237 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7238 LOG:  pg_hint_plan:
7239 used hint:
7240 IndexOnlyScanRegexp(t5 t5[^_].*)
7241 not used hint:
7242 duplication hint:
7243 error hint:
7244
7245      QUERY PLAN     
7246 --------------------
7247  Seq Scan on t5
7248    Filter: (id = 1)
7249 (2 rows)
7250
7251 /*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7252 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7253 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7254 LOG:  pg_hint_plan:
7255 used hint:
7256 IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7257 not used hint:
7258 duplication hint:
7259 error hint:
7260
7261      QUERY PLAN     
7262 --------------------
7263  Seq Scan on t5
7264    Filter: (id = 1)
7265 (2 rows)
7266
7267 /*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
7268 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7269 LOG:  available indexes for IndexOnlyScan(t5):
7270 LOG:  pg_hint_plan:
7271 used hint:
7272 IndexOnlyScan(t5 t5_id[0-9].*)
7273 not used hint:
7274 duplication hint:
7275 error hint:
7276
7277      QUERY PLAN     
7278 --------------------
7279  Seq Scan on t5
7280    Filter: (id = 1)
7281 (2 rows)
7282
7283 /*+ BitmapScanRegexp(t5 t5_[^i].*)*/
7284 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7285 LOG:  available indexes for BitmapScanRegexp(t5): t5_val t5_pkey
7286 LOG:  pg_hint_plan:
7287 used hint:
7288 BitmapScanRegexp(t5 t5_[^i].*)
7289 not used hint:
7290 duplication hint:
7291 error hint:
7292
7293              QUERY PLAN             
7294 ------------------------------------
7295  Bitmap Heap Scan on t5
7296    Recheck Cond: (id = 1)
7297    ->  Bitmap Index Scan on t5_pkey
7298          Index Cond: (id = 1)
7299 (4 rows)
7300
7301 /*+ BitmapScanRegexp(t5 t5_id[0-9].*)*/
7302 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7303 LOG:  available indexes for BitmapScanRegexp(t5): t5_id3 t5_id2 t5_id1
7304 LOG:  pg_hint_plan:
7305 used hint:
7306 BitmapScanRegexp(t5 t5_id[0-9].*)
7307 not used hint:
7308 duplication hint:
7309 error hint:
7310
7311             QUERY PLAN             
7312 -----------------------------------
7313  Bitmap Heap Scan on t5
7314    Recheck Cond: (id = 1)
7315    ->  Bitmap Index Scan on t5_id3
7316          Index Cond: (id = 1)
7317 (4 rows)
7318
7319 /*+ BitmapScanRegexp(t5 t5[^_].*)*/
7320 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7321 LOG:  available indexes for BitmapScanRegexp(t5):
7322 LOG:  pg_hint_plan:
7323 used hint:
7324 BitmapScanRegexp(t5 t5[^_].*)
7325 not used hint:
7326 duplication hint:
7327 error hint:
7328
7329      QUERY PLAN     
7330 --------------------
7331  Seq Scan on t5
7332    Filter: (id = 1)
7333 (2 rows)
7334
7335 /*+ BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7336 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7337 LOG:  available indexes for BitmapScanRegexp(t5):
7338 LOG:  pg_hint_plan:
7339 used hint:
7340 BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7341 not used hint:
7342 duplication hint:
7343 error hint:
7344
7345      QUERY PLAN     
7346 --------------------
7347  Seq Scan on t5
7348    Filter: (id = 1)
7349 (2 rows)
7350
7351 /*+ BitmapScan(t5 t5_id[0-9].*)*/
7352 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7353 LOG:  available indexes for BitmapScan(t5):
7354 LOG:  pg_hint_plan:
7355 used hint:
7356 BitmapScan(t5 t5_id[0-9].*)
7357 not used hint:
7358 duplication hint:
7359 error hint:
7360
7361      QUERY PLAN     
7362 --------------------
7363  Seq Scan on t5
7364    Filter: (id = 1)
7365 (2 rows)
7366
7367 -- Inheritance
7368 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7369          QUERY PLAN         
7370 ----------------------------
7371  Append
7372    ->  Seq Scan on p1
7373          Filter: (val = 1)
7374    ->  Seq Scan on p1_c1
7375          Filter: (val = 1)
7376    ->  Seq Scan on p1_c2
7377          Filter: (val = 1)
7378    ->  Seq Scan on p1_c3
7379          Filter: (val = 1)
7380    ->  Seq Scan on p1_c4
7381          Filter: (val = 1)
7382    ->  Seq Scan on p1_c1_c1
7383          Filter: (val = 1)
7384    ->  Seq Scan on p1_c1_c2
7385          Filter: (val = 1)
7386    ->  Seq Scan on p1_c3_c1
7387          Filter: (val = 1)
7388    ->  Seq Scan on p1_c3_c2
7389          Filter: (val = 1)
7390 (19 rows)
7391
7392 /*+ IndexScanRegexp(p1 p1_.*[^0-9]$)*/
7393 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7394 LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
7395 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_pkey
7396 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_pkey
7397 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_pkey
7398 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_pkey
7399 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7400 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7401 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7402 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7403 LOG:  pg_hint_plan:
7404 used hint:
7405 IndexScanRegexp(p1 p1_.*[^0-9]$)
7406 not used hint:
7407 duplication hint:
7408 error hint:
7409
7410          QUERY PLAN         
7411 ----------------------------
7412  Append
7413    ->  Seq Scan on p1
7414          Filter: (val = 1)
7415    ->  Seq Scan on p1_c1
7416          Filter: (val = 1)
7417    ->  Seq Scan on p1_c2
7418          Filter: (val = 1)
7419    ->  Seq Scan on p1_c3
7420          Filter: (val = 1)
7421    ->  Seq Scan on p1_c4
7422          Filter: (val = 1)
7423    ->  Seq Scan on p1_c1_c1
7424          Filter: (val = 1)
7425    ->  Seq Scan on p1_c1_c2
7426          Filter: (val = 1)
7427    ->  Seq Scan on p1_c3_c1
7428          Filter: (val = 1)
7429    ->  Seq Scan on p1_c3_c2
7430          Filter: (val = 1)
7431 (19 rows)
7432
7433 /*+ IndexScanRegexp(p1 p1_.*val2.*)*/
7434 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7435 LOG:  available indexes for IndexScanRegexp(p1): p1_val2
7436 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_val2
7437 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_val2
7438 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_val2
7439 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_val2
7440 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_val2
7441 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_val2
7442 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_val2
7443 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_val2
7444 LOG:  pg_hint_plan:
7445 used hint:
7446 IndexScanRegexp(p1 p1_.*val2.*)
7447 not used hint:
7448 duplication hint:
7449 error hint:
7450
7451                     QUERY PLAN                    
7452 --------------------------------------------------
7453  Append
7454    ->  Index Scan using p1_val2 on p1
7455          Index Cond: (val = 1)
7456    ->  Index Scan using p1_c1_val2 on p1_c1
7457          Index Cond: (val = 1)
7458    ->  Index Scan using p1_c2_val2 on p1_c2
7459          Index Cond: (val = 1)
7460    ->  Index Scan using p1_c3_val2 on p1_c3
7461          Index Cond: (val = 1)
7462    ->  Index Scan using p1_c4_val2 on p1_c4
7463          Index Cond: (val = 1)
7464    ->  Index Scan using p1_c1_c1_val2 on p1_c1_c1
7465          Index Cond: (val = 1)
7466    ->  Index Scan using p1_c1_c2_val2 on p1_c1_c2
7467          Index Cond: (val = 1)
7468    ->  Index Scan using p1_c3_c1_val2 on p1_c3_c1
7469          Index Cond: (val = 1)
7470    ->  Index Scan using p1_c3_c2_val2 on p1_c3_c2
7471          Index Cond: (val = 1)
7472 (19 rows)
7473
7474 /*+ IndexScanRegexp(p1 p1[^_].*)*/
7475 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7476 LOG:  available indexes for IndexScanRegexp(p1):
7477 LOG:  available indexes for IndexScanRegexp(p1_c1):
7478 LOG:  available indexes for IndexScanRegexp(p1_c2):
7479 LOG:  available indexes for IndexScanRegexp(p1_c3):
7480 LOG:  available indexes for IndexScanRegexp(p1_c4):
7481 LOG:  available indexes for IndexScanRegexp(p1_c1_c1):
7482 LOG:  available indexes for IndexScanRegexp(p1_c1_c2):
7483 LOG:  available indexes for IndexScanRegexp(p1_c3_c1):
7484 LOG:  available indexes for IndexScanRegexp(p1_c3_c2):
7485 LOG:  pg_hint_plan:
7486 used hint:
7487 IndexScanRegexp(p1 p1[^_].*)
7488 not used hint:
7489 duplication hint:
7490 error hint:
7491
7492          QUERY PLAN         
7493 ----------------------------
7494  Append
7495    ->  Seq Scan on p1
7496          Filter: (val = 1)
7497    ->  Seq Scan on p1_c1
7498          Filter: (val = 1)
7499    ->  Seq Scan on p1_c2
7500          Filter: (val = 1)
7501    ->  Seq Scan on p1_c3
7502          Filter: (val = 1)
7503    ->  Seq Scan on p1_c4
7504          Filter: (val = 1)
7505    ->  Seq Scan on p1_c1_c1
7506          Filter: (val = 1)
7507    ->  Seq Scan on p1_c1_c2
7508          Filter: (val = 1)
7509    ->  Seq Scan on p1_c3_c1
7510          Filter: (val = 1)
7511    ->  Seq Scan on p1_c3_c2
7512          Filter: (val = 1)
7513 (19 rows)
7514
7515 /*+ IndexScan(p1 p1_.*val2.*)*/
7516 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7517 LOG:  available indexes for IndexScan(p1):
7518 LOG:  available indexes for IndexScan(p1_c1):
7519 LOG:  available indexes for IndexScan(p1_c2):
7520 LOG:  available indexes for IndexScan(p1_c3):
7521 LOG:  available indexes for IndexScan(p1_c4):
7522 LOG:  available indexes for IndexScan(p1_c1_c1):
7523 LOG:  available indexes for IndexScan(p1_c1_c2):
7524 LOG:  available indexes for IndexScan(p1_c3_c1):
7525 LOG:  available indexes for IndexScan(p1_c3_c2):
7526 LOG:  pg_hint_plan:
7527 used hint:
7528 IndexScan(p1 p1_.*val2.*)
7529 not used hint:
7530 duplication hint:
7531 error hint:
7532
7533          QUERY PLAN         
7534 ----------------------------
7535  Append
7536    ->  Seq Scan on p1
7537          Filter: (val = 1)
7538    ->  Seq Scan on p1_c1
7539          Filter: (val = 1)
7540    ->  Seq Scan on p1_c2
7541          Filter: (val = 1)
7542    ->  Seq Scan on p1_c3
7543          Filter: (val = 1)
7544    ->  Seq Scan on p1_c4
7545          Filter: (val = 1)
7546    ->  Seq Scan on p1_c1_c1
7547          Filter: (val = 1)
7548    ->  Seq Scan on p1_c1_c2
7549          Filter: (val = 1)
7550    ->  Seq Scan on p1_c3_c1
7551          Filter: (val = 1)
7552    ->  Seq Scan on p1_c3_c2
7553          Filter: (val = 1)
7554 (19 rows)
7555
7556 /*+ IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)*/
7557 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7558 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_pkey
7559 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_pkey
7560 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_pkey
7561 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_pkey
7562 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_pkey
7563 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7564 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7565 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7566 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7567 LOG:  pg_hint_plan:
7568 used hint:
7569 IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)
7570 not used hint:
7571 duplication hint:
7572 error hint:
7573
7574          QUERY PLAN         
7575 ----------------------------
7576  Append
7577    ->  Seq Scan on p1
7578          Filter: (val = 1)
7579    ->  Seq Scan on p1_c1
7580          Filter: (val = 1)
7581    ->  Seq Scan on p1_c2
7582          Filter: (val = 1)
7583    ->  Seq Scan on p1_c3
7584          Filter: (val = 1)
7585    ->  Seq Scan on p1_c4
7586          Filter: (val = 1)
7587    ->  Seq Scan on p1_c1_c1
7588          Filter: (val = 1)
7589    ->  Seq Scan on p1_c1_c2
7590          Filter: (val = 1)
7591    ->  Seq Scan on p1_c3_c1
7592          Filter: (val = 1)
7593    ->  Seq Scan on p1_c3_c2
7594          Filter: (val = 1)
7595 (19 rows)
7596
7597 /*+ IndexOnlyScanRegexp(p1 p1_.*val2.*)*/
7598 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7599 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_val2
7600 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_val2
7601 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_val2
7602 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_val2
7603 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_val2
7604 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_val2
7605 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_val2
7606 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_val2
7607 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_val2
7608 LOG:  pg_hint_plan:
7609 used hint:
7610 IndexOnlyScanRegexp(p1 p1_.*val2.*)
7611 not used hint:
7612 duplication hint:
7613 error hint:
7614
7615                       QUERY PLAN                       
7616 -------------------------------------------------------
7617  Append
7618    ->  Index Only Scan using p1_val2 on p1
7619          Index Cond: (val = 1)
7620    ->  Index Only Scan using p1_c1_val2 on p1_c1
7621          Index Cond: (val = 1)
7622    ->  Index Only Scan using p1_c2_val2 on p1_c2
7623          Index Cond: (val = 1)
7624    ->  Index Only Scan using p1_c3_val2 on p1_c3
7625          Index Cond: (val = 1)
7626    ->  Index Only Scan using p1_c4_val2 on p1_c4
7627          Index Cond: (val = 1)
7628    ->  Index Only Scan using p1_c1_c1_val2 on p1_c1_c1
7629          Index Cond: (val = 1)
7630    ->  Index Only Scan using p1_c1_c2_val2 on p1_c1_c2
7631          Index Cond: (val = 1)
7632    ->  Index Only Scan using p1_c3_c1_val2 on p1_c3_c1
7633          Index Cond: (val = 1)
7634    ->  Index Only Scan using p1_c3_c2_val2 on p1_c3_c2
7635          Index Cond: (val = 1)
7636 (19 rows)
7637
7638 /*+ IndexOnlyScanRegexp(p1 p1[^_].*)*/
7639 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7640 LOG:  available indexes for IndexOnlyScanRegexp(p1):
7641 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1):
7642 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2):
7643 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3):
7644 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4):
7645 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1):
7646 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2):
7647 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1):
7648 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2):
7649 LOG:  pg_hint_plan:
7650 used hint:
7651 IndexOnlyScanRegexp(p1 p1[^_].*)
7652 not used hint:
7653 duplication hint:
7654 error hint:
7655
7656          QUERY PLAN         
7657 ----------------------------
7658  Append
7659    ->  Seq Scan on p1
7660          Filter: (val = 1)
7661    ->  Seq Scan on p1_c1
7662          Filter: (val = 1)
7663    ->  Seq Scan on p1_c2
7664          Filter: (val = 1)
7665    ->  Seq Scan on p1_c3
7666          Filter: (val = 1)
7667    ->  Seq Scan on p1_c4
7668          Filter: (val = 1)
7669    ->  Seq Scan on p1_c1_c1
7670          Filter: (val = 1)
7671    ->  Seq Scan on p1_c1_c2
7672          Filter: (val = 1)
7673    ->  Seq Scan on p1_c3_c1
7674          Filter: (val = 1)
7675    ->  Seq Scan on p1_c3_c2
7676          Filter: (val = 1)
7677 (19 rows)
7678
7679 /*+ IndexOnlyScan(p1 p1_.*val2.*)*/
7680 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7681 LOG:  available indexes for IndexOnlyScan(p1):
7682 LOG:  available indexes for IndexOnlyScan(p1_c1):
7683 LOG:  available indexes for IndexOnlyScan(p1_c2):
7684 LOG:  available indexes for IndexOnlyScan(p1_c3):
7685 LOG:  available indexes for IndexOnlyScan(p1_c4):
7686 LOG:  available indexes for IndexOnlyScan(p1_c1_c1):
7687 LOG:  available indexes for IndexOnlyScan(p1_c1_c2):
7688 LOG:  available indexes for IndexOnlyScan(p1_c3_c1):
7689 LOG:  available indexes for IndexOnlyScan(p1_c3_c2):
7690 LOG:  pg_hint_plan:
7691 used hint:
7692 IndexOnlyScan(p1 p1_.*val2.*)
7693 not used hint:
7694 duplication hint:
7695 error hint:
7696
7697          QUERY PLAN         
7698 ----------------------------
7699  Append
7700    ->  Seq Scan on p1
7701          Filter: (val = 1)
7702    ->  Seq Scan on p1_c1
7703          Filter: (val = 1)
7704    ->  Seq Scan on p1_c2
7705          Filter: (val = 1)
7706    ->  Seq Scan on p1_c3
7707          Filter: (val = 1)
7708    ->  Seq Scan on p1_c4
7709          Filter: (val = 1)
7710    ->  Seq Scan on p1_c1_c1
7711          Filter: (val = 1)
7712    ->  Seq Scan on p1_c1_c2
7713          Filter: (val = 1)
7714    ->  Seq Scan on p1_c3_c1
7715          Filter: (val = 1)
7716    ->  Seq Scan on p1_c3_c2
7717          Filter: (val = 1)
7718 (19 rows)
7719
7720 /*+ BitmapScanRegexp(p1 p1_.*[^0-9]$)*/
7721 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7722 LOG:  available indexes for BitmapScanRegexp(p1): p1_pkey
7723 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_pkey
7724 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_pkey
7725 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_pkey
7726 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_pkey
7727 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7728 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7729 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7730 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7731 LOG:  pg_hint_plan:
7732 used hint:
7733 BitmapScanRegexp(p1 p1_.*[^0-9]$)
7734 not used hint:
7735 duplication hint:
7736 error hint:
7737
7738          QUERY PLAN         
7739 ----------------------------
7740  Append
7741    ->  Seq Scan on p1
7742          Filter: (val = 1)
7743    ->  Seq Scan on p1_c1
7744          Filter: (val = 1)
7745    ->  Seq Scan on p1_c2
7746          Filter: (val = 1)
7747    ->  Seq Scan on p1_c3
7748          Filter: (val = 1)
7749    ->  Seq Scan on p1_c4
7750          Filter: (val = 1)
7751    ->  Seq Scan on p1_c1_c1
7752          Filter: (val = 1)
7753    ->  Seq Scan on p1_c1_c2
7754          Filter: (val = 1)
7755    ->  Seq Scan on p1_c3_c1
7756          Filter: (val = 1)
7757    ->  Seq Scan on p1_c3_c2
7758          Filter: (val = 1)
7759 (19 rows)
7760
7761 /*+ BitmapScanRegexp(p1 p1_.*val2.*)*/
7762 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7763 LOG:  available indexes for BitmapScanRegexp(p1): p1_val2
7764 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_val2
7765 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_val2
7766 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_val2
7767 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_val2
7768 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_val2
7769 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_val2
7770 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_val2
7771 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_val2
7772 LOG:  pg_hint_plan:
7773 used hint:
7774 BitmapScanRegexp(p1 p1_.*val2.*)
7775 not used hint:
7776 duplication hint:
7777 error hint:
7778
7779                    QUERY PLAN                   
7780 ------------------------------------------------
7781  Append
7782    ->  Bitmap Heap Scan on p1
7783          Recheck Cond: (val = 1)
7784          ->  Bitmap Index Scan on p1_val2
7785                Index Cond: (val = 1)
7786    ->  Bitmap Heap Scan on p1_c1
7787          Recheck Cond: (val = 1)
7788          ->  Bitmap Index Scan on p1_c1_val2
7789                Index Cond: (val = 1)
7790    ->  Bitmap Heap Scan on p1_c2
7791          Recheck Cond: (val = 1)
7792          ->  Bitmap Index Scan on p1_c2_val2
7793                Index Cond: (val = 1)
7794    ->  Bitmap Heap Scan on p1_c3
7795          Recheck Cond: (val = 1)
7796          ->  Bitmap Index Scan on p1_c3_val2
7797                Index Cond: (val = 1)
7798    ->  Bitmap Heap Scan on p1_c4
7799          Recheck Cond: (val = 1)
7800          ->  Bitmap Index Scan on p1_c4_val2
7801                Index Cond: (val = 1)
7802    ->  Bitmap Heap Scan on p1_c1_c1
7803          Recheck Cond: (val = 1)
7804          ->  Bitmap Index Scan on p1_c1_c1_val2
7805                Index Cond: (val = 1)
7806    ->  Bitmap Heap Scan on p1_c1_c2
7807          Recheck Cond: (val = 1)
7808          ->  Bitmap Index Scan on p1_c1_c2_val2
7809                Index Cond: (val = 1)
7810    ->  Bitmap Heap Scan on p1_c3_c1
7811          Recheck Cond: (val = 1)
7812          ->  Bitmap Index Scan on p1_c3_c1_val2
7813                Index Cond: (val = 1)
7814    ->  Bitmap Heap Scan on p1_c3_c2
7815          Recheck Cond: (val = 1)
7816          ->  Bitmap Index Scan on p1_c3_c2_val2
7817                Index Cond: (val = 1)
7818 (37 rows)
7819
7820 /*+ BitmapScanRegexp(p1 p1[^_].*)*/
7821 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7822 LOG:  available indexes for BitmapScanRegexp(p1):
7823 LOG:  available indexes for BitmapScanRegexp(p1_c1):
7824 LOG:  available indexes for BitmapScanRegexp(p1_c2):
7825 LOG:  available indexes for BitmapScanRegexp(p1_c3):
7826 LOG:  available indexes for BitmapScanRegexp(p1_c4):
7827 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1):
7828 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2):
7829 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1):
7830 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2):
7831 LOG:  pg_hint_plan:
7832 used hint:
7833 BitmapScanRegexp(p1 p1[^_].*)
7834 not used hint:
7835 duplication hint:
7836 error hint:
7837
7838          QUERY PLAN         
7839 ----------------------------
7840  Append
7841    ->  Seq Scan on p1
7842          Filter: (val = 1)
7843    ->  Seq Scan on p1_c1
7844          Filter: (val = 1)
7845    ->  Seq Scan on p1_c2
7846          Filter: (val = 1)
7847    ->  Seq Scan on p1_c3
7848          Filter: (val = 1)
7849    ->  Seq Scan on p1_c4
7850          Filter: (val = 1)
7851    ->  Seq Scan on p1_c1_c1
7852          Filter: (val = 1)
7853    ->  Seq Scan on p1_c1_c2
7854          Filter: (val = 1)
7855    ->  Seq Scan on p1_c3_c1
7856          Filter: (val = 1)
7857    ->  Seq Scan on p1_c3_c2
7858          Filter: (val = 1)
7859 (19 rows)
7860
7861 /*+ BitmapScan(p1 p1_.*val2.*)*/
7862 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7863 LOG:  available indexes for BitmapScan(p1):
7864 LOG:  available indexes for BitmapScan(p1_c1):
7865 LOG:  available indexes for BitmapScan(p1_c2):
7866 LOG:  available indexes for BitmapScan(p1_c3):
7867 LOG:  available indexes for BitmapScan(p1_c4):
7868 LOG:  available indexes for BitmapScan(p1_c1_c1):
7869 LOG:  available indexes for BitmapScan(p1_c1_c2):
7870 LOG:  available indexes for BitmapScan(p1_c3_c1):
7871 LOG:  available indexes for BitmapScan(p1_c3_c2):
7872 LOG:  pg_hint_plan:
7873 used hint:
7874 BitmapScan(p1 p1_.*val2.*)
7875 not used hint:
7876 duplication hint:
7877 error hint:
7878
7879          QUERY PLAN         
7880 ----------------------------
7881  Append
7882    ->  Seq Scan on p1
7883          Filter: (val = 1)
7884    ->  Seq Scan on p1_c1
7885          Filter: (val = 1)
7886    ->  Seq Scan on p1_c2
7887          Filter: (val = 1)
7888    ->  Seq Scan on p1_c3
7889          Filter: (val = 1)
7890    ->  Seq Scan on p1_c4
7891          Filter: (val = 1)
7892    ->  Seq Scan on p1_c1_c1
7893          Filter: (val = 1)
7894    ->  Seq Scan on p1_c1_c2
7895          Filter: (val = 1)
7896    ->  Seq Scan on p1_c3_c1
7897          Filter: (val = 1)
7898    ->  Seq Scan on p1_c3_c2
7899          Filter: (val = 1)
7900 (19 rows)
7901
7902 -- search from hint table
7903 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7904 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
7905 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
7906 SELECT * FROM hint_plan.hints ORDER BY id;
7907  id |                    norm_query_string                     | application_name |     hints      
7908 ----+----------------------------------------------------------+------------------+----------------
7909   1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;  |                  | SeqScan(t1)
7910   2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; |                  | IndexScan(t1)
7911   3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;                |                  | BitmapScan(t1)
7912 (3 rows)
7913
7914 SET pg_hint_plan.enable_hint_table = on;
7915 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7916 LOG:  pg_hint_plan:
7917 used hint:
7918 SeqScan(t1)
7919 not used hint:
7920 duplication hint:
7921 error hint:
7922
7923      QUERY PLAN     
7924 --------------------
7925  Seq Scan on t1
7926    Filter: (id = 1)
7927 (2 rows)
7928
7929 SET pg_hint_plan.enable_hint_table = off;
7930 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7931            QUERY PLAN           
7932 --------------------------------
7933  Index Scan using t1_pkey on t1
7934    Index Cond: (id = 1)
7935 (2 rows)
7936
7937 TRUNCATE hint_plan.hints;
7938 VACUUM ANALYZE hint_plan.hints;
7939 -- plpgsql test
7940 EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = 1;
7941              QUERY PLAN              
7942 -------------------------------------
7943  Index Only Scan using t1_pkey on t1
7944    Index Cond: (id = 1)
7945 (2 rows)
7946
7947 -- static function
7948 CREATE FUNCTION testfunc() RETURNS RECORD AS $$
7949 DECLARE
7950   ret record;
7951 BEGIN
7952   SELECT /*+ SeqScan(t1) */ * INTO ret FROM t1 LIMIT 1;
7953   RETURN ret;
7954 END;
7955 $$ LANGUAGE plpgsql;
7956 SELECT testfunc();
7957 LOG:  pg_hint_plan:
7958 used hint:
7959 SeqScan(t1)
7960 not used hint:
7961 duplication hint:
7962 error hint:
7963
7964 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ *          FROM t1 LIMIT 1"
7965 PL/pgSQL function testfunc() line 5 at SQL statement
7966  testfunc 
7967 ----------
7968  (1,1)
7969 (1 row)
7970
7971 -- dynamic function
7972 DROP FUNCTION testfunc();
7973 CREATE FUNCTION testfunc() RETURNS void AS $$
7974 BEGIN
7975   EXECUTE format('/*+ SeqScan(t1) */ SELECT * FROM t1');
7976 END;
7977 $$ LANGUAGE plpgsql;
7978 SELECT testfunc();
7979 LOG:  pg_hint_plan:
7980 used hint:
7981 SeqScan(t1)
7982 not used hint:
7983 duplication hint:
7984 error hint:
7985
7986 CONTEXT:  SQL statement "/*+ SeqScan(t1) */ SELECT * FROM t1"
7987 PL/pgSQL function testfunc() line 3 at EXECUTE
7988  testfunc 
7989 ----------
7990  
7991 (1 row)
7992
7993 -- This should not use SeqScan(t1)
7994 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
7995 LOG:  pg_hint_plan:
7996 used hint:
7997 IndexScan(t1)
7998 not used hint:
7999 duplication hint:
8000 error hint:
8001
8002  id | val 
8003 ----+-----
8004   1 |   1
8005 (1 row)
8006
8007 -- Perform
8008 DROP FUNCTION testfunc();
8009 CREATE FUNCTION testfunc() RETURNS void AS $$
8010 BEGIN
8011   PERFORM  1, /*+ SeqScan(t1) */ * from t1;
8012 END;
8013 $$ LANGUAGE plpgsql;
8014 SELECT testfunc();
8015 LOG:  pg_hint_plan:
8016 used hint:
8017 SeqScan(t1)
8018 not used hint:
8019 duplication hint:
8020 error hint:
8021
8022 CONTEXT:  SQL statement "SELECT 1, /*+ SeqScan(t1) */ * from t1"
8023 PL/pgSQL function testfunc() line 3 at PERFORM
8024  testfunc 
8025 ----------
8026  
8027 (1 row)
8028
8029 -- FOR loop
8030 DROP FUNCTION testfunc();
8031 CREATE FUNCTION testfunc() RETURNS int AS $$
8032 DECLARE
8033   sum int;
8034   v int;
8035 BEGIN
8036   sum := 0;
8037   FOR v IN SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id LOOP
8038     sum := sum + v;
8039   END LOOP;
8040   RETURN v;
8041 END;
8042 $$ LANGUAGE plpgsql;
8043 SELECT testfunc();
8044 LOG:  pg_hint_plan:
8045 used hint:
8046 SeqScan(t1)
8047 not used hint:
8048 duplication hint:
8049 error hint:
8050
8051 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id"
8052 PL/pgSQL function testfunc() line 7 at FOR over SELECT rows
8053  testfunc 
8054 ----------
8055          
8056 (1 row)
8057
8058 -- Dynamic FOR loop
8059 DROP FUNCTION testfunc();
8060 CREATE FUNCTION testfunc() RETURNS int AS $$
8061 DECLARE
8062   sum int;
8063   v int;
8064   i   int;
8065 BEGIN
8066   sum := 0;
8067   FOR v IN EXECUTE 'SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id' LOOP
8068     sum := sum + v;
8069   END LOOP;
8070   RETURN v;
8071 END;
8072 $$ LANGUAGE plpgsql;
8073 SELECT testfunc();
8074 LOG:  pg_hint_plan:
8075 used hint:
8076 SeqScan(t1)
8077 not used hint:
8078 duplication hint:
8079 error hint:
8080
8081 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id"
8082 PL/pgSQL function testfunc() line 8 at FOR over EXECUTE statement
8083  testfunc 
8084 ----------
8085         0
8086 (1 row)
8087
8088 -- Cursor FOR loop
8089 DROP FUNCTION testfunc();
8090 CREATE FUNCTION testfunc() RETURNS int AS $$
8091 DECLARE
8092   ref CURSOR FOR SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8093   rec record;
8094   sum int := 0;
8095 BEGIN
8096   FOR rec IN ref LOOP
8097     sum := sum + rec.val;
8098   END LOOP;
8099   RETURN sum;
8100 END;
8101 $$ LANGUAGE plpgsql;
8102 SELECT testfunc();
8103 LOG:  pg_hint_plan:
8104 used hint:
8105 SeqScan(t1)
8106 not used hint:
8107 duplication hint:
8108 error hint:
8109
8110 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8111 PL/pgSQL function testfunc() line 7 at FOR over cursor
8112  testfunc 
8113 ----------
8114    495000
8115 (1 row)
8116
8117 -- RETURN QUERY
8118 DROP FUNCTION testfunc();
8119 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8120 BEGIN
8121   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8122 END;
8123 $$ LANGUAGE plpgsql;
8124 SELECT * FROM testfunc() LIMIT 1;
8125 LOG:  pg_hint_plan:
8126 used hint:
8127 SeqScan(t1)
8128 not used hint:
8129 duplication hint:
8130 error hint:
8131
8132 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8133 PL/pgSQL function testfunc() line 3 at RETURN QUERY
8134  id | val 
8135 ----+-----
8136   1 |   1
8137 (1 row)
8138
8139 -- Test for error exit from inner SQL statement.
8140 DROP FUNCTION testfunc();
8141 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8142 BEGIN
8143   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id;
8144 END;
8145 $$ LANGUAGE plpgsql;
8146 SELECT * FROM testfunc() LIMIT 1;
8147 ERROR:  relation "ttx" does not exist
8148 LINE 1: SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8149                                          ^
8150 QUERY:  SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8151 CONTEXT:  PL/pgSQL function testfunc() line 3 at RETURN QUERY
8152 -- this should not use SeqScan(t1) hint.
8153 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
8154 LOG:  pg_hint_plan:
8155 used hint:
8156 IndexScan(t1)
8157 not used hint:
8158 duplication hint:
8159 error hint:
8160
8161  id | val 
8162 ----+-----
8163   1 |   1
8164 (1 row)
8165
8166 DROP FUNCTION testfunc();
8167 DROP EXTENSION pg_hint_plan;
8168 --
8169 -- Rows hint tests
8170 --
8171 -- Explain result includes "Planning time" if COSTS is enabled, but
8172 -- this test needs it enabled for get rows count. So do tests via psql
8173 -- and grep -v the mutable line.
8174 -- value types
8175 \o results/pg_hint_plan.tmpout
8176 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8177 \o
8178 \! sql/maskout.sh results/pg_hint_plan.tmpout
8179                                   QUERY PLAN                                  
8180 ------------------------------------------------------------------------------
8181  Merge Join  (cost=xxx rows=1000 width=xxx)
8182    Merge Cond: (t1.id = t2.id)
8183    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8184    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8185 (4 rows)
8186
8187 \o results/pg_hint_plan.tmpout
8188 /*+ Rows(t1 t2 #99) */
8189 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8190 LOG:  pg_hint_plan:
8191 used hint:
8192 Rows(t1 t2 #99)
8193 not used hint:
8194 duplication hint:
8195 error hint:
8196
8197 \o
8198 \! sql/maskout.sh results/pg_hint_plan.tmpout
8199                                   QUERY PLAN                                  
8200 ------------------------------------------------------------------------------
8201  Merge Join  (cost=xxx rows=99 width=xxx)
8202    Merge Cond: (t1.id = t2.id)
8203    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8204    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8205 (4 rows)
8206
8207 \o results/pg_hint_plan.tmpout
8208 /*+ Rows(t1 t2 +99) */
8209 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8210 LOG:  pg_hint_plan:
8211 used hint:
8212 Rows(t1 t2 +99)
8213 not used hint:
8214 duplication hint:
8215 error hint:
8216
8217 \o
8218 \! sql/maskout.sh results/pg_hint_plan.tmpout
8219                                   QUERY PLAN                                  
8220 ------------------------------------------------------------------------------
8221  Merge Join  (cost=xxx rows=1099 width=xxx)
8222    Merge Cond: (t1.id = t2.id)
8223    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8224    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8225 (4 rows)
8226
8227 \o results/pg_hint_plan.tmpout
8228 /*+ Rows(t1 t2 -99) */
8229 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8230 LOG:  pg_hint_plan:
8231 used hint:
8232 Rows(t1 t2 -99)
8233 not used hint:
8234 duplication hint:
8235 error hint:
8236
8237 \o
8238 \! sql/maskout.sh results/pg_hint_plan.tmpout
8239                                   QUERY PLAN                                  
8240 ------------------------------------------------------------------------------
8241  Merge Join  (cost=xxx rows=901 width=xxx)
8242    Merge Cond: (t1.id = t2.id)
8243    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8244    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8245 (4 rows)
8246
8247 \o results/pg_hint_plan.tmpout
8248 /*+ Rows(t1 t2 *99) */
8249 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8250 LOG:  pg_hint_plan:
8251 used hint:
8252 Rows(t1 t2 *99)
8253 not used hint:
8254 duplication hint:
8255 error hint:
8256
8257 \o
8258 \! sql/maskout.sh results/pg_hint_plan.tmpout
8259                                   QUERY PLAN                                  
8260 ------------------------------------------------------------------------------
8261  Merge Join  (cost=xxx rows=99000 width=xxx)
8262    Merge Cond: (t1.id = t2.id)
8263    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8264    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8265 (4 rows)
8266
8267 \o results/pg_hint_plan.tmpout
8268 /*+ Rows(t1 t2 *0.01) */
8269 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8270 LOG:  pg_hint_plan:
8271 used hint:
8272 Rows(t1 t2 *0.01)
8273 not used hint:
8274 duplication hint:
8275 error hint:
8276
8277 \o
8278 \! sql/maskout.sh results/pg_hint_plan.tmpout
8279                                   QUERY PLAN                                  
8280 ------------------------------------------------------------------------------
8281  Merge Join  (cost=xxx rows=10 width=xxx)
8282    Merge Cond: (t1.id = t2.id)
8283    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8284    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8285 (4 rows)
8286
8287 \o results/pg_hint_plan.tmpout
8288 /*+ Rows(t1 t2 #aa) */
8289 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8290 INFO:  pg_hint_plan: hint syntax error at or near "aa"
8291 DETAIL:  Rows hint requires valid number as rows estimation.
8292 LOG:  pg_hint_plan:
8293 used hint:
8294 not used hint:
8295 duplication hint:
8296 error hint:
8297 Rows(t1 t2 #aa)
8298
8299 \o
8300 \! sql/maskout.sh results/pg_hint_plan.tmpout
8301                                   QUERY PLAN                                  
8302 ------------------------------------------------------------------------------
8303  Merge Join  (cost=xxx rows=1000 width=xxx)
8304    Merge Cond: (t1.id = t2.id)
8305    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8306    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8307 (4 rows)
8308
8309 \o results/pg_hint_plan.tmpout
8310 /*+ Rows(t1 t2 /99) */
8311 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8312 INFO:  pg_hint_plan: hint syntax error at or near "/99"
8313 DETAIL:  Unrecognized rows value type notation.
8314 LOG:  pg_hint_plan:
8315 used hint:
8316 not used hint:
8317 duplication hint:
8318 error hint:
8319 Rows(t1 t2 /99)
8320
8321 \o
8322 \! sql/maskout.sh results/pg_hint_plan.tmpout
8323                                   QUERY PLAN                                  
8324 ------------------------------------------------------------------------------
8325  Merge Join  (cost=xxx rows=1000 width=xxx)
8326    Merge Cond: (t1.id = t2.id)
8327    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8328    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8329 (4 rows)
8330
8331 -- round up to 1
8332 \o results/pg_hint_plan.tmpout
8333 /*+ Rows(t1 t2 -99999) */
8334 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8335 WARNING:  Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 -99999) 
8336 LOG:  pg_hint_plan:
8337 used hint:
8338 Rows(t1 t2 -99999)
8339 not used hint:
8340 duplication hint:
8341 error hint:
8342
8343 \o
8344 \! sql/maskout.sh results/pg_hint_plan.tmpout
8345                                   QUERY PLAN                                  
8346 ------------------------------------------------------------------------------
8347  Merge Join  (cost=xxx rows=1 width=xxx)
8348    Merge Cond: (t1.id = t2.id)
8349    ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8350    ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8351 (4 rows)
8352
8353 -- complex join tree
8354 \o results/pg_hint_plan.tmpout
8355 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8356 \o
8357 \! sql/maskout.sh results/pg_hint_plan.tmpout
8358                                      QUERY PLAN                                     
8359 ------------------------------------------------------------------------------------
8360  Merge Join  (cost=xxx rows=10 width=xxx)
8361    Merge Cond: (t1.id = t3.id)
8362    ->  Merge Join  (cost=xxx rows=1000 width=xxx)
8363          Merge Cond: (t1.id = t2.id)
8364          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8365          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8366    ->  Sort  (cost=xxx rows=100 width=xxx)
8367          Sort Key: t3.id
8368          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8369 (9 rows)
8370
8371 \o results/pg_hint_plan.tmpout
8372 /*+ Rows(t1 t2 #22) */
8373 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8374 LOG:  pg_hint_plan:
8375 used hint:
8376 Rows(t1 t2 #22)
8377 not used hint:
8378 duplication hint:
8379 error hint:
8380
8381 \o
8382 \! sql/maskout.sh results/pg_hint_plan.tmpout
8383                                      QUERY PLAN                                     
8384 ------------------------------------------------------------------------------------
8385  Merge Join  (cost=xxx rows=1 width=xxx)
8386    Merge Cond: (t1.id = t3.id)
8387    ->  Merge Join  (cost=xxx rows=22 width=xxx)
8388          Merge Cond: (t1.id = t2.id)
8389          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8390          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8391    ->  Sort  (cost=xxx rows=100 width=xxx)
8392          Sort Key: t3.id
8393          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8394 (9 rows)
8395
8396 \o results/pg_hint_plan.tmpout
8397 /*+ Rows(t1 t3 *10) */
8398 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8399 LOG:  pg_hint_plan:
8400 used hint:
8401 Rows(t1 t3 *10)
8402 not used hint:
8403 duplication hint:
8404 error hint:
8405
8406 \o
8407 \! sql/maskout.sh results/pg_hint_plan.tmpout
8408                                      QUERY PLAN                                     
8409 ------------------------------------------------------------------------------------
8410  Merge Join  (cost=xxx rows=100 width=xxx)
8411    Merge Cond: (t1.id = t3.id)
8412    ->  Merge Join  (cost=xxx rows=1000 width=xxx)
8413          Merge Cond: (t1.id = t2.id)
8414          ->  Index Scan using t1_pkey on t1  (cost=xxx rows=10000 width=xxx)
8415          ->  Index Scan using t2_pkey on t2  (cost=xxx rows=1000 width=xxx)
8416    ->  Sort  (cost=xxx rows=100 width=xxx)
8417          Sort Key: t3.id
8418          ->  Seq Scan on t3  (cost=xxx rows=100 width=xxx)
8419 (9 rows)
8420
8421 \! rm results/pg_hint_plan.tmpout