OSDN Git Service

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