OSDN Git Service

PG9.1でut-*テスト以外のリグレッションテストが通るよう、予想結果を修正した。
[pghintplan/pg_hint_plan.git] / expected / pg_hint_plan-9.1.out
index b0858f5..4794411 100644 (file)
@@ -785,27 +785,29 @@ error hint:
 
 /*+Leading(t3 t4 t1 t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
+INFO:  hint syntax error at or near "Leading(t3 t4 t1 t2 t1)"
+DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
-Leading(t3 t4 t1 t2 t1)
 not used hint:
 duplication hint:
 error hint:
+Leading(t3 t4 t1 t2 t1)
 
                     QUERY PLAN                    
 --------------------------------------------------
- Nested Loop
+ Merge Join
+   Merge Cond: (t1.id = t4.id)
    ->  Merge Join
-         Merge Cond: (t3.id = t1.id)
+         Merge Cond: (t1.id = t3.id)
          ->  Merge Join
-               Merge Cond: (t3.id = t4.id)
-               ->  Index Scan using t3_pkey on t3
-               ->  Sort
-                     Sort Key: t4.id
-                     ->  Seq Scan on t4
-         ->  Index Scan using t1_pkey on t1
-   ->  Index Scan using t2_pkey on t2
-         Index Cond: (id = t1.id)
+               Merge Cond: (t1.id = t2.id)
+               ->  Index Scan using t1_pkey on t1
+               ->  Index Scan using t2_pkey on t2
+         ->  Index Scan using t3_pkey on t3
+   ->  Sort
+         Sort Key: t4.id
+         ->  Seq Scan on t4
 (12 rows)
 
 /*+Leading(t3 t4 t4)*/
@@ -900,27 +902,27 @@ error hint:
 (5 rows)
 
 -- single table scan hint test
-EXPLAIN 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);
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Index Scan using t1_pkey on t1  (cost=1.89..10.16 rows=1 width=4)
+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);
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Index Scan using t1_pkey on t1
    Index Cond: (id = $3)
    InitPlan 2 (returns $1)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 1 (returns $0)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_1  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_1
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
    InitPlan 4 (returns $3)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 3 (returns $2)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_2  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_2
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
 (14 rows)
 
 /*+BitmapScan(v_1)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(v_1)
@@ -928,26 +930,26 @@ not used hint:
 duplication hint:
 error hint:
 
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Index Scan using t1_pkey on t1  (cost=29.34..37.61 rows=1 width=4)
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Index Scan using t1_pkey on t1
    Index Cond: (id = $2)
    InitPlan 1 (returns $0)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_1  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_1
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
    InitPlan 3 (returns $2)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 2 (returns $1)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_2  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_2
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
 (14 rows)
 
 /*+BitmapScan(v_2)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(v_2)
@@ -955,26 +957,26 @@ not used hint:
 duplication hint:
 error hint:
 
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Index Scan using t1_pkey on t1  (cost=29.34..37.61 rows=1 width=4)
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Index Scan using t1_pkey on t1
    Index Cond: (id = $2)
    InitPlan 2 (returns $1)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 1 (returns $0)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_1  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_1
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
    InitPlan 3 (returns $2)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_2  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_2
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
 (14 rows)
 
 /*+BitmapScan(t1)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(t1)
@@ -982,28 +984,28 @@ not used hint:
 duplication hint:
 error hint:
 
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on t1  (cost=6.15..10.17 rows=1 width=4)
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Bitmap Heap Scan on t1
    Recheck Cond: (id = $3)
    InitPlan 2 (returns $1)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 1 (returns $0)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_1  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_1
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
    InitPlan 4 (returns $3)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 3 (returns $2)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_2  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_2
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
-   ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.26 rows=1 width=0)
+   ->  Bitmap Index Scan on t1_pkey
          Index Cond: (id = $3)
 (16 rows)
 
 /*+BitmapScan(v_1)BitmapScan(v_2)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(v_1)
@@ -1012,26 +1014,26 @@ not used hint:
 duplication hint:
 error hint:
 
-                                     QUERY PLAN                                     
-------------------------------------------------------------------------------------
- Index Scan using t1_pkey on t1  (cost=56.78..65.05 rows=1 width=4)
+                    QUERY PLAN                    
+--------------------------------------------------
+ Index Scan using t1_pkey on t1
    Index Cond: (id = $1)
    InitPlan 1 (returns $0)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_1  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_1
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
    InitPlan 2 (returns $1)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_2  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_2
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
 (14 rows)
 
 /*+BitmapScan(v_1)BitmapScan(t1)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(t1)
@@ -1040,28 +1042,28 @@ not used hint:
 duplication hint:
 error hint:
 
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on t1  (cost=33.60..37.61 rows=1 width=4)
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Bitmap Heap Scan on t1
    Recheck Cond: (id = $2)
    InitPlan 1 (returns $0)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_1  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_1
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
    InitPlan 3 (returns $2)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 2 (returns $1)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_2  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_2
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
-   ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.26 rows=1 width=0)
+   ->  Bitmap Index Scan on t1_pkey
          Index Cond: (id = $2)
 (16 rows)
 
 /*+BitmapScan(v_2)BitmapScan(t1)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(t1)
@@ -1070,28 +1072,28 @@ not used hint:
 duplication hint:
 error hint:
 
-                                             QUERY PLAN                                              
------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on t1  (cost=33.60..37.61 rows=1 width=4)
+                              QUERY PLAN                              
+----------------------------------------------------------------------
+ Bitmap Heap Scan on t1
    Recheck Cond: (id = $2)
    InitPlan 2 (returns $1)
-     ->  Result  (cost=0.94..0.95 rows=1 width=0)
+     ->  Result
            InitPlan 1 (returns $0)
-             ->  Limit  (cost=0.00..0.94 rows=1 width=4)
-                   ->  Index Scan Backward using t1_pkey on t1 v_1  (cost=0.00..8.43 rows=9 width=4)
+             ->  Limit
+                   ->  Index Scan Backward using t1_pkey on t1 v_1
                          Index Cond: ((id IS NOT NULL) AND (id < 10))
    InitPlan 3 (returns $2)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_2  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_2
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
-   ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.26 rows=1 width=0)
+   ->  Bitmap Index Scan on t1_pkey
          Index Cond: (id = $2)
 (16 rows)
 
 /*+BitmapScan(v_1)BitmapScan(v_2)BitmapScan(t1)*/
-EXPLAIN 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);
+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);
 LOG:  pg_hint_plan:
 used hint:
 BitmapScan(t1)
@@ -1101,23 +1103,23 @@ not used hint:
 duplication hint:
 error hint:
 
-                                     QUERY PLAN                                     
-------------------------------------------------------------------------------------
- Bitmap Heap Scan on t1  (cost=61.04..65.05 rows=1 width=4)
+                    QUERY PLAN                    
+--------------------------------------------------
+ Bitmap Heap Scan on t1
    Recheck Cond: (id = $1)
    InitPlan 1 (returns $0)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_1  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_1
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
    InitPlan 2 (returns $1)
-     ->  Aggregate  (cost=28.38..28.39 rows=1 width=4)
-           ->  Bitmap Heap Scan on t1 v_2  (cost=4.32..28.36 rows=9 width=4)
+     ->  Aggregate
+           ->  Bitmap Heap Scan on t1 v_2
                  Recheck Cond: (id < 10)
