OSDN Git Service

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