OSDN Git Service

Follow core's cobe/havor chages
[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    InitPlan 1 (returns $0)
4480      ->  Aggregate
4481            ->  Merge Join
4482                  Merge Cond: (t1_2.id = t3_2.id)
4483                  ->  Merge Join
4484                        Merge Cond: (t1_2.id = t2_2.id)
4485                        ->  Index Only Scan using t1_pkey on t1 t1_2
4486                        ->  Index Only Scan using t2_pkey on t2 t2_2
4487                  ->  Sort
4488                        Sort Key: t3_2.id
4489                        ->  Seq Scan on t3 t3_2
4490    InitPlan 2 (returns $1)
4491      ->  Aggregate
4492            ->  Merge Join
4493                  Merge Cond: (t1_4.id = t3_4.id)
4494                  ->  Merge Join
4495                        Merge Cond: (t1_4.id = t2_4.id)
4496                        ->  Index Only Scan using t1_pkey on t1 t1_4
4497                        ->  Index Only Scan using t2_pkey on t2 t2_4
4498                  ->  Sort
4499                        Sort Key: t3_4.id
4500                        ->  Seq Scan on t3 t3_4
4501    ->  Nested Loop
4502          ->  Nested Loop
4503                ->  Nested Loop
4504                      ->  Nested Loop
4505                            ->  Nested Loop
4506                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4507                                        Index Cond: (id = $1)
4508                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4509                                        Index Cond: (id = $1)
4510                            ->  Seq Scan on t3 t3_1
4511                                  Filter: (id = $1)
4512                      ->  Index Only Scan using t1_pkey on t1 t1_3
4513                            Index Cond: (id = $1)
4514                ->  Index Only Scan using t2_pkey on t2 t2_3
4515                      Index Cond: (id = $1)
4516          ->  Seq Scan on t3 t3_3
4517                Filter: (id = $1)
4518    ->  Aggregate
4519          Filter: (max(t1_5.id) = $1)
4520          ->  Merge Join
4521                Merge Cond: (t1_5.id = t3_5.id)
4522                ->  Merge Join
4523                      Merge Cond: (t1_5.id = t2_5.id)
4524                      ->  Index Only Scan using t1_pkey on t1 t1_5
4525                      ->  Index Only Scan using t2_pkey on t2 t2_5
4526                ->  Sort
4527                      Sort Key: t3_5.id
4528                      ->  Seq Scan on t3 t3_5
4529 (51 rows)
4530
4531 /*+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)*/
4532 EXPLAIN (COSTS false)
4533 WITH c1_1(id) AS (
4534 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
4535 )
4536 SELECT t1_1.id, (
4537 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
4538 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4539 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
4540 ) 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 = (
4541 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 
4542 );
4543 LOG:  pg_hint_plan:
4544 used hint:
4545 HashJoin(t1_1 t3_1)
4546 NestLoop(t1_2 t2_2)
4547 MergeJoin(t1_3 t3_3)
4548 NestLoop(t1_4 t2_4)
4549 NestLoop(t1_5 t2_5)
4550 not used hint:
4551 duplication hint:
4552 error hint:
4553
4554                                   QUERY PLAN                                  
4555 ------------------------------------------------------------------------------
4556  Nested Loop
4557    InitPlan 1 (returns $1)
4558      ->  Aggregate
4559            ->  Merge Join
4560                  Merge Cond: (t1_2.id = t3_2.id)
4561                  ->  Nested Loop
4562                        ->  Index Only Scan using t2_pkey on t2 t2_2
4563                        ->  Index Only Scan using t1_pkey on t1 t1_2
4564                              Index Cond: (id = t2_2.id)
4565                  ->  Sort
4566                        Sort Key: t3_2.id
4567                        ->  Seq Scan on t3 t3_2
4568    InitPlan 2 (returns $3)
4569      ->  Aggregate
4570            ->  Merge Join
4571                  Merge Cond: (t1_4.id = t3_4.id)
4572                  ->  Nested Loop
4573                        ->  Index Only Scan using t2_pkey on t2 t2_4
4574                        ->  Index Only Scan using t1_pkey on t1 t1_4
4575                              Index Cond: (id = t2_4.id)
4576                  ->  Sort
4577                        Sort Key: t3_4.id
4578                        ->  Seq Scan on t3 t3_4
4579    ->  Nested Loop
4580          ->  Nested Loop
4581                ->  Nested Loop
4582                      ->  Nested Loop
4583                            ->  Nested Loop
4584                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4585                                        Index Cond: (id = $3)
4586                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4587                                        Index Cond: (id = $3)
4588                            ->  Seq Scan on t3 t3_1
4589                                  Filter: (id = $3)
4590                      ->  Index Only Scan using t1_pkey on t1 t1_3
4591                            Index Cond: (id = $3)
4592                ->  Index Only Scan using t2_pkey on t2 t2_3
4593                      Index Cond: (id = $3)
4594          ->  Seq Scan on t3 t3_3
4595                Filter: (id = $3)
4596    ->  Aggregate
4597          Filter: (max(t1_5.id) = $3)
4598          ->  Merge Join
4599                Merge Cond: (t1_5.id = t3_5.id)
4600                ->  Nested Loop
4601                      ->  Index Only Scan using t2_pkey on t2 t2_5
4602                      ->  Index Only Scan using t1_pkey on t1 t1_5
4603                            Index Cond: (id = t2_5.id)
4604                ->  Sort
4605                      Sort Key: t3_5.id
4606                      ->  Seq Scan on t3 t3_5
4607 (51 rows)
4608
4609 /*+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)*/
4610 EXPLAIN (COSTS false)
4611 WITH c1_1(id) AS (
4612 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
4613 )
4614 SELECT t1_1.id, (
4615 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
4616 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4617 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
4618 ) 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 = (
4619 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 
4620 );
4621 LOG:  pg_hint_plan:
4622 used hint:
4623 HashJoin(t1_1 t3_1)
4624 NestLoop(t1_2 t2_2)
4625 MergeJoin(t1_3 t3_3)
4626 NestLoop(t1_4 t2_4)
4627 NestLoop(t1_5 t2_5)
4628 not used hint:
4629 Leading(a t1_1 t1_2 t1_4 t1_5)
4630 duplication hint:
4631 error hint:
4632
4633                                   QUERY PLAN                                  
4634 ------------------------------------------------------------------------------
4635  Nested Loop
4636    InitPlan 1 (returns $1)
4637      ->  Aggregate
4638            ->  Merge Join
4639                  Merge Cond: (t1_2.id = t3_2.id)
4640                  ->  Nested Loop
4641                        ->  Index Only Scan using t2_pkey on t2 t2_2
4642                        ->  Index Only Scan using t1_pkey on t1 t1_2
4643                              Index Cond: (id = t2_2.id)
4644                  ->  Sort
4645                        Sort Key: t3_2.id
4646                        ->  Seq Scan on t3 t3_2
4647    InitPlan 2 (returns $3)
4648      ->  Aggregate
4649            ->  Merge Join
4650                  Merge Cond: (t1_4.id = t3_4.id)
4651                  ->  Nested Loop
4652                        ->  Index Only Scan using t2_pkey on t2 t2_4
4653                        ->  Index Only Scan using t1_pkey on t1 t1_4
4654                              Index Cond: (id = t2_4.id)
4655                  ->  Sort
4656                        Sort Key: t3_4.id
4657                        ->  Seq Scan on t3 t3_4
4658    ->  Nested Loop
4659          ->  Nested Loop
4660                ->  Nested Loop
4661                      ->  Nested Loop
4662                            ->  Nested Loop
4663                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4664                                        Index Cond: (id = $3)
4665                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4666                                        Index Cond: (id = $3)
4667                            ->  Seq Scan on t3 t3_1
4668                                  Filter: (id = $3)
4669                      ->  Index Only Scan using t1_pkey on t1 t1_3
4670                            Index Cond: (id = $3)
4671                ->  Index Only Scan using t2_pkey on t2 t2_3
4672                      Index Cond: (id = $3)
4673          ->  Seq Scan on t3 t3_3
4674                Filter: (id = $3)
4675    ->  Aggregate
4676          Filter: (max(t1_5.id) = $3)
4677          ->  Merge Join
4678                Merge Cond: (t1_5.id = t3_5.id)
4679                ->  Nested Loop
4680                      ->  Index Only Scan using t2_pkey on t2 t2_5
4681                      ->  Index Only Scan using t1_pkey on t1 t1_5
4682                            Index Cond: (id = t2_5.id)
4683                ->  Sort
4684                      Sort Key: t3_5.id
4685                      ->  Seq Scan on t3 t3_5
4686 (51 rows)
4687
4688 /*+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)*/
4689 EXPLAIN (COSTS false)
4690 WITH c1_1(id) AS (
4691 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
4692 )
4693 SELECT t1_1.id, (
4694 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
4695 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4696 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
4697 ) 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 = (
4698 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 
4699 );
4700 LOG:  pg_hint_plan:
4701 used hint:
4702 HashJoin(t1_1 t3_1)
4703 NestLoop(t1_2 t2_2)
4704 MergeJoin(t1_3 t3_3)
4705 NestLoop(t1_4 t2_4)
4706 NestLoop(t1_5 t2_5)
4707 not used hint:
4708 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)
4709 duplication hint:
4710 error hint:
4711
4712                                   QUERY PLAN                                  
4713 ------------------------------------------------------------------------------
4714  Nested Loop
4715    InitPlan 1 (returns $1)
4716      ->  Aggregate
4717            ->  Merge Join
4718                  Merge Cond: (t1_2.id = t3_2.id)
4719                  ->  Nested Loop
4720                        ->  Index Only Scan using t2_pkey on t2 t2_2
4721                        ->  Index Only Scan using t1_pkey on t1 t1_2
4722                              Index Cond: (id = t2_2.id)
4723                  ->  Sort
4724                        Sort Key: t3_2.id
4725                        ->  Seq Scan on t3 t3_2
4726    InitPlan 2 (returns $3)
4727      ->  Aggregate
4728            ->  Merge Join
4729                  Merge Cond: (t1_4.id = t3_4.id)
4730                  ->  Nested Loop
4731                        ->  Index Only Scan using t2_pkey on t2 t2_4
4732                        ->  Index Only Scan using t1_pkey on t1 t1_4
4733                              Index Cond: (id = t2_4.id)
4734                  ->  Sort
4735                        Sort Key: t3_4.id
4736                        ->  Seq Scan on t3 t3_4
4737    ->  Nested Loop
4738          ->  Nested Loop
4739                ->  Nested Loop
4740                      ->  Nested Loop
4741                            ->  Nested Loop
4742                                  ->  Index Only Scan using t1_pkey on t1 t1_1
4743                                        Index Cond: (id = $3)
4744                                  ->  Index Only Scan using t2_pkey on t2 t2_1
4745                                        Index Cond: (id = $3)
4746                            ->  Seq Scan on t3 t3_1
4747                                  Filter: (id = $3)
4748                      ->  Index Only Scan using t1_pkey on t1 t1_3
4749                            Index Cond: (id = $3)
4750                ->  Index Only Scan using t2_pkey on t2 t2_3
4751                      Index Cond: (id = $3)
4752          ->  Seq Scan on t3 t3_3
4753                Filter: (id = $3)
4754    ->  Aggregate
4755          Filter: (max(t1_5.id) = $3)
4756          ->  Merge Join
4757                Merge Cond: (t1_5.id = t3_5.id)
4758                ->  Nested Loop
4759                      ->  Index Only Scan using t2_pkey on t2 t2_5
4760                      ->  Index Only Scan using t1_pkey on t1 t1_5
4761                            Index Cond: (id = t2_5.id)
4762                ->  Sort
4763                      Sort Key: t3_5.id
4764                      ->  Seq Scan on t3 t3_5
4765 (51 rows)
4766
4767 /*+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)*/
4768 EXPLAIN (COSTS false)
4769 WITH c1_1(id) AS (
4770 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
4771 )
4772 SELECT t1_1.id, (
4773 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
4774 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4775 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
4776 ) 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 = (
4777 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 
4778 );
4779 LOG:  pg_hint_plan:
4780 used hint:
4781 Leading(t3_5 t2_5 t1_5)
4782 Leading(t3_2 t2_2 t1_2)
4783 Leading(t3_4 t2_4 t1_4)
4784 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
4785 not used hint:
4786 HashJoin(t1_1 t3_1)
4787 NestLoop(t1_2 t2_2)
4788 MergeJoin(t1_3 t3_3)
4789 NestLoop(t1_4 t2_4)
4790 NestLoop(t1_5 t2_5)
4791 duplication hint:
4792 error hint:
4793
4794                                            QUERY PLAN                                           
4795 ------------------------------------------------------------------------------------------------
4796  Nested Loop
4797    InitPlan 1 (returns $0)
4798      ->  Aggregate
4799            ->  Merge Join
4800                  Merge Cond: (t2_2.id = t1_2.id)
4801                  ->  Merge Join
4802                        Merge Cond: (t2_2.id = t3_2.id)
4803                        ->  Index Only Scan using t2_pkey on t2 t2_2
4804                        ->  Sort
4805                              Sort Key: t3_2.id
4806                              ->  Seq Scan on t3 t3_2
4807                  ->  Index Only Scan using t1_pkey on t1 t1_2
4808    InitPlan 2 (returns $1)
4809      ->  Aggregate
4810            ->  Merge Join
4811                  Merge Cond: (t2_4.id = t1_4.id)
4812                  ->  Merge Join
4813                        Merge Cond: (t2_4.id = t3_4.id)
4814                        ->  Index Only Scan using t2_pkey on t2 t2_4
4815                        ->  Sort
4816                              Sort Key: t3_4.id
4817                              ->  Seq Scan on t3 t3_4
4818                  ->  Index Only Scan using t1_pkey on t1 t1_4
4819    ->  Nested Loop
4820          ->  Nested Loop
4821                ->  Nested Loop
4822                      ->  Nested Loop
4823                            ->  Nested Loop
4824                                  ->  Seq Scan on t3 t3_3
4825                                        Filter: (id = $1)
4826                                  ->  Aggregate
4827                                        Filter: (max(t1_5.id) = $1)
4828                                        ->  Merge Join
4829                                              Merge Cond: (t2_5.id = t1_5.id)
4830                                              ->  Merge Join
4831                                                    Merge Cond: (t2_5.id = t3_5.id)
4832                                                    ->  Index Only Scan using t2_pkey on t2 t2_5
4833                                                    ->  Sort
4834                                                          Sort Key: t3_5.id
4835                                                          ->  Seq Scan on t3 t3_5
4836                                              ->  Index Only Scan using t1_pkey on t1 t1_5
4837                            ->  Index Only Scan using t2_pkey on t2 t2_3
4838                                  Index Cond: (id = $1)
4839                      ->  Index Only Scan using t1_pkey on t1 t1_3
4840                            Index Cond: (id = $1)
4841                ->  Seq Scan on t3 t3_1
4842                      Filter: (id = $1)
4843          ->  Index Only Scan using t2_pkey on t2 t2_1
4844                Index Cond: (id = $1)
4845    ->  Index Only Scan using t1_pkey on t1 t1_1
4846          Index Cond: (id = $1)
4847 (51 rows)
4848
4849 SET from_collapse_limit TO 1;
4850 EXPLAIN (COSTS false)
4851 WITH c1_1(id) AS (
4852 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
4853 )
4854 SELECT t1_1.id, (
4855 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
4856 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4857 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
4858 ) 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 = (
4859 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 
4860 );
4861                              QUERY PLAN                             
4862 --------------------------------------------------------------------
4863  Nested Loop
4864    InitPlan 1 (returns $0)
4865      ->  Aggregate
4866            ->  Merge Join
4867                  Merge Cond: (t1_2.id = t3_2.id)
4868                  ->  Merge Join
4869                        Merge Cond: (t1_2.id = t2_2.id)
4870                        ->  Index Only Scan using t1_pkey on t1 t1_2
4871                        ->  Index Only Scan using t2_pkey on t2 t2_2
4872                  ->  Sort
4873                        Sort Key: t3_2.id
4874                        ->  Seq Scan on t3 t3_2
4875    InitPlan 2 (returns $1)
4876      ->  Aggregate
4877            ->  Merge Join
4878                  Merge Cond: (t1_4.id = t3_4.id)
4879                  ->  Merge Join
4880                        Merge Cond: (t1_4.id = t2_4.id)
4881                        ->  Index Only Scan using t1_pkey on t1 t1_4
4882                        ->  Index Only Scan using t2_pkey on t2 t2_4
4883                  ->  Sort
4884                        Sort Key: t3_4.id
4885                        ->  Seq Scan on t3 t3_4
4886    ->  Nested Loop
4887          ->  Nested Loop
4888                ->  Nested Loop
4889                      ->  Index Only Scan using t1_pkey on t1 t1_1
4890                            Index Cond: (id = $1)
4891                      ->  Index Only Scan using t2_pkey on t2 t2_1
4892                            Index Cond: (id = $1)
4893                ->  Seq Scan on t3 t3_1
4894                      Filter: (id = $1)
4895          ->  Nested Loop
4896                ->  Nested Loop
4897                      ->  Index Only Scan using t1_pkey on t1 t1_3
4898                            Index Cond: (id = $1)
4899                      ->  Index Only Scan using t2_pkey on t2 t2_3
4900                            Index Cond: (id = $1)
4901                ->  Seq Scan on t3 t3_3
4902                      Filter: (id = $1)
4903    ->  Aggregate
4904          Filter: (max(t1_5.id) = $1)
4905          ->  Merge Join
4906                Merge Cond: (t1_5.id = t3_5.id)
4907                ->  Merge Join
4908                      Merge Cond: (t1_5.id = t2_5.id)
4909                      ->  Index Only Scan using t1_pkey on t1 t1_5
4910                      ->  Index Only Scan using t2_pkey on t2 t2_5
4911                ->  Sort
4912                      Sort Key: t3_5.id
4913                      ->  Seq Scan on t3 t3_5
4914 (51 rows)
4915
4916 /*+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)*/
4917 EXPLAIN (COSTS false)
4918 WITH c1_1(id) AS (
4919 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
4920 )
4921 SELECT t1_1.id, (
4922 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
4923 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
4924 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
4925 ) 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 = (
4926 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 
4927 );
4928 LOG:  pg_hint_plan:
4929 used hint:
4930 HashJoin(t1_1 t3_1)
4931 NestLoop(t1_2 t2_2)
4932 MergeJoin(t1_3 t3_3)
4933 NestLoop(t1_4 t2_4)
4934 NestLoop(t1_5 t2_5)
4935 not used hint:
4936 duplication hint:
4937 error hint:
4938
4939                              QUERY PLAN                             
4940 --------------------------------------------------------------------
4941  Nested Loop
4942    InitPlan 1 (returns $1)
4943      ->  Aggregate
4944            ->  Merge Join
4945                  Merge Cond: (t1_2.id = t3_2.id)
4946                  ->  Nested Loop
4947                        ->  Index Only Scan using t2_pkey on t2 t2_2
4948                        ->  Index Only Scan using t1_pkey on t1 t1_2
4949                              Index Cond: (id = t2_2.id)
4950                  ->  Sort
4951                        Sort Key: t3_2.id
4952                        ->  Seq Scan on t3 t3_2
4953    InitPlan 2 (returns $3)
4954      ->  Aggregate
4955            ->  Merge Join
4956                  Merge Cond: (t1_4.id = t3_4.id)
4957                  ->  Nested Loop
4958                        ->  Index Only Scan using t2_pkey on t2 t2_4
4959                        ->  Index Only Scan using t1_pkey on t1 t1_4
4960                              Index Cond: (id = t2_4.id)
4961                  ->  Sort
4962                        Sort Key: t3_4.id
4963                        ->  Seq Scan on t3 t3_4
4964    ->  Nested Loop
4965          ->  Nested Loop
4966                ->  Nested Loop
4967                      ->  Index Only Scan using t1_pkey on t1 t1_1
4968                            Index Cond: (id = $3)
4969                      ->  Index Only Scan using t2_pkey on t2 t2_1
4970                            Index Cond: (id = $3)
4971                ->  Seq Scan on t3 t3_1
4972                      Filter: (id = $3)
4973          ->  Nested Loop
4974                ->  Nested Loop
4975                      ->  Index Only Scan using t1_pkey on t1 t1_3
4976                            Index Cond: (id = $3)
4977                      ->  Index Only Scan using t2_pkey on t2 t2_3
4978                            Index Cond: (id = $3)
4979                ->  Seq Scan on t3 t3_3
4980                      Filter: (id = $3)
4981    ->  Aggregate
4982          Filter: (max(t1_5.id) = $3)
4983          ->  Merge Join
4984                Merge Cond: (t1_5.id = t3_5.id)
4985                ->  Nested Loop
4986                      ->  Index Only Scan using t2_pkey on t2 t2_5
4987                      ->  Index Only Scan using t1_pkey on t1 t1_5
4988                            Index Cond: (id = t2_5.id)
4989                ->  Sort
4990                      Sort Key: t3_5.id
4991                      ->  Seq Scan on t3 t3_5
4992 (51 rows)
4993
4994 /*+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)*/
4995 EXPLAIN (COSTS false)
4996 WITH c1_1(id) AS (
4997 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
4998 )
4999 SELECT t1_1.id, (
5000 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
5001 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5002 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
5003 ) 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 = (
5004 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 
5005 );
5006 LOG:  pg_hint_plan:
5007 used hint:
5008 HashJoin(t1_1 t3_1)
5009 NestLoop(t1_2 t2_2)
5010 MergeJoin(t1_3 t3_3)
5011 NestLoop(t1_4 t2_4)
5012 NestLoop(t1_5 t2_5)
5013 not used hint:
5014 Leading(a t1_1 t1_2 t1_4 t1_5)
5015 duplication hint:
5016 error hint:
5017
5018                              QUERY PLAN                             
5019 --------------------------------------------------------------------
5020  Nested Loop
5021    InitPlan 1 (returns $1)
5022      ->  Aggregate
5023            ->  Merge Join
5024                  Merge Cond: (t1_2.id = t3_2.id)
5025                  ->  Nested Loop
5026                        ->  Index Only Scan using t2_pkey on t2 t2_2
5027                        ->  Index Only Scan using t1_pkey on t1 t1_2
5028                              Index Cond: (id = t2_2.id)
5029                  ->  Sort
5030                        Sort Key: t3_2.id
5031                        ->  Seq Scan on t3 t3_2
5032    InitPlan 2 (returns $3)
5033      ->  Aggregate
5034            ->  Merge Join
5035                  Merge Cond: (t1_4.id = t3_4.id)
5036                  ->  Nested Loop
5037                        ->  Index Only Scan using t2_pkey on t2 t2_4
5038                        ->  Index Only Scan using t1_pkey on t1 t1_4
5039                              Index Cond: (id = t2_4.id)
5040                  ->  Sort
5041                        Sort Key: t3_4.id
5042                        ->  Seq Scan on t3 t3_4
5043    ->  Nested Loop
5044          ->  Nested Loop
5045                ->  Nested Loop
5046                      ->  Index Only Scan using t1_pkey on t1 t1_1
5047                            Index Cond: (id = $3)
5048                      ->  Index Only Scan using t2_pkey on t2 t2_1
5049                            Index Cond: (id = $3)
5050                ->  Seq Scan on t3 t3_1
5051                      Filter: (id = $3)
5052          ->  Nested Loop
5053                ->  Nested Loop
5054                      ->  Index Only Scan using t1_pkey on t1 t1_3
5055                            Index Cond: (id = $3)
5056                      ->  Index Only Scan using t2_pkey on t2 t2_3
5057                            Index Cond: (id = $3)
5058                ->  Seq Scan on t3 t3_3
5059                      Filter: (id = $3)
5060    ->  Aggregate
5061          Filter: (max(t1_5.id) = $3)
5062          ->  Merge Join
5063                Merge Cond: (t1_5.id = t3_5.id)
5064                ->  Nested Loop
5065                      ->  Index Only Scan using t2_pkey on t2 t2_5
5066                      ->  Index Only Scan using t1_pkey on t1 t1_5
5067                            Index Cond: (id = t2_5.id)
5068                ->  Sort
5069                      Sort Key: t3_5.id
5070                      ->  Seq Scan on t3 t3_5
5071 (51 rows)
5072
5073 /*+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)*/
5074 EXPLAIN (COSTS false)
5075 WITH c1_1(id) AS (
5076 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
5077 )
5078 SELECT t1_1.id, (
5079 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
5080 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5081 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
5082 ) 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 = (
5083 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 
5084 );
5085 LOG:  pg_hint_plan:
5086 used hint:
5087 HashJoin(t1_1 t3_1)
5088 NestLoop(t1_2 t2_2)
5089 MergeJoin(t1_3 t3_3)
5090 NestLoop(t1_4 t2_4)
5091 NestLoop(t1_5 t2_5)
5092 not used hint:
5093 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)
5094 duplication hint:
5095 error hint:
5096
5097                              QUERY PLAN                             
5098 --------------------------------------------------------------------
5099  Nested Loop
5100    InitPlan 1 (returns $1)
5101      ->  Aggregate
5102            ->  Merge Join
5103                  Merge Cond: (t1_2.id = t3_2.id)
5104                  ->  Nested Loop
5105                        ->  Index Only Scan using t2_pkey on t2 t2_2
5106                        ->  Index Only Scan using t1_pkey on t1 t1_2
5107                              Index Cond: (id = t2_2.id)
5108                  ->  Sort
5109                        Sort Key: t3_2.id
5110                        ->  Seq Scan on t3 t3_2
5111    InitPlan 2 (returns $3)
5112      ->  Aggregate
5113            ->  Merge Join
5114                  Merge Cond: (t1_4.id = t3_4.id)
5115                  ->  Nested Loop
5116                        ->  Index Only Scan using t2_pkey on t2 t2_4
5117                        ->  Index Only Scan using t1_pkey on t1 t1_4
5118                              Index Cond: (id = t2_4.id)
5119                  ->  Sort
5120                        Sort Key: t3_4.id
5121                        ->  Seq Scan on t3 t3_4
5122    ->  Nested Loop
5123          ->  Nested Loop
5124                ->  Nested Loop
5125                      ->  Index Only Scan using t1_pkey on t1 t1_1
5126                            Index Cond: (id = $3)
5127                      ->  Index Only Scan using t2_pkey on t2 t2_1
5128                            Index Cond: (id = $3)
5129                ->  Seq Scan on t3 t3_1
5130                      Filter: (id = $3)
5131          ->  Nested Loop
5132                ->  Nested Loop
5133                      ->  Index Only Scan using t1_pkey on t1 t1_3
5134                            Index Cond: (id = $3)
5135                      ->  Index Only Scan using t2_pkey on t2 t2_3
5136                            Index Cond: (id = $3)
5137                ->  Seq Scan on t3 t3_3
5138                      Filter: (id = $3)
5139    ->  Aggregate
5140          Filter: (max(t1_5.id) = $3)
5141          ->  Merge Join
5142                Merge Cond: (t1_5.id = t3_5.id)
5143                ->  Nested Loop
5144                      ->  Index Only Scan using t2_pkey on t2 t2_5
5145                      ->  Index Only Scan using t1_pkey on t1 t1_5
5146                            Index Cond: (id = t2_5.id)
5147                ->  Sort
5148                      Sort Key: t3_5.id
5149                      ->  Seq Scan on t3 t3_5
5150 (51 rows)
5151
5152 /*+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)*/
5153 EXPLAIN (COSTS false)
5154 WITH c1_1(id) AS (
5155 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
5156 )
5157 SELECT t1_1.id, (
5158 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
5159 ) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
5160 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
5161 ) 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 = (
5162 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 
5163 );
5164 LOG:  pg_hint_plan:
5165 used hint:
5166 MergeJoin(t1_3 t3_3)
5167 Leading(t3_5 t2_5 t1_5)
5168 Leading(t3_2 t2_2 t1_2)
5169 Leading(t3_4 t2_4 t1_4)
5170 Leading(c1_1 t3_3 t2_3 t1_3 t3_1 t2_1 t1_1)
5171 not used hint:
5172 HashJoin(t1_1 t3_1)
5173 NestLoop(t1_2 t2_2)
5174 NestLoop(t1_4 t2_4)
5175 NestLoop(t1_5 t2_5)
5176 duplication hint:
5177 error hint:
5178
5179                                      QUERY PLAN                                     
5180 ------------------------------------------------------------------------------------
5181  Nested Loop
5182    InitPlan 1 (returns $0)
5183      ->  Aggregate
5184            ->  Merge Join
5185                  Merge Cond: (t2_2.id = t1_2.id)
5186                  ->  Merge Join
5187                        Merge Cond: (t2_2.id = t3_2.id)
5188                        ->  Index Only Scan using t2_pkey on t2 t2_2
5189                        ->  Sort
5190                              Sort Key: t3_2.id
5191                              ->  Seq Scan on t3 t3_2
5192                  ->  Index Only Scan using t1_pkey on t1 t1_2
5193    InitPlan 2 (returns $1)
5194      ->  Aggregate
5195            ->  Merge Join
5196                  Merge Cond: (t2_4.id = t1_4.id)
5197                  ->  Merge Join
5198                        Merge Cond: (t2_4.id = t3_4.id)
5199                        ->  Index Only Scan using t2_pkey on t2 t2_4
5200                        ->  Sort
5201                              Sort Key: t3_4.id
5202                              ->  Seq Scan on t3 t3_4
5203                  ->  Index Only Scan using t1_pkey on t1 t1_4
5204    ->  Nested Loop
5205          ->  Nested Loop
5206                ->  Nested Loop
5207                      ->  Nested Loop
5208                            ->  Nested Loop
5209                                  ->  Index Only Scan using t1_pkey on t1 t1_3
5210                                        Index Cond: (id = $1)
5211                                  ->  Index Only Scan using t2_pkey on t2 t2_3
5212                                        Index Cond: (id = $1)
5213                            ->  Seq Scan on t3 t3_3
5214                                  Filter: (id = $1)
5215                      ->  Aggregate
5216                            Filter: (max(t1_5.id) = $1)
5217                            ->  Merge Join
5218                                  Merge Cond: (t2_5.id = t1_5.id)
5219                                  ->  Merge Join
5220                                        Merge Cond: (t2_5.id = t3_5.id)
5221                                        ->  Index Only Scan using t2_pkey on t2 t2_5
5222                                        ->  Sort
5223                                              Sort Key: t3_5.id
5224                                              ->  Seq Scan on t3 t3_5
5225                                  ->  Index Only Scan using t1_pkey on t1 t1_5
5226                ->  Seq Scan on t3 t3_1
5227                      Filter: (id = $1)
5228          ->  Index Only Scan using t2_pkey on t2 t2_1
5229                Index Cond: (id = $1)
5230    ->  Index Only Scan using t1_pkey on t1 t1_1
5231          Index Cond: (id = $1)
5232 (51 rows)
5233
5234 -- ambigous error
5235 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5236                    QUERY PLAN                    
5237 -------------------------------------------------
5238  Merge Join
5239    Merge Cond: (t1.id = t2.id)
5240    ->  Merge Join
5241          Merge Cond: (t1.id = t1_1.id)
5242          ->  Index Scan using t1_pkey on t1
5243          ->  Index Scan using t1_pkey on t1 t1_1
5244    ->  Index Scan using t2_pkey on t2
5245 (7 rows)
5246
5247 /*+NestLoop(t1 t2)*/
5248 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5249 INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t2)"
5250 DETAIL:  Relation name "t1" is ambiguous.
5251 LOG:  pg_hint_plan:
5252 used hint:
5253 not used hint:
5254 duplication hint:
5255 error hint:
5256 NestLoop(t1 t2)
5257
5258                    QUERY PLAN                    
5259 -------------------------------------------------
5260  Merge Join
5261    Merge Cond: (t1.id = t2.id)
5262    ->  Merge Join
5263          Merge Cond: (t1.id = t1_1.id)
5264          ->  Index Scan using t1_pkey on t1
5265          ->  Index Scan using t1_pkey on t1 t1_1
5266    ->  Index Scan using t2_pkey on t2
5267 (7 rows)
5268
5269 /*+Leading(t1 t2 t1)*/
5270 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
5271 INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t1)"
5272 DETAIL:  Relation name "t1" is ambiguous.
5273 LOG:  pg_hint_plan:
5274 used hint:
5275 not used hint:
5276 duplication hint:
5277 error hint:
5278 Leading(t1 t2 t1)
5279
5280                    QUERY PLAN                    
5281 -------------------------------------------------
5282  Merge Join
5283    Merge Cond: (t1.id = t2.id)
5284    ->  Merge Join
5285          Merge Cond: (t1.id = t1_1.id)
5286          ->  Index Scan using t1_pkey on t1
5287          ->  Index Scan using t1_pkey on t1 t1_1
5288    ->  Index Scan using t2_pkey on t2
5289 (7 rows)
5290
5291 -- identifier length test
5292 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5293                                                   QUERY PLAN                                                  
5294 --------------------------------------------------------------------------------------------------------------
5295  Merge Join
5296    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5297    ->  Merge Join
5298          Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id)
5299          ->  Index Scan using t1_pkey on t1 "123456789012345678901234567890123456789012345678901234567890123"
5300          ->  Index Scan using t2_pkey on t2
5301    ->  Sort
5302          Sort Key: t3.id
5303          ->  Seq Scan on t3
5304 (9 rows)
5305
5306 /*+
5307 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5308 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5309 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5310 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5311 */
5312 EXPLAIN (COSTS false) SELECT * FROM t1 "123456789012345678901234567890123456789012345678901234567890123" JOIN t2 ON ("123456789012345678901234567890123456789012345678901234567890123".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5313 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5314 LOG:  pg_hint_plan:
5315 used hint:
5316 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5317 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5318 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5319 not used hint:
5320 duplication hint:
5321 error hint:
5322 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5323
5324                                              QUERY PLAN                                             
5325 ----------------------------------------------------------------------------------------------------
5326  Merge Join
5327    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5328    ->  Merge Join
5329          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5330          ->  Index Scan using t2_pkey on t2
5331          ->  Sort
5332                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5333                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5334    ->  Sort
5335          Sort Key: t3.id
5336          ->  Seq Scan on t3
5337 (11 rows)
5338
5339 /*+
5340 Leading(1234567890123456789012345678901234567890123456789012345678901234 t2 t3)
5341 SeqScan(1234567890123456789012345678901234567890123456789012345678901234)
5342 MergeJoin(1234567890123456789012345678901234567890123456789012345678901234 t2)
5343 Set(1234567890123456789012345678901234567890123456789012345678901234 1)
5344 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5345 */
5346 EXPLAIN (COSTS false) SELECT * FROM t1 "1234567890123456789012345678901234567890123456789012345678901234" JOIN t2 ON ("1234567890123456789012345678901234567890123456789012345678901234".id = t2.id) JOIN t3 ON (t2.id = t3.id);
5347 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5348 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5349 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5350 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5351 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5352 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5353 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5354 LOG:  pg_hint_plan:
5355 used hint:
5356 SeqScan(123456789012345678901234567890123456789012345678901234567890123)
5357 MergeJoin(123456789012345678901234567890123456789012345678901234567890123 t2)
5358 Leading(123456789012345678901234567890123456789012345678901234567890123 t2 t3)
5359 Set(cursor_tuple_fraction 0.1234567890123456789012345678901234567890123456789012345678901234)
5360 not used hint:
5361 duplication hint:
5362 error hint:
5363 Set(123456789012345678901234567890123456789012345678901234567890123 1)
5364
5365                                              QUERY PLAN                                             
5366 ----------------------------------------------------------------------------------------------------
5367  Merge Join
5368    Merge Cond: ("123456789012345678901234567890123456789012345678901234567890123".id = t3.id)
5369    ->  Merge Join
5370          Merge Cond: (t2.id = "123456789012345678901234567890123456789012345678901234567890123".id)
5371          ->  Index Scan using t2_pkey on t2
5372          ->  Sort
5373                Sort Key: "123456789012345678901234567890123456789012345678901234567890123".id
5374                ->  Seq Scan on t1 "123456789012345678901234567890123456789012345678901234567890123"
5375    ->  Sort
5376          Sort Key: t3.id
5377          ->  Seq Scan on t3
5378 (11 rows)
5379
5380 SET "123456789012345678901234567890123456789012345678901234567890123" TO 1;
5381 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5382 SET "1234567890123456789012345678901234567890123456789012345678901234" TO 1;
5383 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
5384 ERROR:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
5385 SET cursor_tuple_fraction TO 1234567890123456789012345678901234567890123456789012345678901234;
5386 ERROR:  1.23457e+63 is outside the valid range for parameter "cursor_tuple_fraction" (0 .. 1)
5387 -- multi error
5388 /*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/
5389 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
5390 INFO:  parameter "enable_seqscan" requires a Boolean value
5391 INFO:  parameter "seq_page_cost" requires a numeric value
5392 LOG:  pg_hint_plan:
5393 used hint:
5394 not used hint:
5395 duplication hint:
5396 error hint:
5397 Set(enable_seqscan 100)
5398 Set(seq_page_cost on)
5399
5400               QUERY PLAN              
5401 --------------------------------------
5402  Merge Join
5403    Merge Cond: (t1.id = t2.id)
5404    ->  Index Scan using t1_pkey on t1
5405    ->  Index Scan using t2_pkey on t2
5406 (4 rows)
5407
5408 -- debug log of candidate index to use IndexScan
5409 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5410                                        QUERY PLAN                                       
5411 ----------------------------------------------------------------------------------------
5412  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
5413    Index Cond: (id = 1)
5414 (2 rows)
5415
5416 /*+IndexScan(t5 t5_id2)*/
5417 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5418 LOG:  available indexes for IndexScan(t5): t5_id2
5419 LOG:  pg_hint_plan:
5420 used hint:
5421 IndexScan(t5 t5_id2)
5422 not used hint:
5423 duplication hint:
5424 error hint:
5425
5426           QUERY PLAN           
5427 -------------------------------
5428  Index Scan using t5_id2 on t5
5429    Index Cond: (id = 1)
5430 (2 rows)
5431
5432 /*+IndexScan(t5 no_exist)*/
5433 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5434 LOG:  available indexes for IndexScan(t5):
5435 LOG:  pg_hint_plan:
5436 used hint:
5437 IndexScan(t5 no_exist)
5438 not used hint:
5439 duplication hint:
5440 error hint:
5441
5442      QUERY PLAN     
5443 --------------------
5444  Seq Scan on t5
5445    Filter: (id = 1)
5446 (2 rows)
5447
5448 /*+IndexScan(t5 t5_id1 t5_id2)*/
5449 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5450 LOG:  available indexes for IndexScan(t5): t5_id2 t5_id1
5451 LOG:  pg_hint_plan:
5452 used hint:
5453 IndexScan(t5 t5_id1 t5_id2)
5454 not used hint:
5455 duplication hint:
5456 error hint:
5457
5458           QUERY PLAN           
5459 -------------------------------
5460  Index Scan using t5_id2 on t5
5461    Index Cond: (id = 1)
5462 (2 rows)
5463
5464 /*+IndexScan(t5 no_exist t5_id2)*/
5465 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5466 LOG:  available indexes for IndexScan(t5): t5_id2
5467 LOG:  pg_hint_plan:
5468 used hint:
5469 IndexScan(t5 no_exist t5_id2)
5470 not used hint:
5471 duplication hint:
5472 error hint:
5473
5474           QUERY PLAN           
5475 -------------------------------
5476  Index Scan using t5_id2 on t5
5477    Index Cond: (id = 1)
5478 (2 rows)
5479
5480 /*+IndexScan(t5 no_exist5 no_exist2)*/
5481 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
5482 LOG:  available indexes for IndexScan(t5):
5483 LOG:  pg_hint_plan:
5484 used hint:
5485 IndexScan(t5 no_exist5 no_exist2)
5486 not used hint:
5487 duplication hint:
5488 error hint:
5489
5490      QUERY PLAN     
5491 --------------------
5492  Seq Scan on t5
5493    Filter: (id = 1)
5494 (2 rows)
5495
5496 -- outer inner
5497 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5498                        QUERY PLAN                       
5499 --------------------------------------------------------
5500  Hash Join
5501    Hash Cond: (t3.val = t2.val)
5502    ->  Seq Scan on t3
5503    ->  Hash
5504          ->  Hash Join
5505                Hash Cond: (t2.id = t1.id)
5506                ->  Seq Scan on t2
5507                ->  Hash
5508                      ->  Index Scan using t1_pkey on t1
5509                            Index Cond: (id < 10)
5510 (10 rows)
5511
5512 /*+Leading((t1))*/
5513 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5514 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1))"
5515 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5516 LOG:  pg_hint_plan:
5517 used hint:
5518 not used hint:
5519 duplication hint:
5520 error hint:
5521 Leading((t1))
5522
5523                        QUERY PLAN                       
5524 --------------------------------------------------------
5525  Hash Join
5526    Hash Cond: (t3.val = t2.val)
5527    ->  Seq Scan on t3
5528    ->  Hash
5529          ->  Hash Join
5530                Hash Cond: (t2.id = t1.id)
5531                ->  Seq Scan on t2
5532                ->  Hash
5533                      ->  Index Scan using t1_pkey on t1
5534                            Index Cond: (id < 10)
5535 (10 rows)
5536
5537 /*+Leading((t1 t2))*/
5538 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5539 LOG:  pg_hint_plan:
5540 used hint:
5541 Leading((t1 t2))
5542 not used hint:
5543 duplication hint:
5544 error hint:
5545
5546                  QUERY PLAN                 
5547 --------------------------------------------
5548  Nested Loop
5549    Join Filter: (t2.val = t3.val)
5550    ->  Hash Join
5551          Hash Cond: (t1.id = t2.id)
5552          ->  Index Scan using t1_pkey on t1
5553                Index Cond: (id < 10)
5554          ->  Hash
5555                ->  Seq Scan on t2
5556    ->  Seq Scan on t3
5557 (9 rows)
5558
5559 /*+Leading((t1 t2 t3))*/
5560 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5561 INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1 t2 t3))"
5562 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
5563 LOG:  pg_hint_plan:
5564 used hint:
5565 not used hint:
5566 duplication hint:
5567 error hint:
5568 Leading((t1 t2 t3))
5569
5570                        QUERY PLAN                       
5571 --------------------------------------------------------
5572  Hash Join
5573    Hash Cond: (t3.val = t2.val)
5574    ->  Seq Scan on t3
5575    ->  Hash
5576          ->  Hash Join
5577                Hash Cond: (t2.id = t1.id)
5578                ->  Seq Scan on t2
5579                ->  Hash
5580                      ->  Index Scan using t1_pkey on t1
5581                            Index Cond: (id < 10)
5582 (10 rows)
5583
5584 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5585                  QUERY PLAN                 
5586 --------------------------------------------
5587  Hash Join
5588    Hash Cond: (t2.id = t1.id)
5589    ->  Seq Scan on t2
5590    ->  Hash
5591          ->  Index Scan using t1_pkey on t1
5592                Index Cond: (id < 10)
5593 (6 rows)
5594
5595 /*+Leading((t1 t2))*/
5596 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
5597 LOG:  pg_hint_plan:
5598 used hint:
5599 Leading((t1 t2))
5600 not used hint:
5601 duplication hint:
5602 error hint:
5603
5604               QUERY PLAN              
5605 --------------------------------------
5606  Hash Join
5607    Hash Cond: (t1.id = t2.id)
5608    ->  Index Scan using t1_pkey on t1
5609          Index Cond: (id < 10)
5610    ->  Hash
5611          ->  Seq Scan on t2
5612 (6 rows)
5613
5614 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5615                        QUERY PLAN                       
5616 --------------------------------------------------------
5617  Hash Join
5618    Hash Cond: (t3.val = t2.val)
5619    ->  Seq Scan on t3
5620    ->  Hash
5621          ->  Hash Join
5622                Hash Cond: (t2.id = t1.id)
5623                ->  Seq Scan on t2
5624                ->  Hash
5625                      ->  Index Scan using t1_pkey on t1
5626                            Index Cond: (id < 10)
5627 (10 rows)
5628
5629 /*+Leading(((t1 t2) t3))*/
5630 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5631 LOG:  pg_hint_plan:
5632 used hint:
5633 Leading(((t1 t2) t3))
5634 not used hint:
5635 duplication hint:
5636 error hint:
5637
5638                  QUERY PLAN                 
5639 --------------------------------------------
5640  Nested Loop
5641    Join Filter: (t2.val = t3.val)
5642    ->  Hash Join
5643          Hash Cond: (t1.id = t2.id)
5644          ->  Index Scan using t1_pkey on t1
5645                Index Cond: (id < 10)
5646          ->  Hash
5647                ->  Seq Scan on t2
5648    ->  Seq Scan on t3
5649 (9 rows)
5650
5651 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;
5652                        QUERY PLAN                       
5653 --------------------------------------------------------
5654  Nested Loop
5655    ->  Merge Join
5656          Merge Cond: (t3.id = t4.id)
5657          ->  Nested Loop
5658                Join Filter: (t1.val = t3.val)
5659                ->  Index Scan using t3_pkey on t3
5660                ->  Materialize
5661                      ->  Index Scan using t1_pkey on t1
5662                            Index Cond: (id < 10)
5663          ->  Sort
5664                Sort Key: t4.id
5665                ->  Seq Scan on t4
5666    ->  Index Scan using t2_pkey on t2
5667          Index Cond: (id = t1.id)
5668 (14 rows)
5669
5670 /*+Leading((((t1 t2) t3) t4))*/
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 LOG:  pg_hint_plan:
5673 used hint:
5674 Leading((((t1 t2) t3) t4))
5675 not used hint:
5676 duplication hint:
5677 error hint:
5678
5679                     QUERY PLAN                    
5680 --------------------------------------------------
5681  Nested Loop
5682    ->  Nested Loop
5683          Join Filter: (t1.val = t3.val)
5684          ->  Hash Join
5685                Hash Cond: (t1.id = t2.id)
5686                ->  Index Scan using t1_pkey on t1
5687                      Index Cond: (id < 10)
5688                ->  Hash
5689                      ->  Seq Scan on t2
5690          ->  Seq Scan on t3
5691    ->  Index Scan using t4_pkey on t4
5692          Index Cond: (id = t3.id)
5693 (12 rows)
5694
5695 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5696                        QUERY PLAN                       
5697 --------------------------------------------------------
5698  Hash Join
5699    Hash Cond: (t3.val = t2.val)
5700    ->  Seq Scan on t3
5701    ->  Hash
5702          ->  Hash Join
5703                Hash Cond: (t2.id = t1.id)
5704                ->  Seq Scan on t2
5705                ->  Hash
5706                      ->  Index Scan using t1_pkey on t1
5707                            Index Cond: (id < 10)
5708 (10 rows)
5709
5710 /*+Leading(((t1 t2) t3))*/
5711 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5712 LOG:  pg_hint_plan:
5713 used hint:
5714 Leading(((t1 t2) t3))
5715 not used hint:
5716 duplication hint:
5717 error hint:
5718
5719                  QUERY PLAN                 
5720 --------------------------------------------
5721  Nested Loop
5722    Join Filter: (t2.val = t3.val)
5723    ->  Hash Join
5724          Hash Cond: (t1.id = t2.id)
5725          ->  Index Scan using t1_pkey on t1
5726                Index Cond: (id < 10)
5727          ->  Hash
5728                ->  Seq Scan on t2
5729    ->  Seq Scan on t3
5730 (9 rows)
5731
5732 /*+Leading((t1 (t2 t3)))*/
5733 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5734 LOG:  pg_hint_plan:
5735 used hint:
5736 Leading((t1 (t2 t3)))
5737 not used hint:
5738 duplication hint:
5739 error hint:
5740
5741                  QUERY PLAN                 
5742 --------------------------------------------
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          ->  Hash Join
5749                Hash Cond: (t2.val = t3.val)
5750                ->  Seq Scan on t2
5751                ->  Hash
5752                      ->  Seq Scan on t3
5753 (10 rows)
5754
5755 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;
5756                        QUERY PLAN                       
5757 --------------------------------------------------------
5758  Nested Loop
5759    ->  Merge Join
5760          Merge Cond: (t3.id = t4.id)
5761          ->  Nested Loop
5762                Join Filter: (t1.val = t3.val)
5763                ->  Index Scan using t3_pkey on t3
5764                ->  Materialize
5765                      ->  Index Scan using t1_pkey on t1
5766                            Index Cond: (id < 10)
5767          ->  Sort
5768                Sort Key: t4.id
5769                ->  Seq Scan on t4
5770    ->  Index Scan using t2_pkey on t2
5771          Index Cond: (id = t1.id)
5772 (14 rows)
5773
5774 /*+Leading(((t1 t2) (t3 t4)))*/
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 LOG:  pg_hint_plan:
5777 used hint:
5778 Leading(((t1 t2) (t3 t4)))
5779 not used hint:
5780 duplication hint:
5781 error hint:
5782
5783                  QUERY PLAN                 
5784 --------------------------------------------
5785  Nested Loop
5786    Join Filter: (t1.val = t3.val)
5787    ->  Hash Join
5788          Hash Cond: (t1.id = t2.id)
5789          ->  Index Scan using t1_pkey on t1
5790                Index Cond: (id < 10)
5791          ->  Hash
5792                ->  Seq Scan on t2
5793    ->  Merge Join
5794          Merge Cond: (t3.id = t4.id)
5795          ->  Index Scan using t3_pkey on t3
5796          ->  Sort
5797                Sort Key: t4.id
5798                ->  Seq Scan on t4
5799 (14 rows)
5800
5801 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);
5802                              QUERY PLAN                             
5803 --------------------------------------------------------------------
5804  Hash Join
5805    Hash Cond: (t2.val = t3.val)
5806    InitPlan 1 (returns $1)
5807      ->  Limit
5808            ->  Sort
5809                  Sort Key: t1_2.id
5810                  ->  Nested Loop
5811                        ->  Index Scan using t2_val on t2 t2_2
5812                              Index Cond: (val > 100)
5813                        ->  Index Only Scan using t1_pkey on t1 t1_2
5814                              Index Cond: (id = t2_2.id)
5815    ->  Merge Join
5816          Merge Cond: (t1.id = t2.id)
5817          ->  Index Scan using t1_pkey on t1
5818                Index Cond: (id < $1)
5819          ->  Index Scan using t2_pkey on t2
5820    ->  Hash
5821          ->  Seq Scan on t3
5822 (18 rows)
5823
5824 /*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
5825 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);
5826 INFO:  pg_hint_plan: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
5827 DETAIL:  Conflict leading hint.
5828 LOG:  pg_hint_plan:
5829 used hint:
5830 Leading(((t3 t1) t2))
5831 not used hint:
5832 duplication hint:
5833 Leading(((t1 t2) t3))
5834 error hint:
5835
5836                              QUERY PLAN                             
5837 --------------------------------------------------------------------
5838  Hash Join
5839    Hash Cond: (t1.id = t2.id)
5840    InitPlan 1 (returns $1)
5841      ->  Limit
5842            ->  Sort
5843                  Sort Key: t1_2.id
5844                  ->  Nested Loop
5845                        ->  Index Scan using t2_val on t2 t2_2
5846                              Index Cond: (val > 100)
5847                        ->  Index Only Scan using t1_pkey on t1 t1_2
5848                              Index Cond: (id = t2_2.id)
5849    ->  Hash Join
5850          Hash Cond: (t3.val = t1.val)
5851          ->  Seq Scan on t3
5852          ->  Hash
5853                ->  Index Scan using t1_pkey on t1
5854                      Index Cond: (id < $1)
5855    ->  Hash
5856          ->  Seq Scan on t2
5857 (19 rows)
5858
5859 /*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/
5860 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);
5861 LOG:  pg_hint_plan:
5862 used hint:
5863 Leading(((t1 t2) t3))
5864 Leading((t1_2 t2_2))
5865 not used hint:
5866 duplication hint:
5867 error hint:
5868
5869                           QUERY PLAN                          
5870 --------------------------------------------------------------
5871  Hash Join
5872    Hash Cond: (t2.val = t3.val)
5873    InitPlan 1 (returns $0)
5874      ->  Limit
5875            ->  Merge Join
5876                  Merge Cond: (t1_2.id = t2_2.id)
5877                  ->  Index Only Scan using t1_pkey on t1 t1_2
5878                  ->  Sort
5879                        Sort Key: t2_2.id
5880                        ->  Index Scan using t2_val on t2 t2_2
5881                              Index Cond: (val > 100)
5882    ->  Merge Join
5883          Merge Cond: (t1.id = t2.id)
5884          ->  Index Scan using t1_pkey on t1
5885                Index Cond: (id < $0)
5886          ->  Index Scan using t2_pkey on t2
5887    ->  Hash
5888          ->  Seq Scan on t3
5889 (18 rows)
5890
5891 /*+Leading(((((t1 t2) t3) t1_2) t2_2))*/
5892 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);
5893 LOG:  pg_hint_plan:
5894 used hint:
5895 not used hint:
5896 Leading(((((t1 t2) t3) t1_2) t2_2))
5897 duplication hint:
5898 error hint:
5899
5900                              QUERY PLAN                             
5901 --------------------------------------------------------------------
5902  Hash Join
5903    Hash Cond: (t2.val = t3.val)
5904    InitPlan 1 (returns $1)
5905      ->  Limit
5906            ->  Sort
5907                  Sort Key: t1_2.id
5908                  ->  Nested Loop
5909                        ->  Index Scan using t2_val on t2 t2_2
5910                              Index Cond: (val > 100)
5911                        ->  Index Only Scan using t1_pkey on t1 t1_2
5912                              Index Cond: (id = t2_2.id)
5913    ->  Merge Join
5914          Merge Cond: (t1.id = t2.id)
5915          ->  Index Scan using t1_pkey on t1
5916                Index Cond: (id < $1)
5917          ->  Index Scan using t2_pkey on t2
5918    ->  Hash
5919          ->  Seq Scan on t3
5920 (18 rows)
5921
5922 -- Specified outer/inner leading hint and join method hint at the same time
5923 /*+Leading(((t1 t2) t3))*/
5924 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5925 LOG:  pg_hint_plan:
5926 used hint:
5927 Leading(((t1 t2) t3))
5928 not used hint:
5929 duplication hint:
5930 error hint:
5931
5932                  QUERY PLAN                 
5933 --------------------------------------------
5934  Nested Loop
5935    Join Filter: (t2.val = t3.val)
5936    ->  Hash Join
5937          Hash Cond: (t1.id = t2.id)
5938          ->  Index Scan using t1_pkey on t1
5939                Index Cond: (id < 10)
5940          ->  Hash
5941                ->  Seq Scan on t2
5942    ->  Seq Scan on t3
5943 (9 rows)
5944
5945 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/
5946 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5947 LOG:  pg_hint_plan:
5948 used hint:
5949 MergeJoin(t1 t2)
5950 Leading(((t1 t2) t3))
5951 not used hint:
5952 duplication hint:
5953 error hint:
5954
5955                  QUERY PLAN                 
5956 --------------------------------------------
5957  Nested Loop
5958    Join Filter: (t2.val = t3.val)
5959    ->  Merge Join
5960          Merge Cond: (t1.id = t2.id)
5961          ->  Index Scan using t1_pkey on t1
5962                Index Cond: (id < 10)
5963          ->  Index Scan using t2_pkey on t2
5964    ->  Seq Scan on t3
5965 (8 rows)
5966
5967 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/
5968 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5969 LOG:  pg_hint_plan:
5970 used hint:
5971 MergeJoin(t1 t2 t3)
5972 Leading(((t1 t2) t3))
5973 not used hint:
5974 duplication hint:
5975 error hint:
5976
5977                     QUERY PLAN                    
5978 --------------------------------------------------
5979  Merge Join
5980    Merge Cond: (t2.val = t3.val)
5981    ->  Sort
5982          Sort Key: t2.val
5983          ->  Hash Join
5984                Hash Cond: (t1.id = t2.id)
5985                ->  Index Scan using t1_pkey on t1
5986                      Index Cond: (id < 10)
5987                ->  Hash
5988                      ->  Seq Scan on t2
5989    ->  Sort
5990          Sort Key: t3.val
5991          ->  Seq Scan on t3
5992 (13 rows)
5993
5994 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/
5995 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
5996 LOG:  pg_hint_plan:
5997 used hint:
5998 Leading(((t1 t2) t3))
5999 not used hint:
6000 MergeJoin(t1 t3)
6001 duplication hint:
6002 error hint:
6003
6004                  QUERY PLAN                 
6005 --------------------------------------------
6006  Nested Loop
6007    Join Filter: (t2.val = t3.val)
6008    ->  Hash Join
6009          Hash Cond: (t1.id = t2.id)
6010          ->  Index Scan using t1_pkey on t1
6011                Index Cond: (id < 10)
6012          ->  Hash
6013                ->  Seq Scan on t2
6014    ->  Seq Scan on t3
6015 (9 rows)
6016
6017 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;
6018                        QUERY PLAN                       
6019 --------------------------------------------------------
6020  Nested Loop
6021    ->  Merge Join
6022          Merge Cond: (t3.id = t4.id)
6023          ->  Nested Loop
6024                Join Filter: (t1.val = t3.val)
6025                ->  Index Scan using t3_pkey on t3
6026                ->  Materialize
6027                      ->  Index Scan using t1_pkey on t1
6028                            Index Cond: (id < 10)
6029          ->  Sort
6030                Sort Key: t4.id
6031                ->  Seq Scan on t4
6032    ->  Index Scan using t2_pkey on t2
6033          Index Cond: (id = t1.id)
6034 (14 rows)
6035
6036 /*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/
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 LOG:  pg_hint_plan:
6039 used hint:
6040 Leading(((t1 t2) t3))
6041 not used hint:
6042 MergeJoin(t3 t4)
6043 duplication hint:
6044 error hint:
6045
6046                     QUERY PLAN                    
6047 --------------------------------------------------
6048  Nested Loop
6049    Join Filter: (t3.id = t4.id)
6050    ->  Nested Loop
6051          Join Filter: (t1.val = t3.val)
6052          ->  Hash Join
6053                Hash Cond: (t1.id = t2.id)
6054                ->  Index Scan using t1_pkey on t1
6055                      Index Cond: (id < 10)
6056                ->  Hash
6057                      ->  Seq Scan on t2
6058          ->  Seq Scan on t3
6059    ->  Seq Scan on t4
6060 (12 rows)
6061
6062 /*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
6063 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;
6064 LOG:  pg_hint_plan:
6065 used hint:
6066 MergeJoin(t1 t2 t3 t4)
6067 Leading(((t1 t2) t3))
6068 not used hint:
6069 duplication hint:
6070 error hint:
6071
6072                        QUERY PLAN                       
6073 --------------------------------------------------------
6074  Merge Join
6075    Merge Cond: (t3.id = t4.id)
6076    ->  Sort
6077          Sort Key: t3.id
6078          ->  Nested Loop
6079                Join Filter: (t1.val = t3.val)
6080                ->  Hash Join
6081                      Hash Cond: (t1.id = t2.id)
6082                      ->  Index Scan using t1_pkey on t1
6083                            Index Cond: (id < 10)
6084                      ->  Hash
6085                            ->  Seq Scan on t2
6086                ->  Seq Scan on t3
6087    ->  Sort
6088          Sort Key: t4.id
6089          ->  Seq Scan on t4
6090 (16 rows)
6091
6092 /*+ Leading ( ( t1 ( t2 t3 ) ) ) */
6093 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6094 LOG:  pg_hint_plan:
6095 used hint:
6096 Leading((t1 (t2 t3)))
6097 not used hint:
6098 duplication hint:
6099 error hint:
6100
6101                  QUERY PLAN                 
6102 --------------------------------------------
6103  Hash Join
6104    Hash Cond: (t1.id = t2.id)
6105    ->  Index Scan using t1_pkey on t1
6106          Index Cond: (id < 10)
6107    ->  Hash
6108          ->  Hash Join
6109                Hash Cond: (t2.val = t3.val)
6110                ->  Seq Scan on t2
6111                ->  Hash
6112                      ->  Seq Scan on t3
6113 (10 rows)
6114
6115 /*+Leading((t1(t2 t3)))*/
6116 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6117 LOG:  pg_hint_plan:
6118 used hint:
6119 Leading((t1 (t2 t3)))
6120 not used hint:
6121 duplication hint:
6122 error hint:
6123
6124                  QUERY PLAN                 
6125 --------------------------------------------
6126  Hash Join
6127    Hash Cond: (t1.id = t2.id)
6128    ->  Index Scan using t1_pkey on t1
6129          Index Cond: (id < 10)
6130    ->  Hash
6131          ->  Hash Join
6132                Hash Cond: (t2.val = t3.val)
6133                ->  Seq Scan on t2
6134                ->  Hash
6135                      ->  Seq Scan on t3
6136 (10 rows)
6137
6138 /*+Leading(("t1(t2" "t3)"))*/
6139 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6140 LOG:  pg_hint_plan:
6141 used hint:
6142 not used hint:
6143 Leading(("t1(t2" "t3)"))
6144 duplication hint:
6145 error hint:
6146
6147                        QUERY PLAN                       
6148 --------------------------------------------------------
6149  Hash Join
6150    Hash Cond: (t3.val = t2.val)
6151    ->  Seq Scan on t3
6152    ->  Hash
6153          ->  Hash Join
6154                Hash Cond: (t2.id = t1.id)
6155                ->  Seq Scan on t2
6156                ->  Hash
6157                      ->  Index Scan using t1_pkey on t1
6158                            Index Cond: (id < 10)
6159 (10 rows)
6160
6161 /*+ Leading ( ( ( t1 t2 ) t3 ) ) */
6162 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6163 LOG:  pg_hint_plan:
6164 used hint:
6165 Leading(((t1 t2) t3))
6166 not used hint:
6167 duplication hint:
6168 error hint:
6169
6170                  QUERY PLAN                 
6171 --------------------------------------------
6172  Nested Loop
6173    Join Filter: (t2.val = t3.val)
6174    ->  Hash Join
6175          Hash Cond: (t1.id = t2.id)
6176          ->  Index Scan using t1_pkey on t1
6177                Index Cond: (id < 10)
6178          ->  Hash
6179                ->  Seq Scan on t2
6180    ->  Seq Scan on t3
6181 (9 rows)
6182
6183 /*+Leading(((t1 t2)t3))*/
6184 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6185 LOG:  pg_hint_plan:
6186 used hint:
6187 Leading(((t1 t2) t3))
6188 not used hint:
6189 duplication hint:
6190 error hint:
6191
6192                  QUERY PLAN                 
6193 --------------------------------------------
6194  Nested Loop
6195    Join Filter: (t2.val = t3.val)
6196    ->  Hash Join
6197          Hash Cond: (t1.id = t2.id)
6198          ->  Index Scan using t1_pkey on t1
6199                Index Cond: (id < 10)
6200          ->  Hash
6201                ->  Seq Scan on t2
6202    ->  Seq Scan on t3
6203 (9 rows)
6204
6205 /*+Leading(("(t1" "t2)t3"))*/
6206 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
6207 LOG:  pg_hint_plan:
6208 used hint:
6209 not used hint:
6210 Leading(("(t1" "t2)t3"))
6211 duplication hint:
6212 error hint:
6213
6214                        QUERY PLAN                       
6215 --------------------------------------------------------
6216  Hash Join
6217    Hash Cond: (t3.val = t2.val)
6218    ->  Seq Scan on t3
6219    ->  Hash
6220          ->  Hash Join
6221                Hash Cond: (t2.id = t1.id)
6222                ->  Seq Scan on t2
6223                ->  Hash
6224                      ->  Index Scan using t1_pkey on t1
6225                            Index Cond: (id < 10)
6226 (10 rows)
6227
6228 /*+Leading((t1(t2(t3(t4 t5)))))*/
6229 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;
6230 LOG:  pg_hint_plan:
6231 used hint:
6232 Leading((t1 (t2 (t3 (t4 t5)))))
6233 not used hint:
6234 duplication hint:
6235 error hint:
6236
6237                                                             QUERY PLAN                                                            
6238 ----------------------------------------------------------------------------------------------------------------------------------
6239  Merge Join
6240    Merge Cond: (t1.id = t2.id)
6241    ->  Index Scan using t1_pkey on t1
6242    ->  Materialize
6243          ->  Merge Join
6244                Merge Cond: (t2.id = t3.id)
6245                ->  Index Scan using t2_pkey on t2
6246                ->  Materialize
6247                      ->  Merge Join
6248                            Merge Cond: (t3.id = t4.id)
6249                            ->  Index Scan using t3_pkey on t3
6250                            ->  Materialize
6251                                  ->  Merge Join
6252                                        Merge Cond: (t4.id = t5.id)
6253                                        ->  Index Scan using t4_pkey on t4
6254                                        ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6255 (16 rows)
6256
6257 /*+Leading((t5(t4(t3(t2 t1)))))*/
6258 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;
6259 LOG:  pg_hint_plan:
6260 used hint:
6261 Leading((t5 (t4 (t3 (t2 t1)))))
6262 not used hint:
6263 duplication hint:
6264 error hint:
6265
6266                                 QUERY PLAN                                
6267 --------------------------------------------------------------------------
6268  Hash Join
6269    Hash Cond: (t5.id = t1.id)
6270    ->  Seq Scan on t5
6271    ->  Hash
6272          ->  Merge Join
6273                Merge Cond: (t4.id = t1.id)
6274                ->  Sort
6275                      Sort Key: t4.id
6276                      ->  Seq Scan on t4
6277                ->  Materialize
6278                      ->  Merge Join
6279                            Merge Cond: (t3.id = t1.id)
6280                            ->  Sort
6281                                  Sort Key: t3.id
6282                                  ->  Seq Scan on t3
6283                            ->  Materialize
6284                                  ->  Merge Join
6285                                        Merge Cond: (t2.id = t1.id)
6286                                        ->  Index Scan using t2_pkey on t2
6287                                        ->  Index Scan using t1_pkey on t1
6288 (20 rows)
6289
6290 /*+Leading(((((t1 t2)t3)t4)t5))*/
6291 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;
6292 LOG:  pg_hint_plan:
6293 used hint:
6294 Leading(((((t1 t2) t3) t4) t5))
6295 not used hint:
6296 duplication hint:
6297 error hint:
6298
6299                                           QUERY PLAN                                          
6300 ----------------------------------------------------------------------------------------------
6301  Nested Loop
6302    ->  Merge Join
6303          Merge Cond: (t1.id = t4.id)
6304          ->  Merge Join
6305                Merge Cond: (t1.id = t3.id)
6306                ->  Merge Join
6307                      Merge Cond: (t1.id = t2.id)
6308                      ->  Index Scan using t1_pkey on t1
6309                      ->  Index Scan using t2_pkey on t2
6310                ->  Sort
6311                      Sort Key: t3.id
6312                      ->  Seq Scan on t3
6313          ->  Sort
6314                Sort Key: t4.id
6315                ->  Seq Scan on t4
6316    ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6317          Index Cond: (id = t1.id)
6318 (17 rows)
6319
6320 /*+Leading(((((t5 t4)t3)t2)t1))*/
6321 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;
6322 LOG:  pg_hint_plan:
6323 used hint:
6324 Leading(((((t5 t4) t3) t2) t1))
6325 not used hint:
6326 duplication hint:
6327 error hint:
6328
6329                                                    QUERY PLAN                                                   
6330 ----------------------------------------------------------------------------------------------------------------
6331  Nested Loop
6332    Join Filter: (t2.id = t1.id)
6333    ->  Nested Loop
6334          Join Filter: (t3.id = t2.id)
6335          ->  Merge Join
6336                Merge Cond: (t4.id = t3.id)
6337                ->  Merge Join
6338                      Merge Cond: (t5.id = t4.id)
6339                      ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6340                      ->  Sort
6341                            Sort Key: t4.id
6342                            ->  Seq Scan on t4
6343                ->  Index Scan using t3_pkey on t3
6344          ->  Index Scan using t2_pkey on t2
6345                Index Cond: (id = t5.id)
6346    ->  Index Scan using t1_pkey on t1
6347          Index Cond: (id = t5.id)
6348 (17 rows)
6349
6350 /*+Leading(((t1 t2)(t3(t4 t5))))*/
6351 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;
6352 LOG:  pg_hint_plan:
6353 used hint:
6354 Leading(((t1 t2) (t3 (t4 t5))))
6355 not used hint:
6356 duplication hint:
6357 error hint:
6358
6359                                                       QUERY PLAN                                                      
6360 ----------------------------------------------------------------------------------------------------------------------
6361  Merge Join
6362    Merge Cond: (t1.id = t3.id)
6363    ->  Merge Join
6364          Merge Cond: (t1.id = t2.id)
6365          ->  Index Scan using t1_pkey on t1
6366          ->  Index Scan using t2_pkey on t2
6367    ->  Materialize
6368          ->  Merge Join
6369                Merge Cond: (t3.id = t4.id)
6370                ->  Index Scan using t3_pkey on t3
6371                ->  Materialize
6372                      ->  Merge Join
6373                            Merge Cond: (t4.id = t5.id)
6374                            ->  Index Scan using t4_pkey on t4
6375                            ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6376 (15 rows)
6377
6378 /*+Leading(((t5 t4)(t3(t2 t1))))*/
6379 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;
6380 LOG:  pg_hint_plan:
6381 used hint:
6382 Leading(((t5 t4) (t3 (t2 t1))))
6383 not used hint:
6384 duplication hint:
6385 error hint:
6386
6387                                              QUERY PLAN                                             
6388 ----------------------------------------------------------------------------------------------------
6389  Merge Join
6390    Merge Cond: (t4.id = t1.id)
6391    ->  Merge Join
6392          Merge Cond: (t5.id = t4.id)
6393          ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6394          ->  Sort
6395                Sort Key: t4.id
6396                ->  Seq Scan on t4
6397    ->  Materialize
6398          ->  Merge Join
6399                Merge Cond: (t3.id = t1.id)
6400                ->  Sort
6401                      Sort Key: t3.id
6402                      ->  Seq Scan on t3
6403                ->  Materialize
6404                      ->  Merge Join
6405                            Merge Cond: (t2.id = t1.id)
6406                            ->  Index Scan using t2_pkey on t2
6407                            ->  Index Scan using t1_pkey on t1
6408 (19 rows)
6409
6410 /*+Leading((((t1 t2)t3)(t4 t5)))*/
6411 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;
6412 LOG:  pg_hint_plan:
6413 used hint:
6414 Leading((((t1 t2) t3) (t4 t5)))
6415 not used hint:
6416 duplication hint:
6417 error hint:
6418
6419                                                 QUERY PLAN                                                
6420 ----------------------------------------------------------------------------------------------------------
6421  Merge Join
6422    Merge Cond: (t1.id = t4.id)
6423    ->  Merge Join
6424          Merge Cond: (t1.id = t3.id)
6425          ->  Merge Join
6426                Merge Cond: (t1.id = t2.id)
6427                ->  Index Scan using t1_pkey on t1
6428                ->  Index Scan using t2_pkey on t2
6429          ->  Sort
6430                Sort Key: t3.id
6431                ->  Seq Scan on t3
6432    ->  Materialize
6433          ->  Merge Join
6434                Merge Cond: (t4.id = t5.id)
6435                ->  Index Scan using t4_pkey on t4
6436                ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6437 (16 rows)
6438
6439 /*+Leading((((t5 t4)t3)(t2 t1)))*/
6440 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;
6441 LOG:  pg_hint_plan:
6442 used hint:
6443 Leading((((t5 t4) t3) (t2 t1)))
6444 not used hint:
6445 duplication hint:
6446 error hint:
6447
6448                                                 QUERY PLAN                                                
6449 ----------------------------------------------------------------------------------------------------------
6450  Merge Join
6451    Merge Cond: (t3.id = t1.id)
6452    ->  Merge Join
6453          Merge Cond: (t4.id = t3.id)
6454          ->  Merge Join
6455                Merge Cond: (t5.id = t4.id)
6456                ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
6457                ->  Sort
6458                      Sort Key: t4.id
6459                      ->  Seq Scan on t4
6460          ->  Index Scan using t3_pkey on t3
6461    ->  Materialize
6462          ->  Merge Join
6463                Merge Cond: (t2.id = t1.id)
6464                ->  Index Scan using t2_pkey on t2
6465                ->  Index Scan using t1_pkey on t1
6466 (16 rows)
6467
6468 -- inherite table test to specify the index's name
6469 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6470                               QUERY PLAN                               
6471 -----------------------------------------------------------------------
6472  Append
6473    ->  Seq Scan on p2
6474          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6475    ->  Seq Scan on p2_c1
6476          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6477    ->  Seq Scan on p2_c1_c1
6478          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6479    ->  Seq Scan on p2_c1_c2
6480          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6481 (9 rows)
6482
6483 /*+IndexScan(p2 p2_pkey)*/
6484 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6485 LOG:  available indexes for IndexScan(p2): p2_pkey
6486 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6487 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6488 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6489 LOG:  pg_hint_plan:
6490 used hint:
6491 IndexScan(p2 p2_pkey)
6492 not used hint:
6493 duplication hint:
6494 error hint:
6495
6496                     QUERY PLAN                    
6497 --------------------------------------------------
6498  Append
6499    ->  Index Scan using p2_pkey on p2
6500          Index Cond: ((id >= 50) AND (id <= 51))
6501          Filter: (ctid = '(1,1)'::tid)
6502    ->  Index Scan using p2_c1_pkey on p2_c1
6503          Index Cond: ((id >= 50) AND (id <= 51))
6504          Filter: (ctid = '(1,1)'::tid)
6505    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6506          Index Cond: ((id >= 50) AND (id <= 51))
6507          Filter: (ctid = '(1,1)'::tid)
6508    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6509          Index Cond: ((id >= 50) AND (id <= 51))
6510          Filter: (ctid = '(1,1)'::tid)
6511 (13 rows)
6512
6513 /*+IndexScan(p2 p2_id_val_idx)*/
6514 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6515 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
6516 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6517 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
6518 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
6519 LOG:  pg_hint_plan:
6520 used hint:
6521 IndexScan(p2 p2_id_val_idx)
6522 not used hint:
6523 duplication hint:
6524 error hint:
6525
6526                        QUERY PLAN                       
6527 --------------------------------------------------------
6528  Append
6529    ->  Index Scan using p2_id_val_idx on p2
6530          Index Cond: ((id >= 50) AND (id <= 51))
6531          Filter: (ctid = '(1,1)'::tid)
6532    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6533          Index Cond: ((id >= 50) AND (id <= 51))
6534          Filter: (ctid = '(1,1)'::tid)
6535    ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
6536          Index Cond: ((id >= 50) AND (id <= 51))
6537          Filter: (ctid = '(1,1)'::tid)
6538    ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
6539          Index Cond: ((id >= 50) AND (id <= 51))
6540          Filter: (ctid = '(1,1)'::tid)
6541 (13 rows)
6542
6543 /*+IndexScan(p2 p2_val_id_idx)*/
6544 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6545 LOG:  available indexes for IndexScan(p2): p2_val_id_idx
6546 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_id_idx
6547 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx
6548 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx
6549 LOG:  pg_hint_plan:
6550 used hint:
6551 IndexScan(p2 p2_val_id_idx)
6552 not used hint:
6553 duplication hint:
6554 error hint:
6555
6556                        QUERY PLAN                       
6557 --------------------------------------------------------
6558  Append
6559    ->  Index Scan using p2_val_id_idx on p2
6560          Index Cond: ((id >= 50) AND (id <= 51))
6561          Filter: (ctid = '(1,1)'::tid)
6562    ->  Index Scan using p2_c1_val_id_idx on p2_c1
6563          Index Cond: ((id >= 50) AND (id <= 51))
6564          Filter: (ctid = '(1,1)'::tid)
6565    ->  Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1
6566          Index Cond: ((id >= 50) AND (id <= 51))
6567          Filter: (ctid = '(1,1)'::tid)
6568    ->  Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2
6569          Index Cond: ((id >= 50) AND (id <= 51))
6570          Filter: (ctid = '(1,1)'::tid)
6571 (13 rows)
6572
6573 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6574                                        QUERY PLAN                                        
6575 -----------------------------------------------------------------------------------------
6576  Append
6577    ->  Seq Scan on p2
6578          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6579    ->  Seq Scan on p2_c1
6580          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6581    ->  Seq Scan on p2_c2
6582          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6583    ->  Seq Scan on p2_c3
6584          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6585    ->  Seq Scan on p2_c4
6586          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6587    ->  Seq Scan on p2_c1_c1
6588          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6589    ->  Seq Scan on p2_c1_c2
6590          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6591    ->  Seq Scan on p2_c3_c1
6592          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6593    ->  Seq Scan on p2_c3_c2
6594          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6595 (19 rows)
6596
6597 -- Inhibit parallel exection to avoid interfaring the hint
6598 set max_parallel_workers_per_gather to 0;
6599 /*+ IndexScan(p2 p2_val)*/
6600 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6601 LOG:  available indexes for IndexScan(p2):
6602 LOG:  available indexes for IndexScan(p2_c1):
6603 LOG:  available indexes for IndexScan(p2_c2):
6604 LOG:  available indexes for IndexScan(p2_c3):
6605 LOG:  available indexes for IndexScan(p2_c4):
6606 LOG:  available indexes for IndexScan(p2_c1_c1):
6607 LOG:  available indexes for IndexScan(p2_c1_c2):
6608 LOG:  available indexes for IndexScan(p2_c3_c1):
6609 LOG:  available indexes for IndexScan(p2_c3_c2):
6610 LOG:  pg_hint_plan:
6611 used hint:
6612 IndexScan(p2 p2_val)
6613 not used hint:
6614 duplication hint:
6615 error hint:
6616
6617                                        QUERY PLAN                                        
6618 -----------------------------------------------------------------------------------------
6619  Append
6620    ->  Seq Scan on p2
6621          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6622    ->  Seq Scan on p2_c1
6623          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6624    ->  Seq Scan on p2_c2
6625          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6626    ->  Seq Scan on p2_c3
6627          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6628    ->  Seq Scan on p2_c4
6629          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6630    ->  Seq Scan on p2_c1_c1
6631          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6632    ->  Seq Scan on p2_c1_c2
6633          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6634    ->  Seq Scan on p2_c3_c1
6635          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6636    ->  Seq Scan on p2_c3_c2
6637          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6638 (19 rows)
6639
6640 /*+IndexScan(p2 p2_pkey)*/
6641 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6642 LOG:  available indexes for IndexScan(p2): p2_pkey
6643 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6644 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6645 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6646 LOG:  pg_hint_plan:
6647 used hint:
6648 IndexScan(p2 p2_pkey)
6649 not used hint:
6650 duplication hint:
6651 error hint:
6652
6653                     QUERY PLAN                    
6654 --------------------------------------------------
6655  Append
6656    ->  Index Scan using p2_pkey on p2
6657          Index Cond: ((id >= 50) AND (id <= 51))
6658          Filter: (ctid = '(1,1)'::tid)
6659    ->  Index Scan using p2_c1_pkey on p2_c1
6660          Index Cond: ((id >= 50) AND (id <= 51))
6661          Filter: (ctid = '(1,1)'::tid)
6662    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6663          Index Cond: ((id >= 50) AND (id <= 51))
6664          Filter: (ctid = '(1,1)'::tid)
6665    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6666          Index Cond: ((id >= 50) AND (id <= 51))
6667          Filter: (ctid = '(1,1)'::tid)
6668 (13 rows)
6669
6670 /*+IndexScan(p2 p2_id2_val)*/
6671 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6672 LOG:  available indexes for IndexScan(p2): p2_id2_val
6673 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id2_val
6674 LOG:  available indexes for IndexScan(p2_c1_c1):
6675 LOG:  available indexes for IndexScan(p2_c1_c2):
6676 LOG:  pg_hint_plan:
6677 used hint:
6678 IndexScan(p2 p2_id2_val)
6679 not used hint:
6680 duplication hint:
6681 error hint:
6682
6683                               QUERY PLAN                               
6684 -----------------------------------------------------------------------
6685  Append
6686    ->  Index Scan using p2_id2_val on p2
6687          Index Cond: ((id >= 50) AND (id <= 51))
6688          Filter: (ctid = '(1,1)'::tid)
6689    ->  Index Scan using p2_c1_id2_val on p2_c1
6690          Index Cond: ((id >= 50) AND (id <= 51))
6691          Filter: (ctid = '(1,1)'::tid)
6692    ->  Seq Scan on p2_c1_c1
6693          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6694    ->  Seq Scan on p2_c1_c2
6695          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6696 (11 rows)
6697
6698 /*+IndexScan(p2 p2_val2_id)*/
6699 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6700 LOG:  available indexes for IndexScan(p2): p2_val2_id
6701 LOG:  available indexes for IndexScan(p2_c1):
6702 LOG:  available indexes for IndexScan(p2_c1_c1):
6703 LOG:  available indexes for IndexScan(p2_c1_c2):
6704 LOG:  pg_hint_plan:
6705 used hint:
6706 IndexScan(p2 p2_val2_id)
6707 not used hint:
6708 duplication hint:
6709 error hint:
6710
6711                               QUERY PLAN                               
6712 -----------------------------------------------------------------------
6713  Append
6714    ->  Index Scan using p2_val2_id on p2
6715          Index Cond: ((id >= 50) AND (id <= 51))
6716          Filter: (ctid = '(1,1)'::tid)
6717    ->  Seq Scan on p2_c1
6718          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6719    ->  Seq Scan on p2_c1_c1
6720          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6721    ->  Seq Scan on p2_c1_c2
6722          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6723 (10 rows)
6724
6725 /*+IndexScan(p2 p2_pkey)*/
6726 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6727 LOG:  available indexes for IndexScan(p2): p2_pkey
6728 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6729 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6730 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6731 LOG:  pg_hint_plan:
6732 used hint:
6733 IndexScan(p2 p2_pkey)
6734 not used hint:
6735 duplication hint:
6736 error hint:
6737
6738                     QUERY PLAN                    
6739 --------------------------------------------------
6740  Append
6741    ->  Index Scan using p2_pkey on p2
6742          Index Cond: ((id >= 50) AND (id <= 51))
6743          Filter: (ctid = '(1,1)'::tid)
6744    ->  Index Scan using p2_c1_pkey on p2_c1
6745          Index Cond: ((id >= 50) AND (id <= 51))
6746          Filter: (ctid = '(1,1)'::tid)
6747    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6748          Index Cond: ((id >= 50) AND (id <= 51))
6749          Filter: (ctid = '(1,1)'::tid)
6750    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6751          Index Cond: ((id >= 50) AND (id <= 51))
6752          Filter: (ctid = '(1,1)'::tid)
6753 (13 rows)
6754
6755 /*+IndexScan(p2 p2_c1_id_val_idx)*/
6756 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6757 LOG:  available indexes for IndexScan(p2):
6758 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6759 LOG:  available indexes for IndexScan(p2_c1_c1):
6760 LOG:  available indexes for IndexScan(p2_c1_c2):
6761 LOG:  pg_hint_plan:
6762 used hint:
6763 IndexScan(p2 p2_c1_id_val_idx)
6764 not used hint:
6765 duplication hint:
6766 error hint:
6767
6768                               QUERY PLAN                               
6769 -----------------------------------------------------------------------
6770  Append
6771    ->  Seq Scan on p2
6772          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6773    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6774          Index Cond: ((id >= 50) AND (id <= 51))
6775          Filter: (ctid = '(1,1)'::tid)
6776    ->  Seq Scan on p2_c1_c1
6777          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6778    ->  Seq Scan on p2_c1_c2
6779          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6780 (10 rows)
6781
6782 /*+IndexScan(p2 no_exist)*/
6783 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6784 LOG:  available indexes for IndexScan(p2):
6785 LOG:  available indexes for IndexScan(p2_c1):
6786 LOG:  available indexes for IndexScan(p2_c1_c1):
6787 LOG:  available indexes for IndexScan(p2_c1_c2):
6788 LOG:  pg_hint_plan:
6789 used hint:
6790 IndexScan(p2 no_exist)
6791 not used hint:
6792 duplication hint:
6793 error hint:
6794
6795                               QUERY PLAN                               
6796 -----------------------------------------------------------------------
6797  Append
6798    ->  Seq Scan on p2
6799          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6800    ->  Seq Scan on p2_c1
6801          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6802    ->  Seq Scan on p2_c1_c1
6803          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6804    ->  Seq Scan on p2_c1_c2
6805          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6806 (9 rows)
6807
6808 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
6809 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6810 LOG:  available indexes for IndexScan(p2): p2_pkey
6811 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6812 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6813 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6814 LOG:  pg_hint_plan:
6815 used hint:
6816 IndexScan(p2 p2_pkey p2_c1_id_val_idx)
6817 not used hint:
6818 duplication hint:
6819 error hint:
6820
6821                     QUERY PLAN                    
6822 --------------------------------------------------
6823  Append
6824    ->  Index Scan using p2_pkey on p2
6825          Index Cond: ((id >= 50) AND (id <= 51))
6826          Filter: (ctid = '(1,1)'::tid)
6827    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6828          Index Cond: ((id >= 50) AND (id <= 51))
6829          Filter: (ctid = '(1,1)'::tid)
6830    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6831          Index Cond: ((id >= 50) AND (id <= 51))
6832          Filter: (ctid = '(1,1)'::tid)
6833    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6834          Index Cond: ((id >= 50) AND (id <= 51))
6835          Filter: (ctid = '(1,1)'::tid)
6836 (13 rows)
6837
6838 /*+IndexScan(p2 p2_pkey no_exist)*/
6839 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6840 LOG:  available indexes for IndexScan(p2): p2_pkey
6841 LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
6842 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6843 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6844 LOG:  pg_hint_plan:
6845 used hint:
6846 IndexScan(p2 p2_pkey no_exist)
6847 not used hint:
6848 duplication hint:
6849 error hint:
6850
6851                     QUERY PLAN                    
6852 --------------------------------------------------
6853  Append
6854    ->  Index Scan using p2_pkey on p2
6855          Index Cond: ((id >= 50) AND (id <= 51))
6856          Filter: (ctid = '(1,1)'::tid)
6857    ->  Index Scan using p2_c1_pkey on p2_c1
6858          Index Cond: ((id >= 50) AND (id <= 51))
6859          Filter: (ctid = '(1,1)'::tid)
6860    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6861          Index Cond: ((id >= 50) AND (id <= 51))
6862          Filter: (ctid = '(1,1)'::tid)
6863    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6864          Index Cond: ((id >= 50) AND (id <= 51))
6865          Filter: (ctid = '(1,1)'::tid)
6866 (13 rows)
6867
6868 /*+IndexScan(p2 p2_c1_id_val_idx no_exist)*/
6869 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6870 LOG:  available indexes for IndexScan(p2):
6871 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
6872 LOG:  available indexes for IndexScan(p2_c1_c1):
6873 LOG:  available indexes for IndexScan(p2_c1_c2):
6874 LOG:  pg_hint_plan:
6875 used hint:
6876 IndexScan(p2 p2_c1_id_val_idx no_exist)
6877 not used hint:
6878 duplication hint:
6879 error hint:
6880
6881                               QUERY PLAN                               
6882 -----------------------------------------------------------------------
6883  Append
6884    ->  Seq Scan on p2
6885          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6886    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6887          Index Cond: ((id >= 50) AND (id <= 51))
6888          Filter: (ctid = '(1,1)'::tid)
6889    ->  Seq Scan on p2_c1_c1
6890          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6891    ->  Seq Scan on p2_c1_c2
6892          Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
6893 (10 rows)
6894
6895 /*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
6896 EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
6897 LOG:  available indexes for IndexScan(p2): p2_pkey
6898 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
6899 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
6900 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
6901 LOG:  pg_hint_plan:
6902 used hint:
6903 IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)
6904 not used hint:
6905 duplication hint:
6906 error hint:
6907
6908                     QUERY PLAN                    
6909 --------------------------------------------------
6910  Append
6911    ->  Index Scan using p2_pkey on p2
6912          Index Cond: ((id >= 50) AND (id <= 51))
6913          Filter: (ctid = '(1,1)'::tid)
6914    ->  Index Scan using p2_c1_id_val_idx on p2_c1
6915          Index Cond: ((id >= 50) AND (id <= 51))
6916          Filter: (ctid = '(1,1)'::tid)
6917    ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1
6918          Index Cond: ((id >= 50) AND (id <= 51))
6919          Filter: (ctid = '(1,1)'::tid)
6920    ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2
6921          Index Cond: ((id >= 50) AND (id <= 51))
6922          Filter: (ctid = '(1,1)'::tid)
6923 (13 rows)
6924
6925 /*+IndexScan(p2 p2_val_idx)*/
6926 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6927 LOG:  available indexes for IndexScan(p2): p2_val_idx
6928 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx
6929 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx
6930 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx
6931 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx
6932 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx
6933 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx
6934 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx
6935 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx
6936 LOG:  pg_hint_plan:
6937 used hint:
6938 IndexScan(p2 p2_val_idx)
6939 not used hint:
6940 duplication hint:
6941 error hint:
6942
6943                             QUERY PLAN                             
6944 -------------------------------------------------------------------
6945  Append
6946    ->  Index Scan using p2_val_idx on p2
6947          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6948          Filter: (ctid = '(1,1)'::tid)
6949    ->  Index Scan using p2_c1_val_idx on p2_c1
6950          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6951          Filter: (ctid = '(1,1)'::tid)
6952    ->  Index Scan using p2_c2_val_idx on p2_c2
6953          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6954          Filter: (ctid = '(1,1)'::tid)
6955    ->  Index Scan using p2_c3_val_idx on p2_c3
6956          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6957          Filter: (ctid = '(1,1)'::tid)
6958    ->  Index Scan using p2_c4_val_idx on p2_c4
6959          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6960          Filter: (ctid = '(1,1)'::tid)
6961    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
6962          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6963          Filter: (ctid = '(1,1)'::tid)
6964    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
6965          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6966          Filter: (ctid = '(1,1)'::tid)
6967    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
6968          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6969          Filter: (ctid = '(1,1)'::tid)
6970    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
6971          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
6972          Filter: (ctid = '(1,1)'::tid)
6973 (28 rows)
6974
6975 /*+IndexScan(p2 p2_expr)*/
6976 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
6977 LOG:  available indexes for IndexScan(p2): p2_expr
6978 LOG:  available indexes for IndexScan(p2_c1): p2_c1_expr_idx
6979 LOG:  available indexes for IndexScan(p2_c2): p2_c2_expr_idx
6980 LOG:  available indexes for IndexScan(p2_c3): p2_c3_expr_idx
6981 LOG:  available indexes for IndexScan(p2_c4): p2_c4_expr_idx
6982 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_expr_idx
6983 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_expr_idx
6984 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_expr_idx
6985 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_expr_idx
6986 LOG:  pg_hint_plan:
6987 used hint:
6988 IndexScan(p2 p2_expr)
6989 not used hint:
6990 duplication hint:
6991 error hint:
6992
6993                                        QUERY PLAN                                        
6994 -----------------------------------------------------------------------------------------
6995  Append
6996    ->  Seq Scan on p2
6997          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
6998    ->  Seq Scan on p2_c1
6999          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7000    ->  Seq Scan on p2_c2
7001          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7002    ->  Seq Scan on p2_c3
7003          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7004    ->  Seq Scan on p2_c4
7005          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7006    ->  Seq Scan on p2_c1_c1
7007          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7008    ->  Seq Scan on p2_c1_c2
7009          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7010    ->  Seq Scan on p2_c3_c1
7011          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7012    ->  Seq Scan on p2_c3_c2
7013          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7014 (19 rows)
7015
7016 /*+IndexScan(p2 p2_val_idx6)*/
7017 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7018 LOG:  available indexes for IndexScan(p2): p2_val_idx6
7019 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6
7020 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6
7021 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6
7022 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6
7023 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6
7024 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6
7025 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6
7026 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6
7027 LOG:  pg_hint_plan:
7028 used hint:
7029 IndexScan(p2 p2_val_idx6)
7030 not used hint:
7031 duplication hint:
7032 error hint:
7033
7034                                        QUERY PLAN                                        
7035 -----------------------------------------------------------------------------------------
7036  Append
7037    ->  Seq Scan on p2
7038          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7039    ->  Seq Scan on p2_c1
7040          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7041    ->  Seq Scan on p2_c2
7042          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7043    ->  Seq Scan on p2_c3
7044          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7045    ->  Seq Scan on p2_c4
7046          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7047    ->  Seq Scan on p2_c1_c1
7048          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7049    ->  Seq Scan on p2_c1_c2
7050          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7051    ->  Seq Scan on p2_c3_c1
7052          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7053    ->  Seq Scan on p2_c3_c2
7054          Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
7055 (19 rows)
7056
7057 /*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
7058 EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
7059 LOG:  available indexes for IndexScan(p2): p2_val_idx6 p2_val_idx
7060 LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6 p2_c1_val_idx
7061 LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6 p2_c2_val_idx
7062 LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6 p2_c3_val_idx
7063 LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6 p2_c4_val_idx
7064 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6 p2_c1_c1_val_idx
7065 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6 p2_c1_c2_val_idx
7066 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6 p2_c3_c1_val_idx
7067 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6 p2_c3_c2_val_idx
7068 LOG:  pg_hint_plan:
7069 used hint:
7070 IndexScan(p2 p2_val_idx p2_val_idx6)
7071 not used hint:
7072 duplication hint:
7073 error hint:
7074
7075                             QUERY PLAN                             
7076 -------------------------------------------------------------------
7077  Append
7078    ->  Index Scan using p2_val_idx on p2
7079          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7080          Filter: (ctid = '(1,1)'::tid)
7081    ->  Index Scan using p2_c1_val_idx on p2_c1
7082          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7083          Filter: (ctid = '(1,1)'::tid)
7084    ->  Index Scan using p2_c2_val_idx on p2_c2
7085          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7086          Filter: (ctid = '(1,1)'::tid)
7087    ->  Index Scan using p2_c3_val_idx on p2_c3
7088          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7089          Filter: (ctid = '(1,1)'::tid)
7090    ->  Index Scan using p2_c4_val_idx on p2_c4
7091          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7092          Filter: (ctid = '(1,1)'::tid)
7093    ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1
7094          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7095          Filter: (ctid = '(1,1)'::tid)
7096    ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2
7097          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7098          Filter: (ctid = '(1,1)'::tid)
7099    ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1
7100          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7101          Filter: (ctid = '(1,1)'::tid)
7102    ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2
7103          Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
7104          Filter: (ctid = '(1,1)'::tid)
7105 (28 rows)
7106
7107 -- regular expression
7108 -- ordinary table
7109 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7110                                          QUERY PLAN                                          
7111 ---------------------------------------------------------------------------------------------
7112  Index Only Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
7113    Index Cond: (id = 1)
7114 (2 rows)
7115
7116 /*+ IndexScanRegexp(t5 t5_[^i].*)*/
7117 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7118 LOG:  available indexes for IndexScanRegexp(t5): t5_val t5_pkey
7119 LOG:  pg_hint_plan:
7120 used hint:
7121 IndexScanRegexp(t5 t5_[^i].*)
7122 not used hint:
7123 duplication hint:
7124 error hint:
7125
7126            QUERY PLAN           
7127 --------------------------------
7128  Index Scan using t5_pkey on t5
7129    Index Cond: (id = 1)
7130 (2 rows)
7131
7132 /*+ IndexScanRegexp(t5 t5_id[0-9].*)*/
7133 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7134 LOG:  available indexes for IndexScanRegexp(t5): t5_id3 t5_id2 t5_id1
7135 LOG:  pg_hint_plan:
7136 used hint:
7137 IndexScanRegexp(t5 t5_id[0-9].*)
7138 not used hint:
7139 duplication hint:
7140 error hint:
7141
7142           QUERY PLAN           
7143 -------------------------------
7144  Index Scan using t5_id3 on t5
7145    Index Cond: (id = 1)
7146 (2 rows)
7147
7148 /*+ IndexScanRegexp(t5 t5[^_].*)*/
7149 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7150 LOG:  available indexes for IndexScanRegexp(t5):
7151 LOG:  pg_hint_plan:
7152 used hint:
7153 IndexScanRegexp(t5 t5[^_].*)
7154 not used hint:
7155 duplication hint:
7156 error hint:
7157
7158      QUERY PLAN     
7159 --------------------
7160  Seq Scan on t5
7161    Filter: (id = 1)
7162 (2 rows)
7163
7164 /*+ IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7165 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7166 LOG:  available indexes for IndexScanRegexp(t5):
7167 LOG:  pg_hint_plan:
7168 used hint:
7169 IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7170 not used hint:
7171 duplication hint:
7172 error hint:
7173
7174      QUERY PLAN     
7175 --------------------
7176  Seq Scan on t5
7177    Filter: (id = 1)
7178 (2 rows)
7179
7180 /*+ IndexScan(t5 t5_id[0-9].*)*/
7181 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7182 LOG:  available indexes for IndexScan(t5):
7183 LOG:  pg_hint_plan:
7184 used hint:
7185 IndexScan(t5 t5_id[0-9].*)
7186 not used hint:
7187 duplication hint:
7188 error hint:
7189
7190      QUERY PLAN     
7191 --------------------
7192  Seq Scan on t5
7193    Filter: (id = 1)
7194 (2 rows)
7195
7196 /*+ IndexOnlyScanRegexp(t5 t5_[^i].*)*/
7197 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7198 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_val t5_pkey
7199 LOG:  pg_hint_plan:
7200 used hint:
7201 IndexOnlyScanRegexp(t5 t5_[^i].*)
7202 not used hint:
7203 duplication hint:
7204 error hint:
7205
7206              QUERY PLAN              
7207 -------------------------------------
7208  Index Only Scan using t5_pkey on t5
7209    Index Cond: (id = 1)
7210 (2 rows)
7211
7212 /*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
7213 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7214 LOG:  available indexes for IndexOnlyScanRegexp(t5): t5_id3 t5_id2 t5_id1
7215 LOG:  pg_hint_plan:
7216 used hint:
7217 IndexOnlyScanRegexp(t5 t5_id[0-9].*)
7218 not used hint:
7219 duplication hint:
7220 error hint:
7221
7222              QUERY PLAN             
7223 ------------------------------------
7224  Index Only Scan using t5_id3 on t5
7225    Index Cond: (id = 1)
7226 (2 rows)
7227
7228 /*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
7229 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7230 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7231 LOG:  pg_hint_plan:
7232 used hint:
7233 IndexOnlyScanRegexp(t5 t5[^_].*)
7234 not used hint:
7235 duplication hint:
7236 error hint:
7237
7238      QUERY PLAN     
7239 --------------------
7240  Seq Scan on t5
7241    Filter: (id = 1)
7242 (2 rows)
7243
7244 /*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7245 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7246 LOG:  available indexes for IndexOnlyScanRegexp(t5):
7247 LOG:  pg_hint_plan:
7248 used hint:
7249 IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7250 not used hint:
7251 duplication hint:
7252 error hint:
7253
7254      QUERY PLAN     
7255 --------------------
7256  Seq Scan on t5
7257    Filter: (id = 1)
7258 (2 rows)
7259
7260 /*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
7261 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7262 LOG:  available indexes for IndexOnlyScan(t5):
7263 LOG:  pg_hint_plan:
7264 used hint:
7265 IndexOnlyScan(t5 t5_id[0-9].*)
7266 not used hint:
7267 duplication hint:
7268 error hint:
7269
7270      QUERY PLAN     
7271 --------------------
7272  Seq Scan on t5
7273    Filter: (id = 1)
7274 (2 rows)
7275
7276 /*+ BitmapScanRegexp(t5 t5_[^i].*)*/
7277 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7278 LOG:  available indexes for BitmapScanRegexp(t5): t5_val t5_pkey
7279 LOG:  pg_hint_plan:
7280 used hint:
7281 BitmapScanRegexp(t5 t5_[^i].*)
7282 not used hint:
7283 duplication hint:
7284 error hint:
7285
7286              QUERY PLAN             
7287 ------------------------------------
7288  Bitmap Heap Scan on t5
7289    Recheck Cond: (id = 1)
7290    ->  Bitmap Index Scan on t5_pkey
7291          Index Cond: (id = 1)
7292 (4 rows)
7293
7294 /*+ BitmapScanRegexp(t5 t5_id[0-9].*)*/
7295 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7296 LOG:  available indexes for BitmapScanRegexp(t5): t5_id3 t5_id2 t5_id1
7297 LOG:  pg_hint_plan:
7298 used hint:
7299 BitmapScanRegexp(t5 t5_id[0-9].*)
7300 not used hint:
7301 duplication hint:
7302 error hint:
7303
7304             QUERY PLAN             
7305 -----------------------------------
7306  Bitmap Heap Scan on t5
7307    Recheck Cond: (id = 1)
7308    ->  Bitmap Index Scan on t5_id3
7309          Index Cond: (id = 1)
7310 (4 rows)
7311
7312 /*+ BitmapScanRegexp(t5 t5[^_].*)*/
7313 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7314 LOG:  available indexes for BitmapScanRegexp(t5):
7315 LOG:  pg_hint_plan:
7316 used hint:
7317 BitmapScanRegexp(t5 t5[^_].*)
7318 not used hint:
7319 duplication hint:
7320 error hint:
7321
7322      QUERY PLAN     
7323 --------------------
7324  Seq Scan on t5
7325    Filter: (id = 1)
7326 (2 rows)
7327
7328 /*+ BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
7329 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7330 LOG:  available indexes for BitmapScanRegexp(t5):
7331 LOG:  pg_hint_plan:
7332 used hint:
7333 BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
7334 not used hint:
7335 duplication hint:
7336 error hint:
7337
7338      QUERY PLAN     
7339 --------------------
7340  Seq Scan on t5
7341    Filter: (id = 1)
7342 (2 rows)
7343
7344 /*+ BitmapScan(t5 t5_id[0-9].*)*/
7345 EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
7346 LOG:  available indexes for BitmapScan(t5):
7347 LOG:  pg_hint_plan:
7348 used hint:
7349 BitmapScan(t5 t5_id[0-9].*)
7350 not used hint:
7351 duplication hint:
7352 error hint:
7353
7354      QUERY PLAN     
7355 --------------------
7356  Seq Scan on t5
7357    Filter: (id = 1)
7358 (2 rows)
7359
7360 -- Inheritance
7361 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7362          QUERY PLAN         
7363 ----------------------------
7364  Append
7365    ->  Seq Scan on p1
7366          Filter: (val = 1)
7367    ->  Seq Scan on p1_c1
7368          Filter: (val = 1)
7369    ->  Seq Scan on p1_c2
7370          Filter: (val = 1)
7371    ->  Seq Scan on p1_c3
7372          Filter: (val = 1)
7373    ->  Seq Scan on p1_c4
7374          Filter: (val = 1)
7375    ->  Seq Scan on p1_c1_c1
7376          Filter: (val = 1)
7377    ->  Seq Scan on p1_c1_c2
7378          Filter: (val = 1)
7379    ->  Seq Scan on p1_c3_c1
7380          Filter: (val = 1)
7381    ->  Seq Scan on p1_c3_c2
7382          Filter: (val = 1)
7383 (19 rows)
7384
7385 /*+ IndexScanRegexp(p1 p1_.*[^0-9]$)*/
7386 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7387 LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
7388 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_pkey
7389 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_pkey
7390 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_pkey
7391 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_pkey
7392 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7393 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7394 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7395 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7396 LOG:  pg_hint_plan:
7397 used hint:
7398 IndexScanRegexp(p1 p1_.*[^0-9]$)
7399 not used hint:
7400 duplication hint:
7401 error hint:
7402
7403          QUERY PLAN         
7404 ----------------------------
7405  Append
7406    ->  Seq Scan on p1
7407          Filter: (val = 1)
7408    ->  Seq Scan on p1_c1
7409          Filter: (val = 1)
7410    ->  Seq Scan on p1_c2
7411          Filter: (val = 1)
7412    ->  Seq Scan on p1_c3
7413          Filter: (val = 1)
7414    ->  Seq Scan on p1_c4
7415          Filter: (val = 1)
7416    ->  Seq Scan on p1_c1_c1
7417          Filter: (val = 1)
7418    ->  Seq Scan on p1_c1_c2
7419          Filter: (val = 1)
7420    ->  Seq Scan on p1_c3_c1
7421          Filter: (val = 1)
7422    ->  Seq Scan on p1_c3_c2
7423          Filter: (val = 1)
7424 (19 rows)
7425
7426 /*+ IndexScanRegexp(p1 p1_.*val2.*)*/
7427 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7428 LOG:  available indexes for IndexScanRegexp(p1): p1_val2
7429 LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_val2
7430 LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_val2
7431 LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_val2
7432 LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_val2
7433 LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_val2
7434 LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_val2
7435 LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_val2
7436 LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_val2
7437 LOG:  pg_hint_plan:
7438 used hint:
7439 IndexScanRegexp(p1 p1_.*val2.*)
7440 not used hint:
7441 duplication hint:
7442 error hint:
7443
7444                     QUERY PLAN                    
7445 --------------------------------------------------
7446  Append
7447    ->  Index Scan using p1_val2 on p1
7448          Index Cond: (val = 1)
7449    ->  Index Scan using p1_c1_val2 on p1_c1
7450          Index Cond: (val = 1)
7451    ->  Index Scan using p1_c2_val2 on p1_c2
7452          Index Cond: (val = 1)
7453    ->  Index Scan using p1_c3_val2 on p1_c3
7454          Index Cond: (val = 1)
7455    ->  Index Scan using p1_c4_val2 on p1_c4
7456          Index Cond: (val = 1)
7457    ->  Index Scan using p1_c1_c1_val2 on p1_c1_c1
7458          Index Cond: (val = 1)
7459    ->  Index Scan using p1_c1_c2_val2 on p1_c1_c2
7460          Index Cond: (val = 1)
7461    ->  Index Scan using p1_c3_c1_val2 on p1_c3_c1
7462          Index Cond: (val = 1)
7463    ->  Index Scan using p1_c3_c2_val2 on p1_c3_c2
7464          Index Cond: (val = 1)
7465 (19 rows)
7466
7467 /*+ IndexScanRegexp(p1 p1[^_].*)*/
7468 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7469 LOG:  available indexes for IndexScanRegexp(p1):
7470 LOG:  available indexes for IndexScanRegexp(p1_c1):
7471 LOG:  available indexes for IndexScanRegexp(p1_c2):
7472 LOG:  available indexes for IndexScanRegexp(p1_c3):
7473 LOG:  available indexes for IndexScanRegexp(p1_c4):
7474 LOG:  available indexes for IndexScanRegexp(p1_c1_c1):
7475 LOG:  available indexes for IndexScanRegexp(p1_c1_c2):
7476 LOG:  available indexes for IndexScanRegexp(p1_c3_c1):
7477 LOG:  available indexes for IndexScanRegexp(p1_c3_c2):
7478 LOG:  pg_hint_plan:
7479 used hint:
7480 IndexScanRegexp(p1 p1[^_].*)
7481 not used hint:
7482 duplication hint:
7483 error hint:
7484
7485          QUERY PLAN         
7486 ----------------------------
7487  Append
7488    ->  Seq Scan on p1
7489          Filter: (val = 1)
7490    ->  Seq Scan on p1_c1
7491          Filter: (val = 1)
7492    ->  Seq Scan on p1_c2
7493          Filter: (val = 1)
7494    ->  Seq Scan on p1_c3
7495          Filter: (val = 1)
7496    ->  Seq Scan on p1_c4
7497          Filter: (val = 1)
7498    ->  Seq Scan on p1_c1_c1
7499          Filter: (val = 1)
7500    ->  Seq Scan on p1_c1_c2
7501          Filter: (val = 1)
7502    ->  Seq Scan on p1_c3_c1
7503          Filter: (val = 1)
7504    ->  Seq Scan on p1_c3_c2
7505          Filter: (val = 1)
7506 (19 rows)
7507
7508 /*+ IndexScan(p1 p1_.*val2.*)*/
7509 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7510 LOG:  available indexes for IndexScan(p1):
7511 LOG:  available indexes for IndexScan(p1_c1):
7512 LOG:  available indexes for IndexScan(p1_c2):
7513 LOG:  available indexes for IndexScan(p1_c3):
7514 LOG:  available indexes for IndexScan(p1_c4):
7515 LOG:  available indexes for IndexScan(p1_c1_c1):
7516 LOG:  available indexes for IndexScan(p1_c1_c2):
7517 LOG:  available indexes for IndexScan(p1_c3_c1):
7518 LOG:  available indexes for IndexScan(p1_c3_c2):
7519 LOG:  pg_hint_plan:
7520 used hint:
7521 IndexScan(p1 p1_.*val2.*)
7522 not used hint:
7523 duplication hint:
7524 error hint:
7525
7526          QUERY PLAN         
7527 ----------------------------
7528  Append
7529    ->  Seq Scan on p1
7530          Filter: (val = 1)
7531    ->  Seq Scan on p1_c1
7532          Filter: (val = 1)
7533    ->  Seq Scan on p1_c2
7534          Filter: (val = 1)
7535    ->  Seq Scan on p1_c3
7536          Filter: (val = 1)
7537    ->  Seq Scan on p1_c4
7538          Filter: (val = 1)
7539    ->  Seq Scan on p1_c1_c1
7540          Filter: (val = 1)
7541    ->  Seq Scan on p1_c1_c2
7542          Filter: (val = 1)
7543    ->  Seq Scan on p1_c3_c1
7544          Filter: (val = 1)
7545    ->  Seq Scan on p1_c3_c2
7546          Filter: (val = 1)
7547 (19 rows)
7548
7549 /*+ IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)*/
7550 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7551 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_pkey
7552 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_pkey
7553 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_pkey
7554 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_pkey
7555 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_pkey
7556 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7557 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7558 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7559 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7560 LOG:  pg_hint_plan:
7561 used hint:
7562 IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)
7563 not used hint:
7564 duplication hint:
7565 error hint:
7566
7567          QUERY PLAN         
7568 ----------------------------
7569  Append
7570    ->  Seq Scan on p1
7571          Filter: (val = 1)
7572    ->  Seq Scan on p1_c1
7573          Filter: (val = 1)
7574    ->  Seq Scan on p1_c2
7575          Filter: (val = 1)
7576    ->  Seq Scan on p1_c3
7577          Filter: (val = 1)
7578    ->  Seq Scan on p1_c4
7579          Filter: (val = 1)
7580    ->  Seq Scan on p1_c1_c1
7581          Filter: (val = 1)
7582    ->  Seq Scan on p1_c1_c2
7583          Filter: (val = 1)
7584    ->  Seq Scan on p1_c3_c1
7585          Filter: (val = 1)
7586    ->  Seq Scan on p1_c3_c2
7587          Filter: (val = 1)
7588 (19 rows)
7589
7590 /*+ IndexOnlyScanRegexp(p1 p1_.*val2.*)*/
7591 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7592 LOG:  available indexes for IndexOnlyScanRegexp(p1): p1_val2
7593 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1): p1_c1_val2
7594 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2): p1_c2_val2
7595 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3): p1_c3_val2
7596 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4): p1_c4_val2
7597 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1): p1_c1_c1_val2
7598 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2): p1_c1_c2_val2
7599 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1): p1_c3_c1_val2
7600 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2): p1_c3_c2_val2
7601 LOG:  pg_hint_plan:
7602 used hint:
7603 IndexOnlyScanRegexp(p1 p1_.*val2.*)
7604 not used hint:
7605 duplication hint:
7606 error hint:
7607
7608                       QUERY PLAN                       
7609 -------------------------------------------------------
7610  Append
7611    ->  Index Only Scan using p1_val2 on p1
7612          Index Cond: (val = 1)
7613    ->  Index Only Scan using p1_c1_val2 on p1_c1
7614          Index Cond: (val = 1)
7615    ->  Index Only Scan using p1_c2_val2 on p1_c2
7616          Index Cond: (val = 1)
7617    ->  Index Only Scan using p1_c3_val2 on p1_c3
7618          Index Cond: (val = 1)
7619    ->  Index Only Scan using p1_c4_val2 on p1_c4
7620          Index Cond: (val = 1)
7621    ->  Index Only Scan using p1_c1_c1_val2 on p1_c1_c1
7622          Index Cond: (val = 1)
7623    ->  Index Only Scan using p1_c1_c2_val2 on p1_c1_c2
7624          Index Cond: (val = 1)
7625    ->  Index Only Scan using p1_c3_c1_val2 on p1_c3_c1
7626          Index Cond: (val = 1)
7627    ->  Index Only Scan using p1_c3_c2_val2 on p1_c3_c2
7628          Index Cond: (val = 1)
7629 (19 rows)
7630
7631 /*+ IndexOnlyScanRegexp(p1 p1[^_].*)*/
7632 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7633 LOG:  available indexes for IndexOnlyScanRegexp(p1):
7634 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1):
7635 LOG:  available indexes for IndexOnlyScanRegexp(p1_c2):
7636 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3):
7637 LOG:  available indexes for IndexOnlyScanRegexp(p1_c4):
7638 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c1):
7639 LOG:  available indexes for IndexOnlyScanRegexp(p1_c1_c2):
7640 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c1):
7641 LOG:  available indexes for IndexOnlyScanRegexp(p1_c3_c2):
7642 LOG:  pg_hint_plan:
7643 used hint:
7644 IndexOnlyScanRegexp(p1 p1[^_].*)
7645 not used hint:
7646 duplication hint:
7647 error hint:
7648
7649          QUERY PLAN         
7650 ----------------------------
7651  Append
7652    ->  Seq Scan on p1
7653          Filter: (val = 1)
7654    ->  Seq Scan on p1_c1
7655          Filter: (val = 1)
7656    ->  Seq Scan on p1_c2
7657          Filter: (val = 1)
7658    ->  Seq Scan on p1_c3
7659          Filter: (val = 1)
7660    ->  Seq Scan on p1_c4
7661          Filter: (val = 1)
7662    ->  Seq Scan on p1_c1_c1
7663          Filter: (val = 1)
7664    ->  Seq Scan on p1_c1_c2
7665          Filter: (val = 1)
7666    ->  Seq Scan on p1_c3_c1
7667          Filter: (val = 1)
7668    ->  Seq Scan on p1_c3_c2
7669          Filter: (val = 1)
7670 (19 rows)
7671
7672 /*+ IndexOnlyScan(p1 p1_.*val2.*)*/
7673 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7674 LOG:  available indexes for IndexOnlyScan(p1):
7675 LOG:  available indexes for IndexOnlyScan(p1_c1):
7676 LOG:  available indexes for IndexOnlyScan(p1_c2):
7677 LOG:  available indexes for IndexOnlyScan(p1_c3):
7678 LOG:  available indexes for IndexOnlyScan(p1_c4):
7679 LOG:  available indexes for IndexOnlyScan(p1_c1_c1):
7680 LOG:  available indexes for IndexOnlyScan(p1_c1_c2):
7681 LOG:  available indexes for IndexOnlyScan(p1_c3_c1):
7682 LOG:  available indexes for IndexOnlyScan(p1_c3_c2):
7683 LOG:  pg_hint_plan:
7684 used hint:
7685 IndexOnlyScan(p1 p1_.*val2.*)
7686 not used hint:
7687 duplication hint:
7688 error hint:
7689
7690          QUERY PLAN         
7691 ----------------------------
7692  Append
7693    ->  Seq Scan on p1
7694          Filter: (val = 1)
7695    ->  Seq Scan on p1_c1
7696          Filter: (val = 1)
7697    ->  Seq Scan on p1_c2
7698          Filter: (val = 1)
7699    ->  Seq Scan on p1_c3
7700          Filter: (val = 1)
7701    ->  Seq Scan on p1_c4
7702          Filter: (val = 1)
7703    ->  Seq Scan on p1_c1_c1
7704          Filter: (val = 1)
7705    ->  Seq Scan on p1_c1_c2
7706          Filter: (val = 1)
7707    ->  Seq Scan on p1_c3_c1
7708          Filter: (val = 1)
7709    ->  Seq Scan on p1_c3_c2
7710          Filter: (val = 1)
7711 (19 rows)
7712
7713 /*+ BitmapScanRegexp(p1 p1_.*[^0-9]$)*/
7714 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7715 LOG:  available indexes for BitmapScanRegexp(p1): p1_pkey
7716 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_pkey
7717 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_pkey
7718 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_pkey
7719 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_pkey
7720 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_pkey
7721 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_pkey
7722 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_pkey
7723 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_pkey
7724 LOG:  pg_hint_plan:
7725 used hint:
7726 BitmapScanRegexp(p1 p1_.*[^0-9]$)
7727 not used hint:
7728 duplication hint:
7729 error hint:
7730
7731          QUERY PLAN         
7732 ----------------------------
7733  Append
7734    ->  Seq Scan on p1
7735          Filter: (val = 1)
7736    ->  Seq Scan on p1_c1
7737          Filter: (val = 1)
7738    ->  Seq Scan on p1_c2
7739          Filter: (val = 1)
7740    ->  Seq Scan on p1_c3
7741          Filter: (val = 1)
7742    ->  Seq Scan on p1_c4
7743          Filter: (val = 1)
7744    ->  Seq Scan on p1_c1_c1
7745          Filter: (val = 1)
7746    ->  Seq Scan on p1_c1_c2
7747          Filter: (val = 1)
7748    ->  Seq Scan on p1_c3_c1
7749          Filter: (val = 1)
7750    ->  Seq Scan on p1_c3_c2
7751          Filter: (val = 1)
7752 (19 rows)
7753
7754 /*+ BitmapScanRegexp(p1 p1_.*val2.*)*/
7755 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7756 LOG:  available indexes for BitmapScanRegexp(p1): p1_val2
7757 LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_val2
7758 LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_val2
7759 LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_val2
7760 LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_val2
7761 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_val2
7762 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_val2
7763 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_val2
7764 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_val2
7765 LOG:  pg_hint_plan:
7766 used hint:
7767 BitmapScanRegexp(p1 p1_.*val2.*)
7768 not used hint:
7769 duplication hint:
7770 error hint:
7771
7772                    QUERY PLAN                   
7773 ------------------------------------------------
7774  Append
7775    ->  Bitmap Heap Scan on p1
7776          Recheck Cond: (val = 1)
7777          ->  Bitmap Index Scan on p1_val2
7778                Index Cond: (val = 1)
7779    ->  Bitmap Heap Scan on p1_c1
7780          Recheck Cond: (val = 1)
7781          ->  Bitmap Index Scan on p1_c1_val2
7782                Index Cond: (val = 1)
7783    ->  Bitmap Heap Scan on p1_c2
7784          Recheck Cond: (val = 1)
7785          ->  Bitmap Index Scan on p1_c2_val2
7786                Index Cond: (val = 1)
7787    ->  Bitmap Heap Scan on p1_c3
7788          Recheck Cond: (val = 1)
7789          ->  Bitmap Index Scan on p1_c3_val2
7790                Index Cond: (val = 1)
7791    ->  Bitmap Heap Scan on p1_c4
7792          Recheck Cond: (val = 1)
7793          ->  Bitmap Index Scan on p1_c4_val2
7794                Index Cond: (val = 1)
7795    ->  Bitmap Heap Scan on p1_c1_c1
7796          Recheck Cond: (val = 1)
7797          ->  Bitmap Index Scan on p1_c1_c1_val2
7798                Index Cond: (val = 1)
7799    ->  Bitmap Heap Scan on p1_c1_c2
7800          Recheck Cond: (val = 1)
7801          ->  Bitmap Index Scan on p1_c1_c2_val2
7802                Index Cond: (val = 1)
7803    ->  Bitmap Heap Scan on p1_c3_c1
7804          Recheck Cond: (val = 1)
7805          ->  Bitmap Index Scan on p1_c3_c1_val2
7806                Index Cond: (val = 1)
7807    ->  Bitmap Heap Scan on p1_c3_c2
7808          Recheck Cond: (val = 1)
7809          ->  Bitmap Index Scan on p1_c3_c2_val2
7810                Index Cond: (val = 1)
7811 (37 rows)
7812
7813 /*+ BitmapScanRegexp(p1 p1[^_].*)*/
7814 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7815 LOG:  available indexes for BitmapScanRegexp(p1):
7816 LOG:  available indexes for BitmapScanRegexp(p1_c1):
7817 LOG:  available indexes for BitmapScanRegexp(p1_c2):
7818 LOG:  available indexes for BitmapScanRegexp(p1_c3):
7819 LOG:  available indexes for BitmapScanRegexp(p1_c4):
7820 LOG:  available indexes for BitmapScanRegexp(p1_c1_c1):
7821 LOG:  available indexes for BitmapScanRegexp(p1_c1_c2):
7822 LOG:  available indexes for BitmapScanRegexp(p1_c3_c1):
7823 LOG:  available indexes for BitmapScanRegexp(p1_c3_c2):
7824 LOG:  pg_hint_plan:
7825 used hint:
7826 BitmapScanRegexp(p1 p1[^_].*)
7827 not used hint:
7828 duplication hint:
7829 error hint:
7830
7831          QUERY PLAN         
7832 ----------------------------
7833  Append
7834    ->  Seq Scan on p1
7835          Filter: (val = 1)
7836    ->  Seq Scan on p1_c1
7837          Filter: (val = 1)
7838    ->  Seq Scan on p1_c2
7839          Filter: (val = 1)
7840    ->  Seq Scan on p1_c3
7841          Filter: (val = 1)
7842    ->  Seq Scan on p1_c4
7843          Filter: (val = 1)
7844    ->  Seq Scan on p1_c1_c1
7845          Filter: (val = 1)
7846    ->  Seq Scan on p1_c1_c2
7847          Filter: (val = 1)
7848    ->  Seq Scan on p1_c3_c1
7849          Filter: (val = 1)
7850    ->  Seq Scan on p1_c3_c2
7851          Filter: (val = 1)
7852 (19 rows)
7853
7854 /*+ BitmapScan(p1 p1_.*val2.*)*/
7855 EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
7856 LOG:  available indexes for BitmapScan(p1):
7857 LOG:  available indexes for BitmapScan(p1_c1):
7858 LOG:  available indexes for BitmapScan(p1_c2):
7859 LOG:  available indexes for BitmapScan(p1_c3):
7860 LOG:  available indexes for BitmapScan(p1_c4):
7861 LOG:  available indexes for BitmapScan(p1_c1_c1):
7862 LOG:  available indexes for BitmapScan(p1_c1_c2):
7863 LOG:  available indexes for BitmapScan(p1_c3_c1):
7864 LOG:  available indexes for BitmapScan(p1_c3_c2):
7865 LOG:  pg_hint_plan:
7866 used hint:
7867 BitmapScan(p1 p1_.*val2.*)
7868 not used hint:
7869 duplication hint:
7870 error hint:
7871
7872          QUERY PLAN         
7873 ----------------------------
7874  Append
7875    ->  Seq Scan on p1
7876          Filter: (val = 1)
7877    ->  Seq Scan on p1_c1
7878          Filter: (val = 1)
7879    ->  Seq Scan on p1_c2
7880          Filter: (val = 1)
7881    ->  Seq Scan on p1_c3
7882          Filter: (val = 1)
7883    ->  Seq Scan on p1_c4
7884          Filter: (val = 1)
7885    ->  Seq Scan on p1_c1_c1
7886          Filter: (val = 1)
7887    ->  Seq Scan on p1_c1_c2
7888          Filter: (val = 1)
7889    ->  Seq Scan on p1_c3_c1
7890          Filter: (val = 1)
7891    ->  Seq Scan on p1_c3_c2
7892          Filter: (val = 1)
7893 (19 rows)
7894
7895 -- search from hint table
7896 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;', '', 'SeqScan(t1)');
7897 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?;', '', 'IndexScan(t1)');
7898 INSERT INTO hint_plan.hints (norm_query_string, application_name, hints) VALUES ('EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;', '', 'BitmapScan(t1)');
7899 SELECT * FROM hint_plan.hints ORDER BY id;
7900  id |                    norm_query_string                     | application_name |     hints      
7901 ----+----------------------------------------------------------+------------------+----------------
7902   1 | EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = ?;  |                  | SeqScan(t1)
7903   2 | EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = ?; |                  | IndexScan(t1)
7904   3 | EXPLAIN SELECT * FROM t1 WHERE t1.id = ?;                |                  | BitmapScan(t1)
7905 (3 rows)
7906
7907 SET pg_hint_plan.enable_hint_table = on;
7908 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7909 LOG:  pg_hint_plan:
7910 used hint:
7911 SeqScan(t1)
7912 not used hint:
7913 duplication hint:
7914 error hint:
7915
7916      QUERY PLAN     
7917 --------------------
7918  Seq Scan on t1
7919    Filter: (id = 1)
7920 (2 rows)
7921
7922 SET pg_hint_plan.enable_hint_table = off;
7923 EXPLAIN (COSTS false) SELECT * FROM t1 WHERE t1.id = 1;
7924            QUERY PLAN           
7925 --------------------------------
7926  Index Scan using t1_pkey on t1
7927    Index Cond: (id = 1)
7928 (2 rows)
7929
7930 TRUNCATE hint_plan.hints;
7931 VACUUM ANALYZE hint_plan.hints;
7932 -- plpgsql test
7933 EXPLAIN (COSTS false) SELECT id FROM t1 WHERE t1.id = 1;
7934              QUERY PLAN              
7935 -------------------------------------
7936  Index Only Scan using t1_pkey on t1
7937    Index Cond: (id = 1)
7938 (2 rows)
7939
7940 -- static function
7941 CREATE FUNCTION testfunc() RETURNS RECORD AS $$
7942 DECLARE
7943   ret record;
7944 BEGIN
7945   SELECT /*+ SeqScan(t1) */ * INTO ret FROM t1 LIMIT 1;
7946   RETURN ret;
7947 END;
7948 $$ LANGUAGE plpgsql;
7949 SELECT testfunc();
7950 LOG:  pg_hint_plan:
7951 used hint:
7952 SeqScan(t1)
7953 not used hint:
7954 duplication hint:
7955 error hint:
7956
7957 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ *          FROM t1 LIMIT 1"
7958 PL/pgSQL function testfunc() line 5 at SQL statement
7959  testfunc 
7960 ----------
7961  (1,1)
7962 (1 row)
7963
7964 -- dynamic function
7965 DROP FUNCTION testfunc();
7966 CREATE FUNCTION testfunc() RETURNS void AS $$
7967 BEGIN
7968   EXECUTE format('/*+ SeqScan(t1) */ SELECT * FROM t1');
7969 END;
7970 $$ LANGUAGE plpgsql;
7971 SELECT testfunc();
7972 LOG:  pg_hint_plan:
7973 used hint:
7974 SeqScan(t1)
7975 not used hint:
7976 duplication hint:
7977 error hint:
7978
7979 CONTEXT:  SQL statement "/*+ SeqScan(t1) */ SELECT * FROM t1"
7980 PL/pgSQL function testfunc() line 3 at EXECUTE
7981  testfunc 
7982 ----------
7983  
7984 (1 row)
7985
7986 -- This should not use SeqScan(t1)
7987 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
7988 LOG:  pg_hint_plan:
7989 used hint:
7990 IndexScan(t1)
7991 not used hint:
7992 duplication hint:
7993 error hint:
7994
7995  id | val 
7996 ----+-----
7997   1 |   1
7998 (1 row)
7999
8000 -- Perform
8001 DROP FUNCTION testfunc();
8002 CREATE FUNCTION testfunc() RETURNS void AS $$
8003 BEGIN
8004   PERFORM  1, /*+ SeqScan(t1) */ * from t1;
8005 END;
8006 $$ LANGUAGE plpgsql;
8007 SELECT testfunc();
8008 LOG:  pg_hint_plan:
8009 used hint:
8010 SeqScan(t1)
8011 not used hint:
8012 duplication hint:
8013 error hint:
8014
8015 CONTEXT:  SQL statement "SELECT 1, /*+ SeqScan(t1) */ * from t1"
8016 PL/pgSQL function testfunc() line 3 at PERFORM
8017  testfunc 
8018 ----------
8019  
8020 (1 row)
8021
8022 -- FOR loop
8023 DROP FUNCTION testfunc();
8024 CREATE FUNCTION testfunc() RETURNS int AS $$
8025 DECLARE
8026   sum int;
8027   v int;
8028 BEGIN
8029   sum := 0;
8030   FOR v IN SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id LOOP
8031     sum := sum + v;
8032   END LOOP;
8033   RETURN v;
8034 END;
8035 $$ LANGUAGE plpgsql;
8036 SELECT testfunc();
8037 LOG:  pg_hint_plan:
8038 used hint:
8039 SeqScan(t1)
8040 not used hint:
8041 duplication hint:
8042 error hint:
8043
8044 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ v FROM t1 ORDER BY id"
8045 PL/pgSQL function testfunc() line 7 at FOR over SELECT rows
8046  testfunc 
8047 ----------
8048          
8049 (1 row)
8050
8051 -- Dynamic FOR loop
8052 DROP FUNCTION testfunc();
8053 CREATE FUNCTION testfunc() RETURNS int AS $$
8054 DECLARE
8055   sum int;
8056   v int;
8057   i   int;
8058 BEGIN
8059   sum := 0;
8060   FOR v IN EXECUTE 'SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id' LOOP
8061     sum := sum + v;
8062   END LOOP;
8063   RETURN v;
8064 END;
8065 $$ LANGUAGE plpgsql;
8066 SELECT testfunc();
8067 LOG:  pg_hint_plan:
8068 used hint:
8069 SeqScan(t1)
8070 not used hint:
8071 duplication hint:
8072 error hint:
8073
8074 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ val FROM t1 ORDER BY id"
8075 PL/pgSQL function testfunc() line 8 at FOR over EXECUTE statement
8076  testfunc 
8077 ----------
8078         0
8079 (1 row)
8080
8081 -- Cursor FOR loop
8082 DROP FUNCTION testfunc();
8083 CREATE FUNCTION testfunc() RETURNS int AS $$
8084 DECLARE
8085   ref CURSOR FOR SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8086   rec record;
8087   sum int := 0;
8088 BEGIN
8089   FOR rec IN ref LOOP
8090     sum := sum + rec.val;
8091   END LOOP;
8092   RETURN sum;
8093 END;
8094 $$ LANGUAGE plpgsql;
8095 SELECT testfunc();
8096 LOG:  pg_hint_plan:
8097 used hint:
8098 SeqScan(t1)
8099 not used hint:
8100 duplication hint:
8101 error hint:
8102
8103 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8104 PL/pgSQL function testfunc() line 7 at FOR over cursor
8105  testfunc 
8106 ----------
8107    495000
8108 (1 row)
8109
8110 -- RETURN QUERY
8111 DROP FUNCTION testfunc();
8112 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8113 BEGIN
8114   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id;
8115 END;
8116 $$ LANGUAGE plpgsql;
8117 SELECT * FROM testfunc() LIMIT 1;
8118 LOG:  pg_hint_plan:
8119 used hint:
8120 SeqScan(t1)
8121 not used hint:
8122 duplication hint:
8123 error hint:
8124
8125 CONTEXT:  SQL statement "SELECT /*+ SeqScan(t1) */ * FROM t1 ORDER BY id"
8126 PL/pgSQL function testfunc() line 3 at RETURN QUERY
8127  id | val 
8128 ----+-----
8129   1 |   1
8130 (1 row)
8131
8132 -- Test for error exit from inner SQL statement.
8133 DROP FUNCTION testfunc();
8134 CREATE FUNCTION testfunc() RETURNS SETOF t1 AS $$
8135 BEGIN
8136   RETURN QUERY SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id;
8137 END;
8138 $$ LANGUAGE plpgsql;
8139 SELECT * FROM testfunc() LIMIT 1;
8140 ERROR:  relation "ttx" does not exist
8141 LINE 1: SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8142                                          ^
8143 QUERY:  SELECT /*+ SeqScan(t1) */ * FROM ttx ORDER BY id
8144 CONTEXT:  PL/pgSQL function testfunc() line 3 at RETURN QUERY
8145 -- this should not use SeqScan(t1) hint.
8146 /*+ IndexScan(t1) */ SELECT * from t1 LIMIT 1;
8147 LOG:  pg_hint_plan:
8148 used hint:
8149 IndexScan(t1)
8150 not used hint:
8151 duplication hint:
8152 error hint:
8153
8154  id | val 
8155 ----+-----
8156   1 |   1
8157 (1 row)
8158
8159 DROP FUNCTION testfunc();
8160 DROP EXTENSION pg_hint_plan;
8161 CREATE FUNCTION reset_stats_and_wait() RETURNS void AS $$
8162 DECLARE
8163   rows int;
8164 BEGIN
8165   rows = 1;
8166   while rows > 0 LOOP
8167    PERFORM pg_stat_reset();
8168    PERFORM pg_sleep(0.5);
8169    SELECT sum(seq_scan + idx_scan) from pg_stat_user_tables into rows;
8170   END LOOP;
8171 END;
8172 $$ LANGUAGE plpgsql;
8173 -- Dynamic query in pl/pgsql
8174 CREATE OR REPLACE FUNCTION dynsql1(x int) RETURNS int AS $$
8175 DECLARE c int;
8176 BEGIN
8177   EXECUTE '/*+ IndexScan(t1) */ SELECT count(*) FROM t1 WHERE id < $1'
8178         INTO c USING x;
8179   RETURN c;
8180 END;
8181 $$ VOLATILE LANGUAGE plpgsql;
8182 vacuum analyze t1;
8183 SET pg_hint_plan.enable_hint = false;
8184 SELECT reset_stats_and_wait();
8185  reset_stats_and_wait 
8186 ----------------------
8187  
8188 (1 row)
8189
8190 SELECT dynsql1(9000);
8191  dynsql1 
8192 ---------
8193     8999
8194 (1 row)
8195
8196 SELECT pg_sleep(1);
8197  pg_sleep 
8198 ----------
8199  
8200 (1 row)
8201
8202 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';
8203  relname | seq_scan | idx_scan 
8204 ---------+----------+----------
8205  t1      | t        | f
8206 (1 row)
8207
8208 SET pg_hint_plan.enable_hint = true;
8209 SELECT reset_stats_and_wait();
8210  reset_stats_and_wait 
8211 ----------------------
8212  
8213 (1 row)
8214
8215 SELECT dynsql1(9000);
8216 LOG:  pg_hint_plan:
8217 used hint:
8218 IndexScan(t1)
8219 not used hint:
8220 duplication hint:
8221 error hint:
8222
8223 CONTEXT:  SQL statement "/*+ IndexScan(t1) */ SELECT count(*) FROM t1 WHERE id < $1"
8224 PL/pgSQL function dynsql1(integer) line 4 at EXECUTE
8225  dynsql1 
8226 ---------
8227     8999
8228 (1 row)
8229
8230 SELECT pg_sleep(1);
8231  pg_sleep 
8232 ----------
8233  
8234 (1 row)
8235
8236 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';
8237  relname | seq_scan | idx_scan 
8238 ---------+----------+----------
8239  t1      | f        | t
8240 (1 row)
8241
8242 -- Looped dynamic query in pl/pgsql
8243 CREATE OR REPLACE FUNCTION dynsql2(x int, OUT r int) AS $$
8244 DECLARE
8245   c text;
8246   s int;
8247 BEGIN
8248   r := 0;
8249   FOR c IN SELECT f.f FROM (VALUES ('p1_c1'), ('p1_c2')) f(f) LOOP
8250     FOR s IN EXECUTE '/*+ IndexScan(' || c || ' ' || c || '_pkey) */ SELECT sum(val) FROM ' || c || ' WHERE id < ' || x LOOP
8251       r := r + s;
8252     END LOOP;
8253   END LOOP;
8254 END;
8255 $$ VOLATILE LANGUAGE plpgsql;
8256 SET pg_hint_plan.enable_hint = false;
8257 SELECT reset_stats_and_wait();
8258  reset_stats_and_wait 
8259 ----------------------
8260  
8261 (1 row)
8262
8263 SELECT dynsql2(9000);
8264  dynsql2 
8265 ---------
8266     9900
8267 (1 row)
8268
8269 SELECT pg_sleep(1);
8270  pg_sleep 
8271 ----------
8272  
8273 (1 row)
8274
8275 -- one of the index scans happened while planning.
8276 SELECT relname, seq_scan, idx_scan FROM pg_stat_user_tables WHERE schemaname = 'public' AND (relname = 'p1_c1' OR relname = 'p1_c2');
8277  relname | seq_scan | idx_scan 
8278 ---------+----------+----------
8279  p1_c1   |        1 |        0
8280  p1_c2   |        1 |        1
8281 (2 rows)
8282
8283 SET pg_hint_plan.enable_hint = true;
8284 SELECT reset_stats_and_wait();
8285  reset_stats_and_wait 
8286 ----------------------
8287  
8288 (1 row)
8289
8290 SELECT dynsql2(9000);
8291 LOG:  available indexes for IndexScan(p1_c1): p1_c1_pkey
8292 CONTEXT:  SQL statement "/*+ IndexScan(p1_c1 p1_c1_pkey) */ SELECT sum(val) FROM p1_c1 WHERE id < 9000"
8293 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8294 LOG:  available indexes for IndexScan(p1_c1_c1): p1_c1_c1_pkey
8295 CONTEXT:  SQL statement "/*+ IndexScan(p1_c1 p1_c1_pkey) */ SELECT sum(val) FROM p1_c1 WHERE id < 9000"
8296 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8297 LOG:  available indexes for IndexScan(p1_c1_c2): p1_c1_c2_pkey
8298 CONTEXT:  SQL statement "/*+ IndexScan(p1_c1 p1_c1_pkey) */ SELECT sum(val) FROM p1_c1 WHERE id < 9000"
8299 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8300 LOG:  pg_hint_plan:
8301 used hint:
8302 IndexScan(p1_c1 p1_c1_pkey)
8303 not used hint:
8304 duplication hint:
8305 error hint:
8306
8307 CONTEXT:  SQL statement "/*+ IndexScan(p1_c1 p1_c1_pkey) */ SELECT sum(val) FROM p1_c1 WHERE id < 9000"
8308 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8309 LOG:  available indexes for IndexScan(p1_c2): p1_c2_pkey
8310 CONTEXT:  SQL statement "/*+ IndexScan(p1_c2 p1_c2_pkey) */ SELECT sum(val) FROM p1_c2 WHERE id < 9000"
8311 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8312 LOG:  pg_hint_plan:
8313 used hint:
8314 IndexScan(p1_c2 p1_c2_pkey)
8315 not used hint:
8316 duplication hint:
8317 error hint:
8318
8319 CONTEXT:  SQL statement "/*+ IndexScan(p1_c2 p1_c2_pkey) */ SELECT sum(val) FROM p1_c2 WHERE id < 9000"
8320 PL/pgSQL function dynsql2(integer) line 8 at FOR over EXECUTE statement
8321  dynsql2 
8322 ---------
8323     9900
8324 (1 row)
8325
8326 SELECT pg_sleep(1);
8327  pg_sleep 
8328 ----------
8329  
8330 (1 row)
8331
8332 -- the index scan happened while planning.
8333 SELECT relname, seq_scan, idx_scan FROM pg_stat_user_tables WHERE schemaname = 'public' AND (relname = 'p1_c1' OR relname = 'p1_c2');
8334  relname | seq_scan | idx_scan 
8335 ---------+----------+----------
8336  p1_c1   |        0 |        1
8337  p1_c2   |        0 |        2
8338 (2 rows)
8339
8340 -- Subqueries on inheritance tables under UNION
8341 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8342 UNION ALL
8343 SELECT val::int FROM p2 WHERE id < 1000;
8344                QUERY PLAN                
8345 -----------------------------------------
8346  Append
8347    ->  Append
8348          ->  Seq Scan on p1
8349                Filter: (val < 1000)
8350          ->  Seq Scan on p1_c1
8351                Filter: (val < 1000)
8352          ->  Seq Scan on p1_c2
8353                Filter: (val < 1000)
8354          ->  Seq Scan on p1_c3
8355                Filter: (val < 1000)
8356          ->  Seq Scan on p1_c4
8357                Filter: (val < 1000)
8358          ->  Seq Scan on p1_c1_c1
8359                Filter: (val < 1000)
8360          ->  Seq Scan on p1_c1_c2
8361                Filter: (val < 1000)
8362          ->  Seq Scan on p1_c3_c1
8363                Filter: (val < 1000)
8364          ->  Seq Scan on p1_c3_c2
8365                Filter: (val < 1000)
8366    ->  Result
8367          ->  Append
8368                ->  Seq Scan on p2
8369                      Filter: (id < 1000)
8370                ->  Seq Scan on p2_c1
8371                      Filter: (id < 1000)
8372                ->  Seq Scan on p2_c2
8373                      Filter: (id < 1000)
8374                ->  Seq Scan on p2_c3
8375                      Filter: (id < 1000)
8376                ->  Seq Scan on p2_c4
8377                      Filter: (id < 1000)
8378                ->  Seq Scan on p2_c1_c1
8379                      Filter: (id < 1000)
8380                ->  Seq Scan on p2_c1_c2
8381                      Filter: (id < 1000)
8382                ->  Seq Scan on p2_c3_c1
8383                      Filter: (id < 1000)
8384                ->  Seq Scan on p2_c3_c2
8385                      Filter: (id < 1000)
8386 (40 rows)
8387
8388 /*+ IndexScan(p1 p1_val2) */
8389 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8390 UNION ALL
8391 SELECT val::int FROM p2 WHERE id < 1000;
8392 LOG:  available indexes for IndexScan(p1): p1_val3 p1_val2 p1_val1
8393 LOG:  available indexes for IndexScan(p1_c1): p1_c1_val3 p1_c1_val2 p1_c1_val1
8394 LOG:  available indexes for IndexScan(p1_c2): p1_c2_val3 p1_c2_val2 p1_c2_val1
8395 LOG:  available indexes for IndexScan(p1_c3): p1_c3_val3 p1_c3_val2 p1_c3_val1
8396 LOG:  available indexes for IndexScan(p1_c4): p1_c4_val3 p1_c4_val2 p1_c4_val1
8397 LOG:  available indexes for IndexScan(p1_c1_c1): p1_c1_c1_val3 p1_c1_c1_val2 p1_c1_c1_val1
8398 LOG:  available indexes for IndexScan(p1_c1_c2): p1_c1_c2_val3 p1_c1_c2_val2 p1_c1_c2_val1
8399 LOG:  available indexes for IndexScan(p1_c3_c1): p1_c3_c1_val3 p1_c3_c1_val2 p1_c3_c1_val1
8400 LOG:  available indexes for IndexScan(p1_c3_c2): p1_c3_c2_val3 p1_c3_c2_val2 p1_c3_c2_val1
8401 LOG:  pg_hint_plan:
8402 used hint:
8403 IndexScan(p1 p1_val2)
8404 not used hint:
8405 duplication hint:
8406 error hint:
8407
8408                        QUERY PLAN                       
8409 --------------------------------------------------------
8410  Append
8411    ->  Append
8412          ->  Index Scan using p1_val3 on p1
8413                Index Cond: (val < 1000)
8414          ->  Index Scan using p1_c1_val3 on p1_c1
8415                Index Cond: (val < 1000)
8416          ->  Index Scan using p1_c2_val3 on p1_c2
8417                Index Cond: (val < 1000)
8418          ->  Index Scan using p1_c3_val3 on p1_c3
8419                Index Cond: (val < 1000)
8420          ->  Index Scan using p1_c4_val3 on p1_c4
8421                Index Cond: (val < 1000)
8422          ->  Index Scan using p1_c1_c1_val3 on p1_c1_c1
8423                Index Cond: (val < 1000)
8424          ->  Index Scan using p1_c1_c2_val3 on p1_c1_c2
8425                Index Cond: (val < 1000)
8426          ->  Index Scan using p1_c3_c1_val3 on p1_c3_c1
8427                Index Cond: (val < 1000)
8428          ->  Index Scan using p1_c3_c2_val3 on p1_c3_c2
8429                Index Cond: (val < 1000)
8430    ->  Result
8431          ->  Append
8432                ->  Seq Scan on p2
8433                      Filter: (id < 1000)
8434                ->  Seq Scan on p2_c1
8435                      Filter: (id < 1000)
8436                ->  Seq Scan on p2_c2
8437                      Filter: (id < 1000)
8438                ->  Seq Scan on p2_c3
8439                      Filter: (id < 1000)
8440                ->  Seq Scan on p2_c4
8441                      Filter: (id < 1000)
8442                ->  Seq Scan on p2_c1_c1
8443                      Filter: (id < 1000)
8444                ->  Seq Scan on p2_c1_c2
8445                      Filter: (id < 1000)
8446                ->  Seq Scan on p2_c3_c1
8447                      Filter: (id < 1000)
8448                ->  Seq Scan on p2_c3_c2
8449                      Filter: (id < 1000)
8450 (40 rows)
8451
8452 /*+ IndexScan(p1 p1_val2) IndexScan(p2 p2_id_val_idx) */
8453 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8454 UNION ALL
8455 SELECT val::int FROM p2 WHERE id < 1000;
8456 LOG:  available indexes for IndexScan(p1): p1_val3 p1_val2 p1_val1
8457 LOG:  available indexes for IndexScan(p1_c1): p1_c1_val3 p1_c1_val2 p1_c1_val1
8458 LOG:  available indexes for IndexScan(p1_c2): p1_c2_val3 p1_c2_val2 p1_c2_val1
8459 LOG:  available indexes for IndexScan(p1_c3): p1_c3_val3 p1_c3_val2 p1_c3_val1
8460 LOG:  available indexes for IndexScan(p1_c4): p1_c4_val3 p1_c4_val2 p1_c4_val1
8461 LOG:  available indexes for IndexScan(p1_c1_c1): p1_c1_c1_val3 p1_c1_c1_val2 p1_c1_c1_val1
8462 LOG:  available indexes for IndexScan(p1_c1_c2): p1_c1_c2_val3 p1_c1_c2_val2 p1_c1_c2_val1
8463 LOG:  available indexes for IndexScan(p1_c3_c1): p1_c3_c1_val3 p1_c3_c1_val2 p1_c3_c1_val1
8464 LOG:  available indexes for IndexScan(p1_c3_c2): p1_c3_c2_val3 p1_c3_c2_val2 p1_c3_c2_val1
8465 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
8466 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
8467 LOG:  available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
8468 LOG:  available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
8469 LOG:  available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
8470 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
8471 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
8472 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
8473 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
8474 LOG:  pg_hint_plan:
8475 used hint:
8476 IndexScan(p1 p1_val2)
8477 IndexScan(p2 p2_id_val_idx)
8478 not used hint:
8479 duplication hint:
8480 error hint:
8481
8482                              QUERY PLAN                             
8483 --------------------------------------------------------------------
8484  Append
8485    ->  Append
8486          ->  Index Scan using p1_val3 on p1
8487                Index Cond: (val < 1000)
8488          ->  Index Scan using p1_c1_val3 on p1_c1
8489                Index Cond: (val < 1000)
8490          ->  Index Scan using p1_c2_val3 on p1_c2
8491                Index Cond: (val < 1000)
8492          ->  Index Scan using p1_c3_val3 on p1_c3
8493                Index Cond: (val < 1000)
8494          ->  Index Scan using p1_c4_val3 on p1_c4
8495                Index Cond: (val < 1000)
8496          ->  Index Scan using p1_c1_c1_val3 on p1_c1_c1
8497                Index Cond: (val < 1000)
8498          ->  Index Scan using p1_c1_c2_val3 on p1_c1_c2
8499                Index Cond: (val < 1000)
8500          ->  Index Scan using p1_c3_c1_val3 on p1_c3_c1
8501                Index Cond: (val < 1000)
8502          ->  Index Scan using p1_c3_c2_val3 on p1_c3_c2
8503                Index Cond: (val < 1000)
8504    ->  Result
8505          ->  Append
8506                ->  Index Scan using p2_id_val_idx on p2
8507                      Index Cond: (id < 1000)
8508                ->  Index Scan using p2_c1_id_val_idx on p2_c1
8509                      Index Cond: (id < 1000)
8510                ->  Index Scan using p2_c2_id_val_idx on p2_c2
8511                      Index Cond: (id < 1000)
8512                ->  Index Scan using p2_c3_id_val_idx on p2_c3
8513                      Index Cond: (id < 1000)
8514                ->  Index Scan using p2_c4_id_val_idx on p2_c4
8515                      Index Cond: (id < 1000)
8516                ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
8517                      Index Cond: (id < 1000)
8518                ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
8519                      Index Cond: (id < 1000)
8520                ->  Index Scan using p2_c3_c1_id_val_idx on p2_c3_c1
8521                      Index Cond: (id < 1000)
8522                ->  Index Scan using p2_c3_c2_id_val_idx on p2_c3_c2
8523                      Index Cond: (id < 1000)
8524 (40 rows)
8525
8526 -- union all case
8527 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8528 UNION
8529 SELECT val::int FROM p2 WHERE id < 1000;
8530                   QUERY PLAN                   
8531 -----------------------------------------------
8532  HashAggregate
8533    Group Key: p1.val
8534    ->  Append
8535          ->  Append
8536                ->  Seq Scan on p1
8537                      Filter: (val < 1000)
8538                ->  Seq Scan on p1_c1
8539                      Filter: (val < 1000)
8540                ->  Seq Scan on p1_c2
8541                      Filter: (val < 1000)
8542                ->  Seq Scan on p1_c3
8543                      Filter: (val < 1000)
8544                ->  Seq Scan on p1_c4
8545                      Filter: (val < 1000)
8546                ->  Seq Scan on p1_c1_c1
8547                      Filter: (val < 1000)
8548                ->  Seq Scan on p1_c1_c2
8549                      Filter: (val < 1000)
8550                ->  Seq Scan on p1_c3_c1
8551                      Filter: (val < 1000)
8552                ->  Seq Scan on p1_c3_c2
8553                      Filter: (val < 1000)
8554          ->  Result
8555                ->  Append
8556                      ->  Seq Scan on p2
8557                            Filter: (id < 1000)
8558                      ->  Seq Scan on p2_c1
8559                            Filter: (id < 1000)
8560                      ->  Seq Scan on p2_c2
8561                            Filter: (id < 1000)
8562                      ->  Seq Scan on p2_c3
8563                            Filter: (id < 1000)
8564                      ->  Seq Scan on p2_c4
8565                            Filter: (id < 1000)
8566                      ->  Seq Scan on p2_c1_c1
8567                            Filter: (id < 1000)
8568                      ->  Seq Scan on p2_c1_c2
8569                            Filter: (id < 1000)
8570                      ->  Seq Scan on p2_c3_c1
8571                            Filter: (id < 1000)
8572                      ->  Seq Scan on p2_c3_c2
8573                            Filter: (id < 1000)
8574 (42 rows)
8575
8576 /*+ IndexScan(p2 p2_id_val_idx) */
8577 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8578 UNION
8579 SELECT val::int FROM p2 WHERE id < 1000;
8580 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
8581 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
8582 LOG:  available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
8583 LOG:  available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
8584 LOG:  available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
8585 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
8586 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
8587 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
8588 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
8589 LOG:  pg_hint_plan:
8590 used hint:
8591 IndexScan(p2 p2_id_val_idx)
8592 not used hint:
8593 duplication hint:
8594 error hint:
8595
8596                                 QUERY PLAN                                
8597 --------------------------------------------------------------------------
8598  HashAggregate
8599    Group Key: p1.val
8600    ->  Append
8601          ->  Append
8602                ->  Seq Scan on p1
8603                      Filter: (val < 1000)
8604                ->  Seq Scan on p1_c1
8605                      Filter: (val < 1000)
8606                ->  Seq Scan on p1_c2
8607                      Filter: (val < 1000)
8608                ->  Seq Scan on p1_c3
8609                      Filter: (val < 1000)
8610                ->  Seq Scan on p1_c4
8611                      Filter: (val < 1000)
8612                ->  Seq Scan on p1_c1_c1
8613                      Filter: (val < 1000)
8614                ->  Seq Scan on p1_c1_c2
8615                      Filter: (val < 1000)
8616                ->  Seq Scan on p1_c3_c1
8617                      Filter: (val < 1000)
8618                ->  Seq Scan on p1_c3_c2
8619                      Filter: (val < 1000)
8620          ->  Result
8621                ->  Append
8622                      ->  Index Scan using p2_id_val_idx on p2
8623                            Index Cond: (id < 1000)
8624                      ->  Index Scan using p2_c1_id_val_idx on p2_c1
8625                            Index Cond: (id < 1000)
8626                      ->  Index Scan using p2_c2_id_val_idx on p2_c2
8627                            Index Cond: (id < 1000)
8628                      ->  Index Scan using p2_c3_id_val_idx on p2_c3
8629                            Index Cond: (id < 1000)
8630                      ->  Index Scan using p2_c4_id_val_idx on p2_c4
8631                            Index Cond: (id < 1000)
8632                      ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
8633                            Index Cond: (id < 1000)
8634                      ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
8635                            Index Cond: (id < 1000)
8636                      ->  Index Scan using p2_c3_c1_id_val_idx on p2_c3_c1
8637                            Index Cond: (id < 1000)
8638                      ->  Index Scan using p2_c3_c2_id_val_idx on p2_c3_c2
8639                            Index Cond: (id < 1000)
8640 (42 rows)
8641
8642 /*+ IndexScan(p1 p1_val2) IndexScan(p2 p2_id_val_idx) */
8643 EXPLAIN (COSTS off) SELECT val FROM p1 WHERE val < 1000
8644 UNION
8645 SELECT val::int FROM p2 WHERE id < 1000;
8646 LOG:  available indexes for IndexScan(p1): p1_val3 p1_val2 p1_val1
8647 LOG:  available indexes for IndexScan(p1_c1): p1_c1_val3 p1_c1_val2 p1_c1_val1
8648 LOG:  available indexes for IndexScan(p1_c2): p1_c2_val3 p1_c2_val2 p1_c2_val1
8649 LOG:  available indexes for IndexScan(p1_c3): p1_c3_val3 p1_c3_val2 p1_c3_val1
8650 LOG:  available indexes for IndexScan(p1_c4): p1_c4_val3 p1_c4_val2 p1_c4_val1
8651 LOG:  available indexes for IndexScan(p1_c1_c1): p1_c1_c1_val3 p1_c1_c1_val2 p1_c1_c1_val1
8652 LOG:  available indexes for IndexScan(p1_c1_c2): p1_c1_c2_val3 p1_c1_c2_val2 p1_c1_c2_val1
8653 LOG:  available indexes for IndexScan(p1_c3_c1): p1_c3_c1_val3 p1_c3_c1_val2 p1_c3_c1_val1
8654 LOG:  available indexes for IndexScan(p1_c3_c2): p1_c3_c2_val3 p1_c3_c2_val2 p1_c3_c2_val1
8655 LOG:  available indexes for IndexScan(p2): p2_id_val_idx
8656 LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
8657 LOG:  available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
8658 LOG:  available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
8659 LOG:  available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
8660 LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
8661 LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
8662 LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
8663 LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
8664 LOG:  pg_hint_plan:
8665 used hint:
8666 IndexScan(p1 p1_val2)
8667 IndexScan(p2 p2_id_val_idx)
8668 not used hint:
8669 duplication hint:
8670 error hint:
8671
8672                                 QUERY PLAN                                
8673 --------------------------------------------------------------------------
8674  HashAggregate
8675    Group Key: p1.val
8676    ->  Append
8677          ->  Append
8678                ->  Index Scan using p1_val3 on p1
8679                      Index Cond: (val < 1000)
8680                ->  Index Scan using p1_c1_val3 on p1_c1
8681                      Index Cond: (val < 1000)
8682                ->  Index Scan using p1_c2_val3 on p1_c2
8683                      Index Cond: (val < 1000)
8684                ->  Index Scan using p1_c3_val3 on p1_c3
8685                      Index Cond: (val < 1000)
8686                ->  Index Scan using p1_c4_val3 on p1_c4
8687                      Index Cond: (val < 1000)
8688                ->  Index Scan using p1_c1_c1_val3 on p1_c1_c1
8689                      Index Cond: (val < 1000)
8690                ->  Index Scan using p1_c1_c2_val3 on p1_c1_c2
8691                      Index Cond: (val < 1000)
8692                ->  Index Scan using p1_c3_c1_val3 on p1_c3_c1
8693                      Index Cond: (val < 1000)
8694                ->  Index Scan using p1_c3_c2_val3 on p1_c3_c2
8695                      Index Cond: (val < 1000)
8696          ->  Result
8697                ->  Append
8698                      ->  Index Scan using p2_id_val_idx on p2
8699                            Index Cond: (id < 1000)
8700                      ->  Index Scan using p2_c1_id_val_idx on p2_c1
8701                            Index Cond: (id < 1000)
8702                      ->  Index Scan using p2_c2_id_val_idx on p2_c2
8703                            Index Cond: (id < 1000)
8704                      ->  Index Scan using p2_c3_id_val_idx on p2_c3
8705                            Index Cond: (id < 1000)
8706                      ->  Index Scan using p2_c4_id_val_idx on p2_c4
8707                            Index Cond: (id < 1000)
8708                      ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1
8709                            Index Cond: (id < 1000)
8710                      ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2
8711                            Index Cond: (id < 1000)
8712                      ->  Index Scan using p2_c3_c1_id_val_idx on p2_c3_c1
8713                            Index Cond: (id < 1000)
8714                      ->  Index Scan using p2_c3_c2_id_val_idx on p2_c3_c2
8715                            Index Cond: (id < 1000)
8716 (42 rows)
8717
8718 --
8719 -- Rows hint tests
8720 --
8721 -- Explain result includes "Planning time" if COSTS is enabled, but
8722 -- this test needs it enabled for get rows count. So do tests via psql
8723 -- and grep -v the mutable line.
8724 -- value types
8725 \o results/pg_hint_plan.tmpout
8726 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8727 \o
8728 \! sql/maskout.sh results/pg_hint_plan.tmpout
8729                                   QUERY PLAN                                  
8730 ------------------------------------------------------------------------------
8731  Merge Join  (cost=xxx..xxx rows=1000 width=xxx)
8732    Merge Cond: (t1.id = t2.id)
8733    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8734    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8735
8736 \o results/pg_hint_plan.tmpout
8737 /*+ Rows(t1 t2 #99) */
8738 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8739 LOG:  pg_hint_plan:
8740 used hint:
8741 Rows(t1 t2 #99)
8742 not used hint:
8743 duplication hint:
8744 error hint:
8745
8746 \o
8747 \! sql/maskout.sh results/pg_hint_plan.tmpout
8748                                   QUERY PLAN                                  
8749 ------------------------------------------------------------------------------
8750  Merge Join  (cost=xxx..xxx rows=99 width=xxx)
8751    Merge Cond: (t1.id = t2.id)
8752    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8753    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8754
8755 \o results/pg_hint_plan.tmpout
8756 /*+ Rows(t1 t2 +99) */
8757 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8758 LOG:  pg_hint_plan:
8759 used hint:
8760 Rows(t1 t2 +99)
8761 not used hint:
8762 duplication hint:
8763 error hint:
8764
8765 \o
8766 \! sql/maskout.sh results/pg_hint_plan.tmpout
8767                                   QUERY PLAN                                  
8768 ------------------------------------------------------------------------------
8769  Merge Join  (cost=xxx..xxx rows=1099 width=xxx)
8770    Merge Cond: (t1.id = t2.id)
8771    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8772    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8773
8774 \o results/pg_hint_plan.tmpout
8775 /*+ Rows(t1 t2 -99) */
8776 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8777 LOG:  pg_hint_plan:
8778 used hint:
8779 Rows(t1 t2 -99)
8780 not used hint:
8781 duplication hint:
8782 error hint:
8783
8784 \o
8785 \! sql/maskout.sh results/pg_hint_plan.tmpout
8786                                   QUERY PLAN                                  
8787 ------------------------------------------------------------------------------
8788  Merge Join  (cost=xxx..xxx rows=901 width=xxx)
8789    Merge Cond: (t1.id = t2.id)
8790    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8791    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8792
8793 \o results/pg_hint_plan.tmpout
8794 /*+ Rows(t1 t2 *99) */
8795 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8796 LOG:  pg_hint_plan:
8797 used hint:
8798 Rows(t1 t2 *99)
8799 not used hint:
8800 duplication hint:
8801 error hint:
8802
8803 \o
8804 \! sql/maskout.sh results/pg_hint_plan.tmpout
8805                                   QUERY PLAN                                  
8806 ------------------------------------------------------------------------------
8807  Merge Join  (cost=xxx..xxx rows=99000 width=xxx)
8808    Merge Cond: (t1.id = t2.id)
8809    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8810    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8811
8812 \o results/pg_hint_plan.tmpout
8813 /*+ Rows(t1 t2 *0.01) */
8814 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8815 LOG:  pg_hint_plan:
8816 used hint:
8817 Rows(t1 t2 *0.01)
8818 not used hint:
8819 duplication hint:
8820 error hint:
8821
8822 \o
8823 \! sql/maskout.sh results/pg_hint_plan.tmpout
8824                                   QUERY PLAN                                  
8825 ------------------------------------------------------------------------------
8826  Merge Join  (cost=xxx..xxx rows=10 width=xxx)
8827    Merge Cond: (t1.id = t2.id)
8828    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8829    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8830
8831 \o results/pg_hint_plan.tmpout
8832 /*+ Rows(t1 t2 #aa) */
8833 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8834 INFO:  pg_hint_plan: hint syntax error at or near "aa"
8835 DETAIL:  Rows hint requires valid number as rows estimation.
8836 LOG:  pg_hint_plan:
8837 used hint:
8838 not used hint:
8839 duplication hint:
8840 error hint:
8841 Rows(t1 t2 #aa)
8842
8843 \o
8844 \! sql/maskout.sh results/pg_hint_plan.tmpout
8845                                   QUERY PLAN                                  
8846 ------------------------------------------------------------------------------
8847  Merge Join  (cost=xxx..xxx rows=1000 width=xxx)
8848    Merge Cond: (t1.id = t2.id)
8849    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8850    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8851
8852 \o results/pg_hint_plan.tmpout
8853 /*+ Rows(t1 t2 /99) */
8854 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
8855 INFO:  pg_hint_plan: hint syntax error at or near "/99"
8856 DETAIL:  Unrecognized rows value type notation.
8857 LOG:  pg_hint_plan:
8858 used hint:
8859 not used hint:
8860 duplication hint:
8861 error hint:
8862 Rows(t1 t2 /99)
8863
8864 \o
8865 \! sql/maskout.sh results/pg_hint_plan.tmpout
8866                                   QUERY PLAN                                  
8867 ------------------------------------------------------------------------------
8868  Merge Join  (cost=xxx..xxx rows=1000 width=xxx)
8869    Merge Cond: (t1.id = t2.id)
8870    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8871    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8872
8873 -- round up to 1
8874 \o results/pg_hint_plan.tmpout
8875 /*+ Rows(t1 t2 -99999) */
8876 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
8877 WARNING:  Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 -99999) 
8878 LOG:  pg_hint_plan:
8879 used hint:
8880 Rows(t1 t2 -99999)
8881 not used hint:
8882 duplication hint:
8883 error hint:
8884
8885 \o
8886 \! sql/maskout.sh results/pg_hint_plan.tmpout
8887                                   QUERY PLAN                                  
8888 ------------------------------------------------------------------------------
8889  Merge Join  (cost=xxx..xxx rows=1 width=xxx)
8890    Merge Cond: (t1.id = t2.id)
8891    ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8892    ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8893
8894 -- complex join tree
8895 \o results/pg_hint_plan.tmpout
8896 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8897 \o
8898 \! sql/maskout.sh results/pg_hint_plan.tmpout
8899                                      QUERY PLAN                                     
8900 ------------------------------------------------------------------------------------
8901  Merge Join  (cost=xxx..xxx rows=10 width=xxx)
8902    Merge Cond: (t1.id = t3.id)
8903    ->  Merge Join  (cost=xxx..xxx rows=1000 width=xxx)
8904          Merge Cond: (t1.id = t2.id)
8905          ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8906          ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8907    ->  Sort  (cost=xxx..xxx rows=100 width=xxx)
8908          Sort Key: t3.id
8909          ->  Seq Scan on t3  (cost=xxx..xxx rows=100 width=xxx)
8910
8911 \o results/pg_hint_plan.tmpout
8912 /*+ Rows(t1 t2 #22) */
8913 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8914 LOG:  pg_hint_plan:
8915 used hint:
8916 Rows(t1 t2 #22)
8917 not used hint:
8918 duplication hint:
8919 error hint:
8920
8921 \o
8922 \! sql/maskout.sh results/pg_hint_plan.tmpout
8923                                      QUERY PLAN                                     
8924 ------------------------------------------------------------------------------------
8925  Merge Join  (cost=xxx..xxx rows=1 width=xxx)
8926    Merge Cond: (t1.id = t3.id)
8927    ->  Merge Join  (cost=xxx..xxx rows=22 width=xxx)
8928          Merge Cond: (t1.id = t2.id)
8929          ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8930          ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8931    ->  Sort  (cost=xxx..xxx rows=100 width=xxx)
8932          Sort Key: t3.id
8933          ->  Seq Scan on t3  (cost=xxx..xxx rows=100 width=xxx)
8934
8935 \o results/pg_hint_plan.tmpout
8936 /*+ Rows(t1 t3 *10) */
8937 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
8938 LOG:  pg_hint_plan:
8939 used hint:
8940 Rows(t1 t3 *10)
8941 not used hint:
8942 duplication hint:
8943 error hint:
8944
8945 \o
8946 set max_parallel_workers_per_gather to DEFAULT;
8947 \! sql/maskout.sh results/pg_hint_plan.tmpout
8948                                      QUERY PLAN                                     
8949 ------------------------------------------------------------------------------------
8950  Merge Join  (cost=xxx..xxx rows=100 width=xxx)
8951    Merge Cond: (t1.id = t3.id)
8952    ->  Merge Join  (cost=xxx..xxx rows=1000 width=xxx)
8953          Merge Cond: (t1.id = t2.id)
8954          ->  Index Scan using t1_pkey on t1  (cost=xxx..xxx rows=10000 width=xxx)
8955          ->  Index Scan using t2_pkey on t2  (cost=xxx..xxx rows=1000 width=xxx)
8956    ->  Sort  (cost=xxx..xxx rows=100 width=xxx)
8957          Sort Key: t3.id
8958          ->  Seq Scan on t3  (cost=xxx..xxx rows=100 width=xxx)
8959
8960 \! rm results/pg_hint_plan.tmpout
8961 -- hint error level
8962 set client_min_messages to 'DEBUG1';
8963 set pg_hint_plan.debug_level to 'verbose';
8964 /*+ SeqScan( */ SELECT 1;
8965 INFO:  pg_hint_plan: hint syntax error at or near ""
8966 DETAIL:  Closing parenthesis is necessary.
8967  ?column? 
8968 ----------
8969         1
8970 (1 row)
8971
8972 /*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
8973 LOG:  pg_hint_plan:
8974 used hint:
8975 SeqScan(t1)
8976 not used hint:
8977 duplication hint:
8978 error hint:
8979
8980  id | val 
8981 ----+-----
8982 (0 rows)
8983
8984 set pg_hint_plan.message_level to 'DEBUG1';
8985 set pg_hint_plan.parse_messages to 'NOTICE';
8986 /*+ SeqScan( */ SELECT 1;
8987 NOTICE:  pg_hint_plan: hint syntax error at or near ""
8988 DETAIL:  Closing parenthesis is necessary.
8989  ?column? 
8990 ----------
8991         1
8992 (1 row)
8993
8994 /*+ SeqScan(t1) */ SELECT * FROM t1 LIMIT 0;
8995 DEBUG:  pg_hint_plan:
8996 used hint:
8997 SeqScan(t1)
8998 not used hint:
8999 duplication hint:
9000 error hint:
9001
9002  id | val 
9003 ----+-----
9004 (0 rows)
9005