-                 ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.32 rows=9 width=0)
+                 ->  Bitmap Index Scan on t1_pkey
                        Index Cond: (id < 10)
-   ->  Bitmap Index Scan on t1_pkey  (cost=0.00..4.26 rows=1 width=0)
+   ->  Bitmap Index Scan on t1_pkey
          Index Cond: (id = $1)
 (16 rows)
 
@@ -3009,22 +3011,17 @@ EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid =
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
          ->  Seq Scan on p1_c3 p1
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-         ->  Tid Scan on p1_c4 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-(25 rows)
+         ->  Seq Scan on p1_c4 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(20 rows)
 
 SET constraint_exclusion TO on;
 EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
@@ -3036,13 +3033,11 @@ EXPLAIN (COSTS false) SELECT * FROM p1 WHERE id >= 50 AND id <= 51 AND p1.ctid =
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
          ->  Seq Scan on p1_c1 p1
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-         ->  Tid Scan on p1_c1_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(10 rows)
 
 SET constraint_exclusion TO off;
 /*+SeqScan(p1)*/
@@ -3352,24 +3347,19 @@ EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 SET constraint_exclusion TO on;
 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;
@@ -3384,15 +3374,13 @@ EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 SET constraint_exclusion TO off;
 /*+SeqScan(p1)*/
@@ -3419,24 +3407,19 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 /*+IndexScan(p1)*/
 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;
@@ -3462,24 +3445,19 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 /*+BitmapScan(p1)*/
 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;
@@ -3505,24 +3483,19 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 /*+TidScan(p1)*/
 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;
@@ -3548,24 +3521,19 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 /*+NestLoop(p1 t1)*/
 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;
@@ -3589,25 +3557,20 @@ error hint:
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
          ->  Seq Scan on p1_c3 p1
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-         ->  Tid Scan on p1_c4 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
+         ->  Seq Scan on p1_c4 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Materialize
          ->  Index Scan using t1_pkey on t1
                Index Cond: (id < 10)
-(29 rows)
+(24 rows)
 
 /*+MergeJoin(p1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -3633,24 +3596,19 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c3 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c4 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c3_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c4 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c3_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(30 rows)
+(25 rows)
 
 /*+HashJoin(p1 t1)*/
 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;
@@ -3674,25 +3632,20 @@ error hint:
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
          ->  Seq Scan on p1_c3 p1
                Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-         ->  Tid Scan on p1_c4 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c1_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c1 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
-         ->  Tid Scan on p1_c3_c2 p1
-               TID Cond: (ctid = '(1,1)'::tid)
-               Filter: ((id >= 50) AND (id <= 51))
+         ->  Seq Scan on p1_c4 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Hash
          ->  Index Scan using t1_pkey on t1
                Index Cond: (id < 10)
-(29 rows)
+(24 rows)
 
 SET constraint_exclusion TO on;
 /*+SeqScan(p1)*/
@@ -3715,15 +3668,13 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 /*+IndexScan(p1)*/
 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;
@@ -3745,15 +3696,13 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 /*+BitmapScan(p1)*/
 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,15 +3724,13 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 /*+TidScan(p1)*/
 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;
@@ -3805,15 +3752,13 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 /*+NestLoop(p1 t1)*/
 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;
@@ -3836,13 +3781,11 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-(16 rows)
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(14 rows)
 
 /*+MergeJoin(p1 t1)*/
 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;
@@ -3864,15 +3807,13 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
    ->  Index Scan using t1_pkey on t1
          Index Cond: (id < 10)
-(17 rows)
+(15 rows)
 
 /*+HashJoin(p1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM p1, t1 WHERE p1.id >= 50 AND p1.id <= 51 AND p1.ctid = '(1,1)' AND p1.id = t1.id AND t1.id < 10;
@@ -3895,13 +3836,11 @@ error hint:
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
                ->  Seq Scan on p1_c1 p1
                      Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-               ->  Tid Scan on p1_c1_c1 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-               ->  Tid Scan on p1_c1_c2 p1
-                     TID Cond: (ctid = '(1,1)'::tid)
-                     Filter: ((id >= 50) AND (id <= 51))
-(16 rows)
+               ->  Seq Scan on p1_c1_c1 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+               ->  Seq Scan on p1_c1_c2 p1
+                     Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(14 rows)
 
 SET constraint_exclusion TO off;
 EXPLAIN (COSTS false) SELECT * FROM ONLY p1 WHERE id >= 50 AND id <= 51 AND p1.ctid = '(1,1)';
@@ -4393,10 +4332,10 @@ INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1
 DETAIL:  Conflict join method hint.
 INFO:  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)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
-DETAIL:  Conflict leading hint.
 INFO:  hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict set hint.
+INFO:  hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
 TidScan(t1)
@@ -4679,56 +4618,140 @@ SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t
 );
 LOG:  pg_hint_plan:
 used hint:
-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)
-not used hint:
 HashJoin(t1_1 t3_1)
 NestLoop(t1_2 t2_2)
 MergeJoin(t1_3 t3_3)
 NestLoop(t1_4 t2_4)
 NestLoop(t1_5 t2_5)
+not used hint:
+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)
 duplication hint:
 error hint:
 
-                            QUERY PLAN                             
--------------------------------------------------------------------
+                               QUERY PLAN                                
+-------------------------------------------------------------------------
  Nested Loop
    CTE c1_1
      ->  Aggregate
            ->  Merge Join
-                 Merge Cond: (t2_5.id = t1_5.id)
-                 ->  Merge Join
-                       Merge Cond: (t2_5.id = t3_5.id)
+                 Merge Cond: (t1_5.id = t3_5.id)
+                 ->  Nested Loop
                        ->  Index Scan using t2_pkey on t2 t2_5
-                       ->  Sort
-                             Sort Key: t3_5.id
-                             ->  Seq Scan on t3 t3_5
-                 ->  Index Scan using t1_pkey on t1 t1_5
-   InitPlan 2 (returns $1)
+                       ->  Index Scan using t1_pkey on t1 t1_5
+                             Index Cond: (id = t2_5.id)
+                 ->  Sort
+                       Sort Key: t3_5.id
+                       ->  Seq Scan on t3 t3_5
+   InitPlan 2 (returns $2)
      ->  Aggregate
            ->  Merge Join
-                 Merge Cond: (t2_2.id = t1_2.id)
-                 ->  Merge Join
-                       Merge Cond: (t2_2.id = t3_2.id)
+                 Merge Cond: (t1_2.id = t3_2.id)
+                 ->  Nested Loop
                        ->  Index Scan using t2_pkey on t2 t2_2
-                       ->  Sort
-                             Sort Key: t3_2.id
-                             ->  Seq Scan on t3 t3_2
-                 ->  Index Scan using t1_pkey on t1 t1_2
-   InitPlan 3 (returns $2)
+                       ->  Index Scan using t1_pkey on t1 t1_2
+                             Index Cond: (id = t2_2.id)
+                 ->  Sort
+                       Sort Key: t3_2.id
+                       ->  Seq Scan on t3 t3_2
+   InitPlan 3 (returns $3)
      ->  Aggregate
            ->  Merge Join
-                 Merge Cond: (t2_4.id = t1_4.id)
-                 ->  Merge Join
-                       Merge Cond: (t2_4.id = t3_4.id)
+                 Merge Cond: (t1_4.id = t3_4.id)
+                 ->  Nested Loop
                        ->  Index Scan using t2_pkey on t2 t2_4
-                       ->  Sort
-                             Sort Key: t3_4.id
-                             ->  Seq Scan on t3 t3_4
-                 ->  Index Scan using t1_pkey on t1 t1_4
-   ->  Nested Loop
-         ->  Nested Loop
-               ->  Nested Loop
-                     ->  Nested Loop
+                       ->  Index Scan using t1_pkey on t1 t1_4
+                             Index Cond: (id = t2_4.id)
+                 ->  Sort
+                       Sort Key: t3_4.id
+                       ->  Seq Scan on t3 t3_4
+   ->  Nested Loop
+         ->  Nested Loop
+               ->  Nested Loop
+                     ->  Nested Loop
+                           ->  Nested Loop
+                                 ->  Index Scan using t2_pkey on t2 t2_1
+                                       Index Cond: (id = $3)
+                                 ->  Seq Scan on t3 t3_1
+                                       Filter: (id = $3)
+                           ->  Index Scan using t1_pkey on t1 t1_1
+                                 Index Cond: (id = $3)
+                     ->  Index Scan using t1_pkey on t1 t1_3
+                           Index Cond: (id = $3)
+               ->  Index Scan using t2_pkey on t2 t2_3
+                     Index Cond: (id = $3)
+         ->  Seq Scan on t3 t3_3
+               Filter: (id = $3)
+   ->  CTE Scan on c1_1
+         Filter: (id = $3)
+(53 rows)
+
+/*+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)*/
+EXPLAIN (COSTS false)
+WITH c1_1(id) AS (
+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
+)
+SELECT t1_1.id, (
+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
+) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
+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
+) 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 = (
+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 
+);
+LOG:  pg_hint_plan:
+used hint:
+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)
+not used hint:
+HashJoin(t1_1 t3_1)
+NestLoop(t1_2 t2_2)
+MergeJoin(t1_3 t3_3)
+NestLoop(t1_4 t2_4)
+NestLoop(t1_5 t2_5)
+duplication hint:
+error hint:
+
+                            QUERY PLAN                             
+-------------------------------------------------------------------
+ Nested Loop
+   CTE c1_1
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t2_5.id = t1_5.id)
+                 ->  Merge Join
+                       Merge Cond: (t2_5.id = t3_5.id)
+                       ->  Index Scan using t2_pkey on t2 t2_5
+                       ->  Sort
+                             Sort Key: t3_5.id
+                             ->  Seq Scan on t3 t3_5
+                 ->  Index Scan using t1_pkey on t1 t1_5
+   InitPlan 2 (returns $1)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t2_2.id = t1_2.id)
+                 ->  Merge Join
+                       Merge Cond: (t2_2.id = t3_2.id)
+                       ->  Index Scan using t2_pkey on t2 t2_2
+                       ->  Sort
+                             Sort Key: t3_2.id
+                             ->  Seq Scan on t3 t3_2
+                 ->  Index Scan using t1_pkey on t1 t1_2
+   InitPlan 3 (returns $2)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t2_4.id = t1_4.id)
+                 ->  Merge Join
+                       Merge Cond: (t2_4.id = t3_4.id)
+                       ->  Index Scan using t2_pkey on t2 t2_4
+                       ->  Sort
+                             Sort Key: t3_4.id
+                             ->  Seq Scan on t3 t3_4
+                 ->  Index Scan using t1_pkey on t1 t1_4
+   ->  Nested Loop
+         ->  Nested Loop
+               ->  Nested Loop
+                     ->  Nested Loop
                            ->  Nested Loop
                                  ->  Seq Scan on t3 t3_3
                                        Filter: (id = $2)
