OSDN Git Service

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