@@ -4990,11 +5013,95 @@ SELECT max(t1_4.id) FROM t1 t1_4, t2 t2_4, t3 t3_4 WHERE t1_4.id = t2_4.id AND t
 );
 LOG:  pg_hint_plan:
 used hint:
+HashJoin(t1_1 t3_1)
+NestLoop(t1_2 t2_2)
+MergeJoin(t1_3 t3_3)
+NestLoop(t1_4 t2_4)
+NestLoop(t1_5 t2_5)
+not used hint:
 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)
+duplication hint:
+error hint:
+
+                          QUERY PLAN                           
+---------------------------------------------------------------
+ Nested Loop
+   CTE c1_1
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t1_5.id = t3_5.id)
+                 ->  Nested Loop
+                       ->  Index Scan using t2_pkey on t2 t2_5
+                       ->  Index Scan using t1_pkey on t1 t1_5
+                             Index Cond: (id = t2_5.id)
+                 ->  Sort
+                       Sort Key: t3_5.id
+                       ->  Seq Scan on t3 t3_5
+   InitPlan 2 (returns $2)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t1_2.id = t3_2.id)
+                 ->  Nested Loop
+                       ->  Index Scan using t2_pkey on t2 t2_2
+                       ->  Index Scan using t1_pkey on t1 t1_2
+                             Index Cond: (id = t2_2.id)
+                 ->  Sort
+                       Sort Key: t3_2.id
+                       ->  Seq Scan on t3 t3_2
+   InitPlan 3 (returns $3)
+     ->  Aggregate
+           ->  Merge Join
+                 Merge Cond: (t1_4.id = t3_4.id)
+                 ->  Nested Loop
+                       ->  Index Scan using t2_pkey on t2 t2_4
+                       ->  Index Scan using t1_pkey on t1 t1_4
+                             Index Cond: (id = t2_4.id)
+                 ->  Sort
+                       Sort Key: t3_4.id
+                       ->  Seq Scan on t3 t3_4
+   ->  Nested Loop
+         ->  Nested Loop
+               ->  Nested Loop
+                     ->  Index Scan using t2_pkey on t2 t2_1
+                           Index Cond: (id = $3)
+                     ->  Seq Scan on t3 t3_1
+                           Filter: (id = $3)
+               ->  Index Scan using t1_pkey on t1 t1_1
+                     Index Cond: (id = $3)
+         ->  Nested Loop
+               ->  Nested Loop
+                     ->  Index Scan using t2_pkey on t2 t2_3
+                           Index Cond: (id = $3)
+                     ->  Seq Scan on t3 t3_3
+                           Filter: (id = $3)
+               ->  Index Scan using t1_pkey on t1 t1_3
+                     Index Cond: (id = $3)
+   ->  CTE Scan on c1_1
+         Filter: (id = $3)
+(53 rows)
+
+/*+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)*/
+EXPLAIN (COSTS false)
+WITH c1_1(id) AS (
+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
+)
+SELECT t1_1.id, (
+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
+) FROM t1 t1_1, t2 t2_1, t3 t3_1, (
+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
+) 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 = (
+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 
+);
+LOG:  pg_hint_plan:
+used hint:
+MergeJoin(t1_3 t3_3)
+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)
 not used hint:
 HashJoin(t1_1 t3_1)
 NestLoop(t1_2 t2_2)
-MergeJoin(t1_3 t3_3)
 NestLoop(t1_4 t2_4)
 NestLoop(t1_5 t2_5)
 duplication hint:
@@ -5099,9 +5206,9 @@ DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
 not used hint:
-Leading(t1 t2 t1)
 duplication hint:
 error hint:
+Leading(t1 t2 t1)
 
                   QUERY PLAN                   
 -----------------------------------------------
@@ -5233,15 +5340,15 @@ Set(seq_page_cost on)
 
 -- debug log of candidate index to use IndexScan
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-          QUERY PLAN           
--------------------------------
- Index Scan using t5_id3 on t5
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
    Index Cond: (id = 1)
 (2 rows)
 
 /*+IndexScan(t5 t5_id2)*/
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG:  available indexes for IndexScan("t5"): t5_id2
+LOG:  available indexes for IndexScan(t5): t5_id2
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(t5 t5_id2)
@@ -5257,7 +5364,7 @@ error hint:
 
 /*+IndexScan(t5 no_exist)*/
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG:  available indexes for IndexScan("t5"):
+LOG:  available indexes for IndexScan(t5):
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(t5 no_exist)
@@ -5273,7 +5380,7 @@ error hint:
 
 /*+IndexScan(t5 t5_id1 t5_id2)*/
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG:  available indexes for IndexScan("t5"): t5_id2 t5_id1
+LOG:  available indexes for IndexScan(t5): t5_id2 t5_id1
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(t5 t5_id1 t5_id2)
@@ -5289,7 +5396,7 @@ error hint:
 
 /*+IndexScan(t5 no_exist t5_id2)*/
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG:  available indexes for IndexScan("t5"): t5_id2
+LOG:  available indexes for IndexScan(t5): t5_id2
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(t5 no_exist t5_id2)
@@ -5305,7 +5412,7 @@ error hint:
 
 /*+IndexScan(t5 no_exist5 no_exist2)*/
 EXPLAIN (COSTS false) SELECT * FROM t5 WHERE t5.id = 1;
-LOG:  available indexes for IndexScan("t5"):
+LOG:  available indexes for IndexScan(t5):
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(t5 no_exist5 no_exist2)
@@ -5319,3 +5426,2436 @@ error hint:
    Filter: (id = 1)
 (2 rows)
 
+-- outer inner
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+Leading((t1))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+INFO:  hint syntax error at or near "Leading((t1))"
+DETAIL:  Leading hint requires two sets of relations when parentheses nests.
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+duplication hint:
+error hint:
+Leading((t1))
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+Leading((t1 t2))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 t2))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+/*+Leading((t1 t2 t3))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+INFO:  hint syntax error at or near "Leading((t1 t2 t3))"
+DETAIL:  Leading hint requires two sets of relations when parentheses nests.
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+duplication hint:
+error hint:
+Leading((t1 t2 t3))
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
+                 QUERY PLAN                 
+--------------------------------------------
+ Hash Join
+   Hash Cond: (t2.id = t1.id)
+   ->  Seq Scan on t2
+   ->  Hash
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+(6 rows)
+
+/*+Leading((t1 t2))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 t2))
+not used hint:
+duplication hint:
+error hint:
+
+              QUERY PLAN              
+--------------------------------------
+ Hash Join
+   Hash Cond: (t1.id = t2.id)
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (id < 10)
+   ->  Hash
+         ->  Seq Scan on t2
+(6 rows)
+
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+Leading(((t1 t2) t3))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+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;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Nested Loop
+   ->  Merge Join
+         Merge Cond: (t3.id = t4.id)
+         ->  Nested Loop
+               Join Filter: (t1.val = t3.val)
+               ->  Index Scan using t3_pkey on t3
+               ->  Materialize
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+   ->  Index Scan using t2_pkey on t2
+         Index Cond: (id = t1.id)
+(14 rows)
+
+/*+Leading((((t1 t2) t3) t4))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading((((t1 t2) t3) t4))
+not used hint:
+duplication hint:
+error hint:
+
+                    QUERY PLAN                    
+--------------------------------------------------
+ Nested Loop
+   ->  Nested Loop
+         Join Filter: (t1.val = t3.val)
+         ->  Hash Join
+               Hash Cond: (t1.id = t2.id)
+               ->  Index Scan using t1_pkey on t1
+                     Index Cond: (id < 10)
+               ->  Hash
+                     ->  Seq Scan on t2
+         ->  Seq Scan on t3
+   ->  Index Scan using t4_pkey on t4
+         Index Cond: (id = t3.id)
+(12 rows)
+
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+Leading(((t1 t2) t3))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+/*+Leading((t1 (t2 t3)))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 (t2 t3)))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Hash Join
+   Hash Cond: (t1.id = t2.id)
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (id < 10)
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.val = t3.val)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Seq Scan on t3
+(10 rows)
+
+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;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Nested Loop
+   ->  Merge Join
+         Merge Cond: (t3.id = t4.id)
+         ->  Nested Loop
+               Join Filter: (t1.val = t3.val)
+               ->  Index Scan using t3_pkey on t3
+               ->  Materialize
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+   ->  Index Scan using t2_pkey on t2
+         Index Cond: (id = t1.id)
+(14 rows)
+
+/*+Leading(((t1 t2) (t3 t4)))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) (t3 t4)))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t1.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Merge Join
+         Merge Cond: (t3.id = t4.id)
+         ->  Index Scan using t3_pkey on t3
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+(14 rows)
+
+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);
+                          QUERY PLAN                           
+---------------------------------------------------------------
+ Hash Join
+   Hash Cond: (t2.val = t3.val)
+   InitPlan 1 (returns $1)
+     ->  Limit
+           ->  Sort
+                 Sort Key: t1_2.id
+                 ->  Nested Loop
+                       ->  Index Scan using t2_val on t2 t2_2
+                             Index Cond: (val > 100)
+                       ->  Index Scan using t1_pkey on t1 t1_2
+                             Index Cond: (id = t2_2.id)
+   ->  Merge Join
+         Merge Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < $1)
+         ->  Index Scan using t2_pkey on t2
+   ->  Hash
+         ->  Seq Scan on t3
+(18 rows)
+
+/*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
+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);
+INFO:  hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
+DETAIL:  Conflict leading hint.
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t3 t1) t2))
+not used hint:
+duplication hint:
+Leading(((t1 t2) t3))
+error hint:
+
+                          QUERY PLAN                           
+---------------------------------------------------------------
+ Hash Join
+   Hash Cond: (t1.id = t2.id)
+   InitPlan 1 (returns $1)
+     ->  Limit
+           ->  Sort
+                 Sort Key: t1_2.id
+                 ->  Nested Loop
+                       ->  Index Scan using t2_val on t2 t2_2
+                             Index Cond: (val > 100)
+                       ->  Index Scan using t1_pkey on t1 t1_2
+                             Index Cond: (id = t2_2.id)
+   ->  Hash Join
+         Hash Cond: (t3.val = t1.val)
+         ->  Seq Scan on t3
+         ->  Hash
+               ->  Index Scan using t1_pkey on t1
+                     Index Cond: (id < $1)
+   ->  Hash
+         ->  Seq Scan on t2
+(19 rows)
+
+/*+Leading(((t1 t2) t3)) Leading((t1_2 t2_2))*/
+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);
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+Leading((t1_2 t2_2))
+not used hint:
+duplication hint:
+error hint:
+
+                          QUERY PLAN                          
+--------------------------------------------------------------
+ Hash Join
+   Hash Cond: (t2.val = t3.val)
+   InitPlan 1 (returns $0)
+     ->  Limit
+           ->  Merge Join
+                 Merge Cond: (t1_2.id = t2_2.id)
+                 ->  Index Scan using t1_pkey on t1 t1_2
+                 ->  Sort
+                       Sort Key: t2_2.id
+                       ->  Index Scan using t2_val on t2 t2_2
+                             Index Cond: (val > 100)
+   ->  Merge Join
+         Merge Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < $0)
+         ->  Index Scan using t2_pkey on t2
+   ->  Hash
+         ->  Seq Scan on t3
+(18 rows)
+
+/*+Leading(((((t1 t2) t3) t1_2) t2_2))*/
+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);
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+Leading(((((t1 t2) t3) t1_2) t2_2))
+duplication hint:
+error hint:
+
+                          QUERY PLAN                           
+---------------------------------------------------------------
+ Hash Join
+   Hash Cond: (t2.val = t3.val)
+   InitPlan 1 (returns $1)
+     ->  Limit
+           ->  Sort
+                 Sort Key: t1_2.id
+                 ->  Nested Loop
+                       ->  Index Scan using t2_val on t2 t2_2
+                             Index Cond: (val > 100)
+                       ->  Index Scan using t1_pkey on t1 t1_2
+                             Index Cond: (id = t2_2.id)
+   ->  Merge Join
+         Merge Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < $1)
+         ->  Index Scan using t2_pkey on t2
+   ->  Hash
+         ->  Seq Scan on t3
+(18 rows)
+
+-- Specified outer/inner leading hint and join method hint at the same time
+/*+Leading(((t1 t2) t3))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2)*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+MergeJoin(t1 t2)
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Merge Join
+         Merge Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Index Scan using t2_pkey on t2
+   ->  Seq Scan on t3
+(8 rows)
+
+/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3)*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+MergeJoin(t1 t2 t3)
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                    QUERY PLAN                    
+--------------------------------------------------
+ Merge Join
+   Merge Cond: (t2.val = t3.val)
+   ->  Sort
+         Sort Key: t2.val
+         ->  Hash Join
+               Hash Cond: (t1.id = t2.id)
+               ->  Index Scan using t1_pkey on t1
+                     Index Cond: (id < 10)
+               ->  Hash
+                     ->  Seq Scan on t2
+   ->  Sort
+         Sort Key: t3.val
+         ->  Seq Scan on t3
+(13 rows)
+
+/*+Leading(((t1 t2) t3)) MergeJoin(t1 t3)*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+MergeJoin(t1 t3)
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+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;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Nested Loop
+   ->  Merge Join
+         Merge Cond: (t3.id = t4.id)
+         ->  Nested Loop
+               Join Filter: (t1.val = t3.val)
+               ->  Index Scan using t3_pkey on t3
+               ->  Materialize
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+   ->  Index Scan using t2_pkey on t2
+         Index Cond: (id = t1.id)
+(14 rows)
+
+/*+Leading(((t1 t2) t3)) MergeJoin(t3 t4)*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+MergeJoin(t3 t4)
+duplication hint:
+error hint:
+
+                    QUERY PLAN                    
+--------------------------------------------------
+ Nested Loop
+   ->  Nested Loop
+         Join Filter: (t1.val = t3.val)
+         ->  Hash Join
+               Hash Cond: (t1.id = t2.id)
+               ->  Index Scan using t1_pkey on t1
+                     Index Cond: (id < 10)
+               ->  Hash
+                     ->  Seq Scan on t2
+         ->  Seq Scan on t3
+   ->  Index Scan using t4_pkey on t4
+         Index Cond: (id = t3.id)
+(12 rows)
+
+/*+Leading(((t1 t2) t3)) MergeJoin(t1 t2 t3 t4)*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+MergeJoin(t1 t2 t3 t4)
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Merge Join
+   Merge Cond: (t3.id = t4.id)
+   ->  Sort
+         Sort Key: t3.id
+         ->  Nested Loop
+               Join Filter: (t1.val = t3.val)
+               ->  Hash Join
+                     Hash Cond: (t1.id = t2.id)
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+                     ->  Hash
+                           ->  Seq Scan on t2
+               ->  Seq Scan on t3
+   ->  Sort
+         Sort Key: t4.id
+         ->  Seq Scan on t4
+(16 rows)
+
+/*+ Leading ( ( t1 ( t2 t3 ) ) ) */
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 (t2 t3)))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Hash Join
+   Hash Cond: (t1.id = t2.id)
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (id < 10)
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.val = t3.val)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Seq Scan on t3
+(10 rows)
+
+/*+Leading((t1(t2 t3)))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 (t2 t3)))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Hash Join
+   Hash Cond: (t1.id = t2.id)
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (id < 10)
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.val = t3.val)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Seq Scan on t3
+(10 rows)
+
+/*+Leading(("t1(t2" "t3)"))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+Leading(("t1(t2" "t3)"))
+duplication hint:
+error hint:
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+ Leading ( ( ( t1 t2 ) t3 ) ) */
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+/*+Leading(((t1 t2)t3))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) t3))
+not used hint:
+duplication hint:
+error hint:
+
+                 QUERY PLAN                 
+--------------------------------------------
+ Nested Loop
+   Join Filter: (t2.val = t3.val)
+   ->  Hash Join
+         Hash Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+               Index Cond: (id < 10)
+         ->  Hash
+               ->  Seq Scan on t2
+   ->  Seq Scan on t3
+(9 rows)
+
+/*+Leading(("(t1" "t2)t3"))*/
+EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
+LOG:  pg_hint_plan:
+used hint:
+not used hint:
+Leading(("(t1" "t2)t3"))
+duplication hint:
+error hint:
+
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Hash Join
+   Hash Cond: (t3.val = t2.val)
+   ->  Seq Scan on t3
+   ->  Hash
+         ->  Hash Join
+               Hash Cond: (t2.id = t1.id)
+               ->  Seq Scan on t2
+               ->  Hash
+                     ->  Index Scan using t1_pkey on t1
+                           Index Cond: (id < 10)
+(10 rows)
+
+/*+Leading((t1(t2(t3(t4 t5)))))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t1 (t2 (t3 (t4 t5)))))
+not used hint:
+duplication hint:
+error hint:
+
+                                                            QUERY PLAN                                                            
+----------------------------------------------------------------------------------------------------------------------------------
+ Merge Join
+   Merge Cond: (t1.id = t2.id)
+   ->  Index Scan using t1_pkey on t1
+   ->  Materialize
+         ->  Merge Join
+               Merge Cond: (t2.id = t3.id)
+               ->  Index Scan using t2_pkey on t2
+               ->  Materialize
+                     ->  Merge Join
+                           Merge Cond: (t3.id = t4.id)
+                           ->  Index Scan using t3_pkey on t3
+                           ->  Materialize
+                                 ->  Merge Join
+                                       Merge Cond: (t4.id = t5.id)
+                                       ->  Index Scan using t4_pkey on t4
+                                       ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+(16 rows)
+
+/*+Leading((t5(t4(t3(t2 t1)))))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading((t5 (t4 (t3 (t2 t1)))))
+not used hint:
+duplication hint:
+error hint:
+
+                                QUERY PLAN                                
+--------------------------------------------------------------------------
+ Hash Join
+   Hash Cond: (t5.id = t1.id)
+   ->  Seq Scan on t5
+   ->  Hash
+         ->  Merge Join
+               Merge Cond: (t4.id = t1.id)
+               ->  Sort
+                     Sort Key: t4.id
+                     ->  Seq Scan on t4
+               ->  Materialize
+                     ->  Merge Join
+                           Merge Cond: (t3.id = t1.id)
+                           ->  Sort
+                                 Sort Key: t3.id
+                                 ->  Seq Scan on t3
+                           ->  Materialize
+                                 ->  Merge Join
+                                       Merge Cond: (t2.id = t1.id)
+                                       ->  Index Scan using t2_pkey on t2
+                                       ->  Index Scan using t1_pkey on t1
+(20 rows)
+
+/*+Leading(((((t1 t2)t3)t4)t5))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((((t1 t2) t3) t4) t5))
+not used hint:
+duplication hint:
+error hint:
+
+                                          QUERY PLAN                                          
+----------------------------------------------------------------------------------------------
+ Nested Loop
+   ->  Merge Join
+         Merge Cond: (t1.id = t4.id)
+         ->  Merge Join
+               Merge Cond: (t1.id = t3.id)
+               ->  Merge Join
+                     Merge Cond: (t1.id = t2.id)
+                     ->  Index Scan using t1_pkey on t1
+                     ->  Index Scan using t2_pkey on t2
+               ->  Index Scan using t3_pkey on t3
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+   ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+         Index Cond: (id = t1.id)
+(15 rows)
+
+/*+Leading(((((t5 t4)t3)t2)t1))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((((t5 t4) t3) t2) t1))
+not used hint:
+duplication hint:
+error hint:
+
+                                                   QUERY PLAN                                                   
+----------------------------------------------------------------------------------------------------------------
+ Nested Loop
+   ->  Merge Join
+         Merge Cond: (t3.id = t2.id)
+         ->  Merge Join
+               Merge Cond: (t4.id = t3.id)
+               ->  Merge Join
+                     Merge Cond: (t5.id = t4.id)
+                     ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+                     ->  Sort
+                           Sort Key: t4.id
+                           ->  Seq Scan on t4
+               ->  Index Scan using t3_pkey on t3
+         ->  Index Scan using t2_pkey on t2
+   ->  Index Scan using t1_pkey on t1
+         Index Cond: (id = t2.id)
+(15 rows)
+
+/*+Leading(((t1 t2)(t3(t4 t5))))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t1 t2) (t3 (t4 t5))))
+not used hint:
+duplication hint:
+error hint:
+
+                                                      QUERY PLAN                                                      
+----------------------------------------------------------------------------------------------------------------------
+ Merge Join
+   Merge Cond: (t1.id = t3.id)
+   ->  Merge Join
+         Merge Cond: (t1.id = t2.id)
+         ->  Index Scan using t1_pkey on t1
+         ->  Index Scan using t2_pkey on t2
+   ->  Materialize
+         ->  Merge Join
+               Merge Cond: (t3.id = t4.id)
+               ->  Index Scan using t3_pkey on t3
+               ->  Materialize
+                     ->  Merge Join
+                           Merge Cond: (t4.id = t5.id)
+                           ->  Index Scan using t4_pkey on t4
+                           ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+(15 rows)
+
+/*+Leading(((t5 t4)(t3(t2 t1))))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading(((t5 t4) (t3 (t2 t1))))
+not used hint:
+duplication hint:
+error hint:
+
+                                             QUERY PLAN                                             
+----------------------------------------------------------------------------------------------------
+ Merge Join
+   Merge Cond: (t4.id = t1.id)
+   ->  Merge Join
+         Merge Cond: (t5.id = t4.id)
+         ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+         ->  Sort
+               Sort Key: t4.id
+               ->  Seq Scan on t4
+   ->  Materialize
+         ->  Merge Join
+               Merge Cond: (t3.id = t1.id)
+               ->  Index Scan using t3_pkey on t3
+               ->  Materialize
+                     ->  Merge Join
+                           Merge Cond: (t2.id = t1.id)
+                           ->  Index Scan using t2_pkey on t2
+                           ->  Index Scan using t1_pkey on t1
+(17 rows)
+
+/*+Leading((((t1 t2)t3)(t4 t5)))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading((((t1 t2) t3) (t4 t5)))
+not used hint:
+duplication hint:
+error hint:
+
+                                                QUERY PLAN                                                
+----------------------------------------------------------------------------------------------------------
+ Merge Join
+   Merge Cond: (t1.id = t4.id)
+   ->  Merge Join
+         Merge Cond: (t1.id = t3.id)
+         ->  Merge Join
+               Merge Cond: (t1.id = t2.id)
+               ->  Index Scan using t1_pkey on t1
+               ->  Index Scan using t2_pkey on t2
+         ->  Index Scan using t3_pkey on t3
+   ->  Materialize
+         ->  Merge Join
+               Merge Cond: (t4.id = t5.id)
+               ->  Index Scan using t4_pkey on t4
+               ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+(14 rows)
+
+/*+Leading((((t5 t4)t3)(t2 t1)))*/
+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;
+LOG:  pg_hint_plan:
+used hint:
+Leading((((t5 t4) t3) (t2 t1)))
+not used hint:
+duplication hint:
+error hint:
+
+                                                QUERY PLAN                                                
+----------------------------------------------------------------------------------------------------------
+ Merge Join
+   Merge Cond: (t3.id = t1.id)
+   ->  Merge Join
+         Merge Cond: (t4.id = t3.id)
+         ->  Merge Join
+               Merge Cond: (t5.id = t4.id)
+               ->  Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+               ->  Sort
+                     Sort Key: t4.id
+                     ->  Seq Scan on t4
+         ->  Index Scan using t3_pkey on t3
+   ->  Materialize
+         ->  Merge Join
+               Merge Cond: (t2.id = t1.id)
+               ->  Index Scan using t2_pkey on t2
+               ->  Index Scan using t1_pkey on t1
+(16 rows)
+
+-- inherite table test to specify the index's name
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(12 rows)
+
+/*+IndexScan(p2 p2_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_pkey on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_id_val_idx)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_id_val_idx
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_id_val_idx
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_id_val_idx
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_id_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_id_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_id_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_id_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_id_val_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_id_val_idx)
+not used hint:
+duplication hint:
+error hint:
+
+                           QUERY PLAN                            
+-----------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_id_val_idx on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_id_val_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_id_val_idx on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_id_val_idx on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_val_id_idx)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_val_id_idx
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_id_idx
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_id_idx
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_id_idx
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_id_idx
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_id_idx
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_id_idx
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_id_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val_id_idx)
+not used hint:
+duplication hint:
+error hint:
+
+                           QUERY PLAN                            
+-----------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_val_id_idx on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_val_id_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_val_id_idx on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_val_id_idx on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+                                          QUERY PLAN                                           
+-----------------------------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c2 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c3 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c4 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+(25 rows)
+
+/*+IndexScan(p2 p2_val)*/
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2):
+LOG:  available indexes for IndexScan(p2_c1):
+LOG:  available indexes for IndexScan(p2_c2):
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val)
+not used hint:
+duplication hint:
+error hint:
+
+                                          QUERY PLAN                                           
+-----------------------------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c2 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c3 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c4 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+(25 rows)
+
+/*+IndexScan(p2 p2_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_pkey on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_id2_val)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_id2_val
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id2_val
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_id2_val
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_id2_val)
+not used hint:
+duplication hint:
+error hint:
+
+                                     QUERY PLAN                                      
+-------------------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_id2_val on p2
+               Index Cond: ((id >= 50) AND (id <= 51) AND (id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_id2_val on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51) AND (id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(14 rows)
+
+/*+IndexScan(p2 p2_val2_id)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_val2_id
+LOG:  available indexes for IndexScan(p2_c1):
+LOG:  available indexes for IndexScan(p2_c2):
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val2_id)
+not used hint:
+duplication hint:
+error hint:
+
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_val2_id on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(13 rows)
+
+/*+IndexScan(p2 p2_pkey)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_pkey on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_c1_id_val_idx)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2):
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
+LOG:  available indexes for IndexScan(p2_c2):
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_c1_id_val_idx)
+not used hint:
+duplication hint:
+error hint:
+
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Index Scan using p2_c1_id_val_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(13 rows)
+
+/*+IndexScan(p2 no_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2):
+LOG:  available indexes for IndexScan(p2_c1):
+LOG:  available indexes for IndexScan(p2_c2):
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 no_exist)
+not used hint:
+duplication hint:
+error hint:
+
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(12 rows)
+
+/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey p2_c1_id_val_idx)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_id_val_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_pkey no_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey no_exist)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_pkey on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_c1_id_val_idx no_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2):
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx
+LOG:  available indexes for IndexScan(p2_c2):
+LOG:  available indexes for IndexScan(p2_c3):
+LOG:  available indexes for IndexScan(p2_c4):
+LOG:  available indexes for IndexScan(p2_c1_c1):
+LOG:  available indexes for IndexScan(p2_c1_c2):
+LOG:  available indexes for IndexScan(p2_c3_c1):
+LOG:  available indexes for IndexScan(p2_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_c1_id_val_idx no_exist)
+not used hint:
+duplication hint:
+error hint:
+
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+         ->  Index Scan using p2_c1_id_val_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((id >= 50) AND (id <= 51))
+(13 rows)
+
+/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
+EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_pkey
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_id_val_idx p2_c1_pkey
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_pkey
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_pkey
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_pkey
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_pkey
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_pkey
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_pkey on p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_id_val_idx on p2_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_pkey on p2_c1_c1 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_pkey on p2_c1_c2 p2
+               Index Cond: ((id >= 50) AND (id <= 51))
+               Filter: (ctid = '(1,1)'::tid)
+(14 rows)
+
+/*+IndexScan(p2 p2_val_idx)*/
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_val_idx
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val_idx)
+not used hint:
+duplication hint:
+error hint:
+
+                               QUERY PLAN                                
+-------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_val_idx on p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_val_idx on p2_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c2_val_idx on p2_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_val_idx on p2_c3 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c4_val_idx on p2_c4 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+(29 rows)
+
+/*+IndexScan(p2 p2_expr)*/
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_expr
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_expr_idx
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_expr_idx
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_expr_idx
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_expr_idx
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_expr_idx
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_expr_idx
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_expr_idx
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_expr_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_expr)
+not used hint:
+duplication hint:
+error hint:
+
+                                          QUERY PLAN                                           
+-----------------------------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c2 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c3 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c4 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+(25 rows)
+
+/*+IndexScan(p2 p2_val_idx6)*/
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_val_idx6
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val_idx6)
+not used hint:
+duplication hint:
+error hint:
+
+                                          QUERY PLAN                                           
+-----------------------------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c1 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c2 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Seq Scan on p2_c3 p2
+               Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+         ->  Tid Scan on p2_c4 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c1_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c1 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+         ->  Tid Scan on p2_c3_c2 p2
+               TID Cond: (ctid = '(1,1)'::tid)
+               Filter: ((val >= '50'::text) AND (val <= '51'::text))
+(25 rows)
+
+/*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
+EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
+LOG:  available indexes for IndexScan(p2): p2_val_idx6 p2_val_idx
+LOG:  available indexes for IndexScan(p2_c1): p2_c1_val_idx6 p2_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c2): p2_c2_val_idx6 p2_c2_val_idx
+LOG:  available indexes for IndexScan(p2_c3): p2_c3_val_idx6 p2_c3_val_idx
+LOG:  available indexes for IndexScan(p2_c4): p2_c4_val_idx6 p2_c4_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c1): p2_c1_c1_val_idx6 p2_c1_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c1_c2): p2_c1_c2_val_idx6 p2_c1_c2_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c1): p2_c3_c1_val_idx6 p2_c3_c1_val_idx
+LOG:  available indexes for IndexScan(p2_c3_c2): p2_c3_c2_val_idx6 p2_c3_c2_val_idx
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p2 p2_val_idx p2_val_idx6)
+not used hint:
+duplication hint:
+error hint:
+
+                               QUERY PLAN                                
+-------------------------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p2_val_idx on p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_val_idx on p2_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c2_val_idx on p2_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_val_idx on p2_c3 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c4_val_idx on p2_c4 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c1_val_idx on p2_c1_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c1_c2_val_idx on p2_c1_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_c1_val_idx on p2_c3_c1 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+         ->  Index Scan using p2_c3_c2_val_idx on p2_c3_c2 p2
+               Index Cond: ((val >= '50'::text) AND (val <= '51'::text))
+               Filter: (ctid = '(1,1)'::tid)
+(29 rows)
+
+-- regular expression
+-- ordinary table
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexScanRegexp(t5 t5_[^i].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for IndexScanRegexp(t5): t5_val t5_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(t5 t5_[^i].*)
+not used hint:
+duplication hint:
+error hint:
+
+           QUERY PLAN           
+--------------------------------
+ Index Scan using t5_pkey on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexScanRegexp(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for IndexScanRegexp(t5): t5_id3 t5_id2 t5_id1
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(t5 t5_id[0-9].*)
+not used hint:
+duplication hint:
+error hint:
+
+          QUERY PLAN           
+-------------------------------
+ Index Scan using t5_id3 on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexScanRegexp(t5 t5[^_].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for IndexScanRegexp(t5):
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(t5 t5[^_].*)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+/*+ IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for IndexScanRegexp(t5):
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+/*+ IndexScan(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for IndexScan(t5):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(t5 t5_id[0-9].*)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+/*+ IndexOnlyScanRegexp(t5 t5_[^i].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(t5 t5_[^i].*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexOnlyScanRegexp(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(t5 t5_id[0-9].*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexOnlyScanRegexp(t5 t5[^_].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(t5 t5[^_].*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ IndexOnlyScan(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+INFO:  hint syntax error at or near "IndexOnlyScan(t5 t5_id[0-9].*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
+                                       QUERY PLAN                                       
+----------------------------------------------------------------------------------------
+ Index Scan using t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on t5
+   Index Cond: (id = 1)
+(2 rows)
+
+/*+ BitmapScanRegexp(t5 t5_[^i].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for BitmapScanRegexp(t5): t5_val t5_pkey
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(t5 t5_[^i].*)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN             
+------------------------------------
+ Bitmap Heap Scan on t5
+   Recheck Cond: (id = 1)
+   ->  Bitmap Index Scan on t5_pkey
+         Index Cond: (id = 1)
+(4 rows)
+
+/*+ BitmapScanRegexp(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for BitmapScanRegexp(t5): t5_id3 t5_id2 t5_id1
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(t5 t5_id[0-9].*)
+not used hint:
+duplication hint:
+error hint:
+
+            QUERY PLAN             
+-----------------------------------
+ Bitmap Heap Scan on t5
+   Recheck Cond: (id = 1)
+   ->  Bitmap Index Scan on t5_id3
+         Index Cond: (id = 1)
+(4 rows)
+
+/*+ BitmapScanRegexp(t5 t5[^_].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for BitmapScanRegexp(t5):
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(t5 t5[^_].*)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+/*+ BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for BitmapScanRegexp(t5):
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(t5 ^.*t5_idaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+/*+ BitmapScan(t5 t5_id[0-9].*)*/
+EXPLAIN (COSTS false) SELECT id FROM t5 WHERE id = 1;
+LOG:  available indexes for BitmapScan(t5):
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(t5 t5_id[0-9].*)
+not used hint:
+duplication hint:
+error hint:
+
+     QUERY PLAN     
+--------------------
+ Seq Scan on t5
+   Filter: (id = 1)
+(2 rows)
+
+-- Inheritance
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexScanRegexp(p1 p1_.*[^0-9]$)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for IndexScanRegexp(p1): p1_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_pkey
+LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 p1_.*[^0-9]$)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexScanRegexp(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for IndexScanRegexp(p1): p1_val2
+LOG:  available indexes for IndexScanRegexp(p1_c1): p1_c1_val2
+LOG:  available indexes for IndexScanRegexp(p1_c2): p1_c2_val2
+LOG:  available indexes for IndexScanRegexp(p1_c3): p1_c3_val2
+LOG:  available indexes for IndexScanRegexp(p1_c4): p1_c4_val2
+LOG:  available indexes for IndexScanRegexp(p1_c1_c1): p1_c1_c1_val2
+LOG:  available indexes for IndexScanRegexp(p1_c1_c2): p1_c1_c2_val2
+LOG:  available indexes for IndexScanRegexp(p1_c3_c1): p1_c3_c1_val2
+LOG:  available indexes for IndexScanRegexp(p1_c3_c2): p1_c3_c2_val2
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 p1_.*val2.*)
+not used hint:
+duplication hint:
+error hint:
+
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Result
+   ->  Append
+         ->  Index Scan using p1_val2 on p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c1_val2 on p1_c1 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c2_val2 on p1_c2 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c3_val2 on p1_c3 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c4_val2 on p1_c4 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c1_c1_val2 on p1_c1_c1 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c1_c2_val2 on p1_c1_c2 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c3_c1_val2 on p1_c3_c1 p1
+               Index Cond: (val = 1)
+         ->  Index Scan using p1_c3_c2_val2 on p1_c3_c2 p1
+               Index Cond: (val = 1)
+(20 rows)
+
+/*+ IndexScanRegexp(p1 p1[^_].*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for IndexScanRegexp(p1):
+LOG:  available indexes for IndexScanRegexp(p1_c1):
+LOG:  available indexes for IndexScanRegexp(p1_c2):
+LOG:  available indexes for IndexScanRegexp(p1_c3):
+LOG:  available indexes for IndexScanRegexp(p1_c4):
+LOG:  available indexes for IndexScanRegexp(p1_c1_c1):
+LOG:  available indexes for IndexScanRegexp(p1_c1_c2):
+LOG:  available indexes for IndexScanRegexp(p1_c3_c1):
+LOG:  available indexes for IndexScanRegexp(p1_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScanRegexp(p1 p1[^_].*)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexScan(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for IndexScan(p1):
+LOG:  available indexes for IndexScan(p1_c1):
+LOG:  available indexes for IndexScan(p1_c2):
+LOG:  available indexes for IndexScan(p1_c3):
+LOG:  available indexes for IndexScan(p1_c4):
+LOG:  available indexes for IndexScan(p1_c1_c1):
+LOG:  available indexes for IndexScan(p1_c1_c2):
+LOG:  available indexes for IndexScan(p1_c3_c1):
+LOG:  available indexes for IndexScan(p1_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+IndexScan(p1 p1_.*val2.*)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(p1 p1_.*[^0-9]$)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexOnlyScanRegexp(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(p1 p1_.*val2.*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexOnlyScanRegexp(p1 p1[^_].*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+INFO:  hint syntax error at or near "IndexOnlyScanRegexp(p1 p1[^_].*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScanRegexp".
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ IndexOnlyScan(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+INFO:  hint syntax error at or near "IndexOnlyScan(p1 p1_.*val2.*)"
+DETAIL:  Unrecognized hint keyword "IndexOnlyScan".
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ BitmapScanRegexp(p1 p1_.*[^0-9]$)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for BitmapScanRegexp(p1): p1_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_pkey
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_pkey
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(p1 p1_.*[^0-9]$)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ BitmapScanRegexp(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for BitmapScanRegexp(p1): p1_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c1): p1_c1_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c2): p1_c2_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c3): p1_c3_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c4): p1_c4_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c1): p1_c1_c1_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c2): p1_c1_c2_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c1): p1_c3_c1_val2
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c2): p1_c3_c2_val2
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(p1 p1_.*val2.*)
+not used hint:
+duplication hint:
+error hint:
+
+                      QUERY PLAN                      
+------------------------------------------------------
+ Result
+   ->  Append
+         ->  Bitmap Heap Scan on p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c1 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c1_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c2 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c2_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c3 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c3_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c4 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c4_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c1_c1 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c1_c1_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c1_c2 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c1_c2_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c3_c1 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c3_c1_val2
+                     Index Cond: (val = 1)
+         ->  Bitmap Heap Scan on p1_c3_c2 p1
+               Recheck Cond: (val = 1)
+               ->  Bitmap Index Scan on p1_c3_c2_val2
+                     Index Cond: (val = 1)
+(38 rows)
+
+/*+ BitmapScanRegexp(p1 p1[^_].*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for BitmapScanRegexp(p1):
+LOG:  available indexes for BitmapScanRegexp(p1_c1):
+LOG:  available indexes for BitmapScanRegexp(p1_c2):
+LOG:  available indexes for BitmapScanRegexp(p1_c3):
+LOG:  available indexes for BitmapScanRegexp(p1_c4):
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c1):
+LOG:  available indexes for BitmapScanRegexp(p1_c1_c2):
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c1):
+LOG:  available indexes for BitmapScanRegexp(p1_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+BitmapScanRegexp(p1 p1[^_].*)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+
+/*+ BitmapScan(p1 p1_.*val2.*)*/
+EXPLAIN (COSTS false) SELECT val FROM p1 WHERE val = 1;
+LOG:  available indexes for BitmapScan(p1):
+LOG:  available indexes for BitmapScan(p1_c1):
+LOG:  available indexes for BitmapScan(p1_c2):
+LOG:  available indexes for BitmapScan(p1_c3):
+LOG:  available indexes for BitmapScan(p1_c4):
+LOG:  available indexes for BitmapScan(p1_c1_c1):
+LOG:  available indexes for BitmapScan(p1_c1_c2):
+LOG:  available indexes for BitmapScan(p1_c3_c1):
+LOG:  available indexes for BitmapScan(p1_c3_c2):
+LOG:  pg_hint_plan:
+used hint:
+BitmapScan(p1 p1_.*val2.*)
+not used hint:
+duplication hint:
+error hint:
+
+             QUERY PLAN              
+-------------------------------------
+ Result
+   ->  Append
+         ->  Seq Scan on p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c4 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c1_c2 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c1 p1
+               Filter: (val = 1)
+         ->  Seq Scan on p1_c3_c2 p1
+               Filter: (val = 1)
+(20 rows)
+