OSDN Git Service

Support DECLARE CURSOR syntax and added regression for table hinting.
[pghintplan/pg_hint_plan.git] / expected / ut-R.out
index 38d8c46..ef525ca 100644 (file)
@@ -15,7 +15,7 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-1-1 specified pattern of the object name
@@ -41,7 +41,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-1-2
 \o results/ut-R.tmpout
@@ -64,7 +64,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t_2.c1
          ->  Seq Scan on t2 t_2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-1-3
 \o results/ut-R.tmpout
@@ -87,7 +87,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t_2.c1
          ->  Seq Scan on t2 t_2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-1-2 specified schema name in the hint option
@@ -113,7 +113,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-2-2
 \o results/ut-R.tmpout
@@ -136,7 +136,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-1-3 table doesn't exist in the hint option
@@ -162,7 +162,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-3-2
 \o results/ut-R.tmpout
@@ -185,7 +185,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-1-4 conflict table name
@@ -211,7 +211,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-4-2
 \o results/ut-R.tmpout
@@ -226,12 +226,12 @@ EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t1_1.c1
          ->  Seq Scan on t1 t1_1  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
-INFO:  hint syntax error at or near "Rows(t1 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t1 #1)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -250,7 +250,7 @@ Rows(t1 t1 #1)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t1_1.c1
          ->  Seq Scan on t1 t1_1  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(s1.t1 s2.t1 #1)*/
@@ -272,7 +272,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t1_1.c1
          ->  Seq Scan on t1 t1_1  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
@@ -286,7 +286,7 @@ EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: s2t1.c1
          ->  Seq Scan on t1 s2t1  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 s2t1 #1)*/
@@ -308,7 +308,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: s2t1.c1
          ->  Seq Scan on t1 s2t1  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-4-3
 \o results/ut-R.tmpout
@@ -331,7 +331,7 @@ EXPLAIN SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -361,7 +361,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(st1 st2 #1)Rows(t1 t2 #1)*/
@@ -392,7 +392,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 ----
 ---- No. R-1-5 conflict table name
@@ -418,13 +418,13 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-5-2
 \o results/ut-R.tmpout
 /*+Rows(t1 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t1 #1)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -443,13 +443,13 @@ Rows(t1 t1 #1)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-5-3
 \o results/ut-R.tmpout
 /*+(t1 t1)(t2 t2)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "(t1 t1)(t2 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "(t1 t1)(t2 t2)"
 DETAIL:  Unrecognized hint keyword "".
 \o
 \! sql/maskout.sh results/ut-R.tmpout
@@ -461,7 +461,7 @@ DETAIL:  Unrecognized hint keyword "".
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
@@ -474,35 +474,34 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
    ->  Merge Join  (cost=xxx rows=1000 width=xxx)
          Merge Cond: (t1.c1 = t3.c1)
          ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1000 width=xxx)
-         ->  Index Scan using t3_i1 on t3  (cost=xxx rows=1100 width=xxx)
+         ->  Index Scan using t3_i1 on t3  (cost=xxx rows=1130 width=xxx)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(10 rows)
+(9 rows)
 
 \o results/ut-R.tmpout
 /*+(t1 t2 t1 t2)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "(t1 t2 t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "(t1 t2 t1 t2)"
 DETAIL:  Unrecognized hint keyword "".
 \o
 \! sql/maskout.sh results/ut-R.tmpout
                                       QUERY PLAN                                       
 ---------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=100 width=xxx)
-   Join Filter: (t1.c1 = t4.c1)
    ->  Merge Join  (cost=xxx rows=100 width=xxx)
          Merge Cond: (t1.c1 = t2.c1)
          ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                Merge Cond: (t1.c1 = t3.c1)
                ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1000 width=xxx)
-               ->  Index Scan using t3_i1 on t3  (cost=xxx rows=1100 width=xxx)
+               ->  Index Scan using t3_i1 on t3  (cost=xxx rows=1130 width=xxx)
          ->  Sort  (cost=xxx rows=100 width=xxx)
                Sort Key: t2.c1
                ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
    ->  Index Scan using t4_i1 on t4  (cost=xxx rows=1 width=xxx)
-         Index Cond: (c1 = t3.c1)
-(14 rows)
+         Index Cond: (c1 = t1.c1)
+(12 rows)
 
 ----
 ---- No. R-1-6 object type for the hint
@@ -528,7 +527,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-6-2
 \o results/ut-R.tmpout
@@ -550,7 +549,7 @@ EXPLAIN SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
                ->  Seq Scan on p1c1 t2_1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2 t2_2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3 t2_3  (cost=xxx rows=100 width=xxx)
-(14 rows)
+(13 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -579,7 +578,7 @@ error hint:
                ->  Seq Scan on p1c1 t2_1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2 t2_2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3 t2_3  (cost=xxx rows=100 width=xxx)
-(14 rows)
+(13 rows)
 
 -- No. R-1-6-3
 \o results/ut-R.tmpout
@@ -588,12 +587,12 @@ EXPLAIN SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
 \! sql/maskout.sh results/ut-R.tmpout
                               QUERY PLAN                               
 -----------------------------------------------------------------------
- Hash Join  (cost=xxx rows=1100 width=xxx)
+ Hash Join  (cost=xxx rows=1130 width=xxx)
    Hash Cond: (t1.c1 = t2.c1)
-   ->  Seq Scan on ul1 t1  (cost=xxx rows=1100 width=xxx)
-   ->  Hash  (cost=xxx rows=1100 width=xxx)
-         ->  Seq Scan on ul1 t2  (cost=xxx rows=1100 width=xxx)
-(6 rows)
+   ->  Seq Scan on ul1 t1  (cost=xxx rows=1130 width=xxx)
+   ->  Hash  (cost=xxx rows=1130 width=xxx)
+         ->  Seq Scan on ul1 t2  (cost=xxx rows=1130 width=xxx)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -611,10 +610,10 @@ error hint:
 -----------------------------------------------------------------------
  Hash Join  (cost=xxx rows=1 width=xxx)
    Hash Cond: (t1.c1 = t2.c1)
-   ->  Seq Scan on ul1 t1  (cost=xxx rows=1100 width=xxx)
-   ->  Hash  (cost=xxx rows=1100 width=xxx)
-         ->  Seq Scan on ul1 t2  (cost=xxx rows=1100 width=xxx)
-(6 rows)
+   ->  Seq Scan on ul1 t1  (cost=xxx rows=1130 width=xxx)
+   ->  Hash  (cost=xxx rows=1130 width=xxx)
+         ->  Seq Scan on ul1 t2  (cost=xxx rows=1130 width=xxx)
+(5 rows)
 
 -- No. R-1-6-4
 CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
@@ -624,12 +623,12 @@ EXPLAIN SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
 \! sql/maskout.sh results/ut-R.tmpout
                               QUERY PLAN                               
 -----------------------------------------------------------------------
- Hash Join  (cost=xxx rows=1100 width=xxx)
+ Hash Join  (cost=xxx rows=1130 width=xxx)
    Hash Cond: (t1.c1 = t2.c1)
-   ->  Seq Scan on tm1 t1  (cost=xxx rows=1100 width=xxx)
-   ->  Hash  (cost=xxx rows=1100 width=xxx)
-         ->  Seq Scan on tm1 t2  (cost=xxx rows=1100 width=xxx)
-(6 rows)
+   ->  Seq Scan on tm1 t1  (cost=xxx rows=1130 width=xxx)
+   ->  Hash  (cost=xxx rows=1130 width=xxx)
+         ->  Seq Scan on tm1 t2  (cost=xxx rows=1130 width=xxx)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -647,10 +646,10 @@ error hint:
 -----------------------------------------------------------------------
  Hash Join  (cost=xxx rows=1 width=xxx)
    Hash Cond: (t1.c1 = t2.c1)
-   ->  Seq Scan on tm1 t1  (cost=xxx rows=1100 width=xxx)
-   ->  Hash  (cost=xxx rows=1100 width=xxx)
-         ->  Seq Scan on tm1 t2  (cost=xxx rows=1100 width=xxx)
-(6 rows)
+   ->  Seq Scan on tm1 t1  (cost=xxx rows=1130 width=xxx)
+   ->  Hash  (cost=xxx rows=1130 width=xxx)
+         ->  Seq Scan on tm1 t2  (cost=xxx rows=1130 width=xxx)
+(5 rows)
 
 -- No. R-1-6-5
 CREATE TEMP TABLE t_pg_class WITH OIDS AS SELECT * from pg_class LIMIT 100;
@@ -660,12 +659,12 @@ EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
 \! sql/maskout.sh results/ut-R.tmpout
                                   QUERY PLAN                                  
 ------------------------------------------------------------------------------
- Hash Join  (cost=xxx rows=360 width=xxx)
+ Hash Join  (cost=xxx rows=310 width=xxx)
    Hash Cond: (t1.oid = t2.oid)
-   ->  Seq Scan on t_pg_class t1  (cost=xxx rows=360 width=xxx)
-   ->  Hash  (cost=xxx rows=360 width=xxx)
-         ->  Seq Scan on t_pg_class t2  (cost=xxx rows=360 width=xxx)
-(6 rows)
+   ->  Seq Scan on t_pg_class t1  (cost=xxx rows=310 width=xxx)
+   ->  Hash  (cost=xxx rows=310 width=xxx)
+         ->  Seq Scan on t_pg_class t2  (cost=xxx rows=310 width=xxx)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -683,10 +682,10 @@ error hint:
 ------------------------------------------------------------------------------
  Hash Join  (cost=xxx rows=1 width=xxx)
    Hash Cond: (t1.oid = t2.oid)
-   ->  Seq Scan on t_pg_class t1  (cost=xxx rows=360 width=xxx)
-   ->  Hash  (cost=xxx rows=360 width=xxx)
-         ->  Seq Scan on t_pg_class t2  (cost=xxx rows=360 width=xxx)
-(6 rows)
+   ->  Seq Scan on t_pg_class t1  (cost=xxx rows=310 width=xxx)
+   ->  Hash  (cost=xxx rows=310 width=xxx)
+         ->  Seq Scan on t_pg_class t2  (cost=xxx rows=310 width=xxx)
+(5 rows)
 
 -- No. R-1-6-6
 -- refer ut-fdw.sql
@@ -701,7 +700,7 @@ EXPLAIN SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
    Join Filter: (t1.c1 = t2.c1)
    ->  Function Scan on f1 t1  (cost=xxx rows=1 width=xxx)
    ->  Function Scan on f1 t2  (cost=xxx rows=1 width=xxx)
-(5 rows)
+(4 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -721,7 +720,7 @@ error hint:
    Join Filter: (t1.c1 = t2.c1)
    ->  Function Scan on f1 t1  (cost=xxx rows=1 width=xxx)
    ->  Function Scan on f1 t2  (cost=xxx rows=1 width=xxx)
-(5 rows)
+(4 rows)
 
 -- No. R-1-6-8
 \o results/ut-R.tmpout
@@ -735,7 +734,7 @@ EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c
    ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
    ->  Hash  (cost=xxx rows=3 width=xxx)
          ->  Values Scan on "*VALUES*"  (cost=xxx rows=3 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -756,7 +755,7 @@ error hint:
    ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
    ->  Hash  (cost=xxx rows=3 width=xxx)
          ->  Values Scan on "*VALUES*"  (cost=xxx rows=3 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(*VALUES* t2 #1)*/
@@ -777,7 +776,7 @@ error hint:
    ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
    ->  Hash  (cost=xxx rows=3 width=xxx)
          ->  Values Scan on "*VALUES*"  (cost=xxx rows=3 width=xxx)
-(6 rows)
+(5 rows)
 
 -- No. R-1-6-9
 \o results/ut-R.tmpout
@@ -798,7 +797,7 @@ EXPLAIN WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1)
    ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
    ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = c1.c1)
-(13 rows)
+(12 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)Rows(t1 c1 +1)*/
@@ -827,7 +826,7 @@ error hint:
    ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
    ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = c1.c1)
-(13 rows)
+(12 rows)
 
 -- No. R-1-6-10
 \o results/ut-R.tmpout
@@ -841,7 +840,7 @@ EXPLAIN SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 v1t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -862,7 +861,7 @@ error hint:
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 v1t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(v1t1 v1t1_ #1)*/
@@ -883,7 +882,7 @@ error hint:
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 v1t1_  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 -- No. R-1-6-11
 \o results/ut-R.tmpout
@@ -905,7 +904,7 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(s
          Index Cond: (c1 = $0)
    ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
          Filter: (c1 = $0)
-(14 rows)
+(13 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)Rows(st1 st2 #1)*/
@@ -935,7 +934,7 @@ error hint:
          Index Cond: (c1 = $0)
    ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
          Filter: (c1 = $0)
-(14 rows)
+(13 rows)
 
 --
 -- There are cases where difference in the measured value and predicted value
@@ -953,7 +952,7 @@ EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 st2 #1)*/
@@ -975,7 +974,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)*/
@@ -997,7 +996,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-1-7 specified number of conditions
@@ -1006,7 +1005,7 @@ error hint:
 \o results/ut-R.tmpout
 /*+Rows(t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Rows hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -1025,13 +1024,13 @@ Rows(t1 #1)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-7-2
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "1"
+INFO:  pg_hint_plan: hint syntax error at or near "1"
 DETAIL:  Unrecognized rows value type notation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1050,13 +1049,13 @@ Rows(t1 t2 1)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-1-7-3
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #notrows)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "notrows"
+INFO:  pg_hint_plan: hint syntax error at or near "notrows"
 DETAIL:  Rows hint requires valid number as rows estimation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1075,7 +1074,7 @@ Rows(t1 t2 #notrows)
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-2-1 some complexity query blocks
@@ -1127,11 +1126,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1142,19 +1141,18 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Merge Join  (cost=xxx rows=100 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1163,8 +1161,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(45 rows)
+               Index Cond: (c1 = bmt1.c1)
+(43 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1223,11 +1221,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1242,15 +1240,14 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1259,8 +1256,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(45 rows)
+               Index Cond: (c1 = bmt1.c1)
+(43 rows)
 
 -- No. R-2-1-2
 \o results/ut-R.tmpout
@@ -1317,11 +1314,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1332,10 +1329,10 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
@@ -1343,22 +1340,20 @@ error hint:
    InitPlan 3 (returns $5)
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Merge Join  (cost=xxx rows=100 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1367,8 +1362,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(59 rows)
+               Index Cond: (c1 = bmt1.c1)
+(56 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1440,11 +1435,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1459,29 +1454,27 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    InitPlan 3 (returns $5)
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1490,8 +1483,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(59 rows)
+               Index Cond: (c1 = bmt1.c1)
+(56 rows)
 
 -- No. R-2-1-3
 \o results/ut-R.tmpout
@@ -1518,14 +1511,14 @@ error hint:
                Sort Key: bmt2.c1
                ->  Hash Join  (cost=xxx rows=100 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt2.c1)
-                     ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+                     ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                            Hash Cond: (bmt3.c1 = bmt4.c1)
-                           ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                           ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                 ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                           ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                           ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                 ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=100 width=xxx)
                            ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
-(16 rows)
+(15 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1553,14 +1546,14 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                ->  Hash Join  (cost=xxx rows=1 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                     ->  Hash  (cost=xxx rows=1100 width=xxx)
-                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                     ->  Hash  (cost=xxx rows=1130 width=xxx)
+                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
          ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=1 width=xxx)
                Index Cond: (c1 = bmt3.c1)
-(14 rows)
+(13 rows)
 
 -- No. R-2-1-4
 \o results/ut-R.tmpout
@@ -1587,14 +1580,14 @@ error hint:
                Sort Key: bmt2.c1
                ->  Hash Join  (cost=xxx rows=100 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt2.c1)
-                     ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+                     ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                            Hash Cond: (bmt3.c1 = bmt4.c1)
-                           ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                           ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                 ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                           ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                           ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                 ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=100 width=xxx)
                            ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
-(16 rows)
+(15 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1622,14 +1615,14 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                ->  Hash Join  (cost=xxx rows=1 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                     ->  Hash  (cost=xxx rows=1100 width=xxx)
-                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                     ->  Hash  (cost=xxx rows=1130 width=xxx)
+                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
          ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=1 width=xxx)
                Index Cond: (c1 = bmt3.c1)
-(14 rows)
+(13 rows)
 
 -- No. R-2-1-5
 \o results/ut-R.tmpout
@@ -1677,11 +1670,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1692,19 +1685,18 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Merge Join  (cost=xxx rows=100 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1714,8 +1706,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(46 rows)
+               Index Cond: (c1 = bmt1.c1)
+(44 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1775,11 +1767,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1794,15 +1786,14 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1812,8 +1803,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(46 rows)
+               Index Cond: (c1 = bmt1.c1)
+(44 rows)
 
 -- No. R-2-1-6
 \o results/ut-R.tmpout
@@ -1870,11 +1861,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -1885,10 +1876,10 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
@@ -1896,22 +1887,20 @@ error hint:
    InitPlan 3 (returns $5)
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Merge Join  (cost=xxx rows=100 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -1921,8 +1910,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(60 rows)
+               Index Cond: (c1 = bmt1.c1)
+(57 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -1994,11 +1983,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -2013,29 +2002,27 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    InitPlan 3 (returns $5)
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -2045,8 +2032,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(60 rows)
+               Index Cond: (c1 = bmt1.c1)
+(57 rows)
 
 -- No. R-2-1-7
 \o results/ut-R.tmpout
@@ -2102,11 +2089,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -2117,21 +2104,21 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Hash Join  (cost=xxx rows=1 width=xxx)
          Hash Cond: (bmt4.c1 = bmt1.c1)
-         ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+         ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
          ->  Hash  (cost=xxx rows=1 width=xxx)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
                      Merge Cond: (bmt3.c1 = bmt1.c1)
-                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Sort  (cost=xxx rows=1 width=xxx)
                            Sort Key: bmt1.c1
                            ->  Nested Loop  (cost=xxx rows=1 width=xxx)
@@ -2149,7 +2136,7 @@ error hint:
                                                          ->  CTE Scan on c2  (cost=xxx rows=1 width=xxx)
                                  ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                                        Index Cond: (c1 = bmt1.c1)
-(55 rows)
+(54 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -2217,11 +2204,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -2236,17 +2223,17 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    ->  Hash Join  (cost=xxx rows=1 width=xxx)
          Hash Cond: (bmt4.c1 = bmt1.c1)
-         ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+         ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
          ->  Hash  (cost=xxx rows=1 width=xxx)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
                      Merge Cond: (bmt3.c1 = bmt1.c1)
-                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Sort  (cost=xxx rows=1 width=xxx)
                            Sort Key: bmt1.c1
                            ->  Nested Loop  (cost=xxx rows=1 width=xxx)
@@ -2264,7 +2251,7 @@ error hint:
                                                          ->  CTE Scan on c2  (cost=xxx rows=1 width=xxx)
                                  ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                                        Index Cond: (c1 = bmt1.c1)
-(55 rows)
+(54 rows)
 
 -- No. R-2-1-8
 \o results/ut-R.tmpout
@@ -2330,11 +2317,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -2345,10 +2332,10 @@ error hint:
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                  ->  Hash Join  (cost=xxx rows=1000 width=xxx)
                        Hash Cond: (b2t3.c1 = b2t1.c1)
-                       ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                              Merge Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1000 width=xxx)
                              ->  Seq Scan on t1 b2t1  (cost=xxx rows=1000 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
@@ -2356,22 +2343,20 @@ error hint:
    CTE c3
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=100 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -2396,8 +2381,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(75 rows)
+               Index Cond: (c1 = bmt1.c1)
+(72 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -2481,11 +2466,11 @@ error hint:
                  Join Filter: (b1t2.c1 = b1t1.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b1t4.c1 = b1t2.c1)
-                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b1t3.c1 = b1t2.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
                                    ->  Sort  (cost=xxx rows=100 width=xxx)
                                          Sort Key: b1t2.c1
                                          ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
@@ -2500,29 +2485,27 @@ error hint:
                        ->  Hash  (cost=xxx rows=1 width=xxx)
                              ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                    Merge Cond: (b2t3.c1 = b2t4.c1)
-                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                                   ->  Index Only Scan using t3_i1 on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                                   ->  Index Only Scan using t4_i1 on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                  ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                        Index Cond: (c1 = b2t1.c1)
    CTE c3
      ->  Aggregate  (cost=xxx rows=1 width=xxx)
            ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-                 Join Filter: (b3t1.c1 = b3t3.c1)
                  ->  Hash Join  (cost=xxx rows=1 width=xxx)
                        Hash Cond: (b3t1.c1 = b3t2.c1)
                        ->  Merge Join  (cost=xxx rows=1 width=xxx)
                              Merge Cond: (b3t1.c1 = b3t4.c1)
                              ->  Index Only Scan using t1_i1 on t1 b3t1  (cost=xxx rows=1000 width=xxx)
-                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Index Only Scan using t4_i1 on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Hash  (cost=xxx rows=100 width=xxx)
                              ->  Seq Scan on t2 b3t2  (cost=xxx rows=100 width=xxx)
                  ->  Index Only Scan using t3_i1 on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                       Index Cond: (c1 = b3t4.c1)
+                       Index Cond: (c1 = b3t1.c1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Hash Join  (cost=xxx rows=1 width=xxx)
                Hash Cond: (bmt3.c1 = bmt1.c1)
-               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=1 width=xxx)
                      ->  Merge Join  (cost=xxx rows=1 width=xxx)
                            Merge Cond: (bmt1.c1 = bmt2.c1)
@@ -2547,8 +2530,8 @@ error hint:
                                  Sort Key: bmt2.c1
                                  ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(75 rows)
+               Index Cond: (c1 = bmt1.c1)
+(72 rows)
 
 ----
 ---- No. R-2-2 the number of the tables per quiry block
@@ -2596,7 +2579,7 @@ error hint:
          Filter: (c1 <> $2)
    ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
          Filter: (c1 = 1)
-(16 rows)
+(15 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -2648,7 +2631,7 @@ error hint:
          Filter: (c1 <> $2)
    ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
          Filter: (c1 = 1)
-(16 rows)
+(15 rows)
 
 -- No. R-2-2-2
 \o results/ut-R.tmpout
@@ -2728,7 +2711,7 @@ error hint:
                ->  Sort  (cost=xxx rows=100 width=xxx)
                      Sort Key: c1.c1
                      ->  CTE Scan on c1  (cost=xxx rows=100 width=xxx)
-(35 rows)
+(34 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -2818,7 +2801,7 @@ error hint:
                ->  Sort  (cost=xxx rows=1 width=xxx)
                      Sort Key: c1.c1
                      ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
-(35 rows)
+(34 rows)
 
 -- No. R-2-2-3
 \o results/ut-R.tmpout
@@ -2888,11 +2871,11 @@ error hint:
            ->  Sort  (cost=xxx rows=100 width=xxx)
                  Sort Key: b1t2.c1
                  ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                       ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                              Hash Cond: (b1t3.c1 = b1t4.c1)
-                             ->  Seq Scan on t3 b1t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b1t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b1t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b1t3.c1)
    InitPlan 2 (returns $3)
@@ -2902,11 +2885,11 @@ error hint:
            ->  Sort  (cost=xxx rows=100 width=xxx)
                  Sort Key: b2t2.c1
                  ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                       ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                              Hash Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Seq Scan on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b2t3.c1)
    InitPlan 3 (returns $5)
@@ -2916,11 +2899,11 @@ error hint:
            ->  Sort  (cost=xxx rows=100 width=xxx)
                  Sort Key: b3t2.c1
                  ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-                       ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+                       ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                              Hash Cond: (b3t3.c1 = b3t4.c1)
-                             ->  Seq Scan on t3 b3t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b3t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b3t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b3t3.c1)
    ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=999 width=xxx)
@@ -2930,17 +2913,17 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                ->  Hash Join  (cost=xxx rows=100 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=100 width=xxx)
                            ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                  Merge Cond: (bmt4.c1 = c1.c1)
-                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                                  ->  Sort  (cost=xxx rows=100 width=xxx)
                                        Sort Key: c1.c1
                                        ->  CTE Scan on c1  (cost=xxx rows=100 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
-(62 rows)
+(61 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -3037,9 +3020,9 @@ error hint:
                  ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                        ->  Hash Join  (cost=xxx rows=1 width=xxx)
                              Hash Cond: (b1t3.c1 = b1t4.c1)
-                             ->  Seq Scan on t3 b1t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b1t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b1t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b1t3.c1)
    InitPlan 2 (returns $3)
@@ -3051,9 +3034,9 @@ error hint:
                  ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                        ->  Hash Join  (cost=xxx rows=1 width=xxx)
                              Hash Cond: (b2t3.c1 = b2t4.c1)
-                             ->  Seq Scan on t3 b2t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b2t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b2t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b2t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b2t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b2t3.c1)
    InitPlan 3 (returns $5)
@@ -3065,9 +3048,9 @@ error hint:
                  ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                        ->  Hash Join  (cost=xxx rows=1 width=xxx)
                              Hash Cond: (b3t3.c1 = b3t4.c1)
-                             ->  Seq Scan on t3 b3t3  (cost=xxx rows=1100 width=xxx)
-                             ->  Hash  (cost=xxx rows=1100 width=xxx)
-                                   ->  Seq Scan on t4 b3t4  (cost=xxx rows=1100 width=xxx)
+                             ->  Seq Scan on t3 b3t3  (cost=xxx rows=1130 width=xxx)
+                             ->  Hash  (cost=xxx rows=1130 width=xxx)
+                                   ->  Seq Scan on t4 b3t4  (cost=xxx rows=1130 width=xxx)
                        ->  Index Only Scan using t2_i1 on t2 b3t2  (cost=xxx rows=1 width=xxx)
                              Index Cond: (c1 = b3t3.c1)
    ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=999 width=xxx)
@@ -3077,17 +3060,17 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                ->  Hash Join  (cost=xxx rows=1 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=1 width=xxx)
                            ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                  Merge Cond: (bmt4.c1 = c1.c1)
-                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                                  ->  Sort  (cost=xxx rows=1 width=xxx)
                                        Sort Key: c1.c1
                                        ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
-(62 rows)
+(61 rows)
 
 -- No. R-2-2-4
 \o results/ut-R.tmpout
@@ -3139,10 +3122,10 @@ error hint:
            Join Filter: (b1t2.c1 = b1t1.c1)
            ->  Hash Join  (cost=xxx rows=100 width=xxx)
                  Hash Cond: (b1t3.c1 = b1t2.c1)
-                 ->  Merge Join  (cost=xxx rows=1100 width=xxx)
+                 ->  Merge Join  (cost=xxx rows=1130 width=xxx)
                        Merge Cond: (b1t3.c1 = b1t4.c1)
-                       ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
-                       ->  Index Only Scan using t4_i1 on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
+                       ->  Index Only Scan using t4_i1 on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                  ->  Hash  (cost=xxx rows=100 width=xxx)
                        ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
            ->  Index Only Scan using t1_i1 on t1 b1t1  (cost=xxx rows=1 width=xxx)
@@ -3159,17 +3142,17 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=100 width=xxx)
                ->  Hash Join  (cost=xxx rows=100 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=100 width=xxx)
                            ->  Merge Join  (cost=xxx rows=100 width=xxx)
                                  Merge Cond: (bmt4.c1 = c1.c1)
-                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                                  ->  Sort  (cost=xxx rows=100 width=xxx)
                                        Sort Key: c1.c1
                                        ->  CTE Scan on c1  (cost=xxx rows=100 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
-(38 rows)
+(37 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -3236,8 +3219,8 @@ error hint:
                  Hash Cond: (b1t3.c1 = b1t2.c1)
                  ->  Merge Join  (cost=xxx rows=1 width=xxx)
                        Merge Cond: (b1t3.c1 = b1t4.c1)
-                       ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1100 width=xxx)
-                       ->  Index Only Scan using t4_i1 on t4 b1t4  (cost=xxx rows=1100 width=xxx)
+                       ->  Index Only Scan using t3_i1 on t3 b1t3  (cost=xxx rows=1130 width=xxx)
+                       ->  Index Only Scan using t4_i1 on t4 b1t4  (cost=xxx rows=1130 width=xxx)
                  ->  Hash  (cost=xxx rows=100 width=xxx)
                        ->  Seq Scan on t2 b1t2  (cost=xxx rows=100 width=xxx)
            ->  Index Only Scan using t1_i1 on t1 b1t1  (cost=xxx rows=1 width=xxx)
@@ -3254,17 +3237,17 @@ error hint:
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                ->  Hash Join  (cost=xxx rows=1 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                      ->  Hash  (cost=xxx rows=1 width=xxx)
                            ->  Merge Join  (cost=xxx rows=1 width=xxx)
                                  Merge Cond: (bmt4.c1 = c1.c1)
-                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                                 ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                                  ->  Sort  (cost=xxx rows=1 width=xxx)
                                        Sort Key: c1.c1
                                        ->  CTE Scan on c1  (cost=xxx rows=1 width=xxx)
                ->  Index Only Scan using t2_i1 on t2 bmt2  (cost=xxx rows=1 width=xxx)
                      Index Cond: (c1 = bmt3.c1)
-(38 rows)
+(37 rows)
 
 ----
 ---- No. R-2-3 RULE or VIEW
@@ -3289,6 +3272,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3302,10 +3287,9 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (21 rows)
 
 \o results/ut-R.tmpout
@@ -3350,7 +3334,7 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r1  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(19 rows)
+(18 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -3371,6 +3355,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b1t1.c1 = b1t4.c1)
+         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b1t1.c1 = b1t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3384,10 +3370,9 @@ error hint:
                            Sort Key: b1t2.c1
                            ->  Seq Scan on t2 b1t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (21 rows)
 
 \o results/ut-R.tmpout
@@ -3432,7 +3417,7 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r1_  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(19 rows)
+(18 rows)
 
 -- No. R-2-3-2
 \o results/ut-R.tmpout
@@ -3461,6 +3446,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3474,14 +3461,15 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3495,10 +3483,9 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (43 rows)
 
 \o results/ut-R.tmpout
@@ -3573,7 +3560,7 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r2  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(39 rows)
+(37 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -3604,6 +3591,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b1t1.c1 = b1t4.c1)
+         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b1t1.c1 = b1t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3617,14 +3606,15 @@ error hint:
                            Sort Key: b1t2.c1
                            ->  Seq Scan on t2 b1t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b2t1.c1 = b2t4.c1)
+         ->  Tid Scan on t4 b2t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b2t1.c1 = b2t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3638,10 +3628,9 @@ error hint:
                            Sort Key: b2t2.c1
                            ->  Seq Scan on t2 b2t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b2t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b2t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b2t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (43 rows)
 
 \o results/ut-R.tmpout
@@ -3731,7 +3720,7 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r2_  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(39 rows)
+(37 rows)
 
 -- No. R-2-3-3
 \o results/ut-R.tmpout
@@ -3767,6 +3756,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3780,14 +3771,15 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3801,14 +3793,15 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (t1.c1 = t4.c1)
+         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (t1.c1 = t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3822,10 +3815,9 @@ error hint:
                            Sort Key: t2.c1
                            ->  Seq Scan on t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (65 rows)
 
 \o results/ut-R.tmpout
@@ -3930,7 +3922,7 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r3  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(59 rows)
+(56 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -3973,6 +3965,8 @@ error hint:
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b1t1.c1 = b1t4.c1)
+         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b1t1.c1 = b1t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -3986,14 +3980,15 @@ error hint:
                            Sort Key: b1t2.c1
                            ->  Seq Scan on t2 b1t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b1t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b1t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b2t1.c1 = b2t4.c1)
+         ->  Tid Scan on t4 b2t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b2t1.c1 = b2t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -4007,14 +4002,15 @@ error hint:
                            Sort Key: b2t2.c1
                            ->  Seq Scan on t2 b2t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b2t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b2t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b2t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
  
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
          Join Filter: (b3t1.c1 = b3t4.c1)
+         ->  Tid Scan on t4 b3t4  (cost=xxx rows=1 width=xxx)
+               TID Cond: (ctid = '(1,1)'::tid)
          ->  Nested Loop  (cost=xxx rows=1 width=xxx)
                Join Filter: (b3t1.c1 = b3t3.c1)
                ->  Merge Join  (cost=xxx rows=1 width=xxx)
@@ -4028,10 +4024,9 @@ error hint:
                            Sort Key: b3t2.c1
                            ->  Seq Scan on t2 b3t2  (cost=xxx rows=1 width=xxx)
                                  Filter: (ctid = '(1,1)'::tid)
-               ->  Tid Scan on t3 b3t3  (cost=xxx rows=1 width=xxx)
-                     TID Cond: (ctid = '(1,1)'::tid)
-         ->  Tid Scan on t4 b3t4  (cost=xxx rows=1 width=xxx)
-               TID Cond: (ctid = '(1,1)'::tid)
+               ->  Materialize  (cost=xxx rows=1 width=xxx)
+                     ->  Tid Scan on t3 b3t3  (cost=xxx rows=1 width=xxx)
+                           TID Cond: (ctid = '(1,1)'::tid)
 (65 rows)
 
 \o results/ut-R.tmpout
@@ -4176,13 +4171,13 @@ error hint:
                                  TID Cond: (ctid = '(1,1)'::tid)
                            ->  Seq Scan on r3_  (cost=xxx rows=6 width=xxx)
                                  Filter: (c1 = 1)
-(59 rows)
+(56 rows)
 
 -- No. R-2-3-4
 \o results/ut-R.tmpout
 /*+HashJoin(v1t1 v1t1)*/
 EXPLAIN SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(v1t1 v1t1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -4200,14 +4195,14 @@ HashJoin(v1t1 v1t1)
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 v1t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)*/
 EXPLAIN SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
-INFO:  hint syntax error at or near "Rows(v1t1 v1t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(v1t1 v1t1 #1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -4226,7 +4221,7 @@ Rows(v1t1 v1t1 #1)
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 v1t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 -- No. R-2-3-5
 \o results/ut-R.tmpout
@@ -4247,7 +4242,7 @@ error hint:
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Index Scan using t1_i1 on t1 v1t1_  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = v1t1.c1)
-(5 rows)
+(4 rows)
 
 \o results/ut-R.tmpout
 /*+NestLoop(v1t1 v1t1_)Rows(v1t1 v1t1_ #1)*/
@@ -4268,13 +4263,13 @@ error hint:
    ->  Seq Scan on t1 v1t1  (cost=xxx rows=1000 width=xxx)
    ->  Index Scan using t1_i1 on t1 v1t1_  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = v1t1.c1)
-(5 rows)
+(4 rows)
 
 -- No. R-2-3-6
 \o results/ut-R.tmpout
 /*+RowsHashJoin(r4t1 r4t1)*/
 EXPLAIN SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "RowsHashJoin(r4t1 r4t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "RowsHashJoin(r4t1 r4t1)"
 DETAIL:  Unrecognized hint keyword "RowsHashJoin".
 \o
 \! sql/maskout.sh results/ut-R.tmpout
@@ -4285,12 +4280,12 @@ DETAIL:  Unrecognized hint keyword "RowsHashJoin".
    ->  Seq Scan on t1 r4t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 r4t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 \o results/ut-R.tmpout
 /*+RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)*/
 EXPLAIN SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)"
 DETAIL:  Unrecognized hint keyword "RowsHashJoin".
 \o
 \! sql/maskout.sh results/ut-R.tmpout
@@ -4301,7 +4296,7 @@ DETAIL:  Unrecognized hint keyword "RowsHashJoin".
    ->  Seq Scan on t1 r4t1  (cost=xxx rows=1000 width=xxx)
    ->  Hash  (cost=xxx rows=1000 width=xxx)
          ->  Seq Scan on t1 r4t1_1  (cost=xxx rows=1000 width=xxx)
-(6 rows)
+(5 rows)
 
 -- No. R-2-3-7
 \o results/ut-R.tmpout
@@ -4322,7 +4317,7 @@ error hint:
    ->  Seq Scan on t1 r4t1  (cost=xxx rows=1000 width=xxx)
    ->  Index Scan using t1_i1 on t1 r5t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = r4t1.c1)
-(5 rows)
+(4 rows)
 
 \o results/ut-R.tmpout
 /*+NestLoop(r4t1 r5t1)Rows(r4t1 r5t1 #1)*/
@@ -4343,31 +4338,31 @@ error hint:
    ->  Seq Scan on t1 r4t1  (cost=xxx rows=1000 width=xxx)
    ->  Index Scan using t1_i1 on t1 r5t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = r4t1.c1)
-(5 rows)
+(4 rows)
 
 ----
 ---- No. R-2-4 VALUES clause
 ----
 -- No. R-2-4-1
 \o results/ut-R.tmpout
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
 \o
 \! sql/maskout.sh results/ut-R.tmpout
                                    QUERY PLAN                                   
 --------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=1 width=xxx)
-   ->  Hash Join  (cost=xxx rows=1 width=xxx)
+   ->  Hash Join  (cost=xxx rows=2 width=xxx)
          Hash Cond: (t2.c1 = "*VALUES*".column1)
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-         ->  Hash  (cost=xxx rows=1 width=xxx)
-               ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
+         ->  Hash  (cost=xxx rows=2 width=xxx)
+               ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
    ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = t2.c1)
-(9 rows)
+(8 rows)
 
 \o results/ut-R.tmpout
 /*+ Leading(t3 t1 t2) Rows(t3 t1 #2)Rows(t3 t1 t2 #2)*/
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
 LOG:  pg_hint_plan:
 used hint:
 not used hint:
@@ -4382,23 +4377,23 @@ error hint:
                                    QUERY PLAN                                   
 --------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=1 width=xxx)
-   ->  Hash Join  (cost=xxx rows=1 width=xxx)
+   ->  Hash Join  (cost=xxx rows=2 width=xxx)
          Hash Cond: (t2.c1 = "*VALUES*".column1)
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-         ->  Hash  (cost=xxx rows=1 width=xxx)
-               ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
+         ->  Hash  (cost=xxx rows=2 width=xxx)
+               ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
    ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = t2.c1)
-(9 rows)
+(8 rows)
 
 \o results/ut-R.tmpout
-/*+ Leading(*VALUES* t1 t2) Rows(*VALUES* t1 #2)Rows(*VALUES* t1 t2 #2)*/
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+/*+ Leading(*VALUES* t1 t2) Rows(*VALUES* t1 #2)Rows(*VALUES* t1 t2 #20)*/
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
 LOG:  pg_hint_plan:
 used hint:
 Leading(*VALUES* t1 t2)
 Rows(*VALUES* t1 #2)
-Rows(*VALUES* t1 t2 #2)
+Rows(*VALUES* t1 t2 #20)
 not used hint:
 duplication hint:
 error hint:
@@ -4407,38 +4402,39 @@ error hint:
 \! sql/maskout.sh results/ut-R.tmpout
                                  QUERY PLAN                                  
 -----------------------------------------------------------------------------
- Nested Loop  (cost=xxx rows=1 width=xxx)
+ Nested Loop  (cost=xxx rows=20 width=xxx)
    ->  Nested Loop  (cost=xxx rows=2 width=xxx)
-         ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
+         ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
          ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
                Index Cond: (c1 = "*VALUES*".column1)
    ->  Index Scan using t2_i1 on t2  (cost=xxx rows=1 width=xxx)
          Index Cond: (c1 = t1.c1)
-(8 rows)
+(7 rows)
 
 -- No. R-2-4-2
 \o results/ut-R.tmpout
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
 \o
 \! sql/maskout.sh results/ut-R.tmpout
                                       QUERY PLAN                                      
 --------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=1 width=xxx)
-   Join Filter: (t1.c1 = "*VALUES*_1".column1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         ->  Hash Join  (cost=xxx rows=1 width=xxx)
+         Join Filter: (t2.c1 = "*VALUES*_1".column1)
+         ->  Hash Join  (cost=xxx rows=2 width=xxx)
                Hash Cond: (t2.c1 = "*VALUES*".column1)
                ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-               ->  Hash  (cost=xxx rows=1 width=xxx)
-                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
-         ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = t2.c1)
-   ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+               ->  Hash  (cost=xxx rows=2 width=xxx)
+                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
+         ->  Materialize  (cost=xxx rows=2 width=xxx)
+               ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+   ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
+         Index Cond: (c1 = t2.c1)
 (12 rows)
 
 \o results/ut-R.tmpout
 /*+ Leading(t4 t3 t2 t1) Rows(t4 t3 #2) Rows(t4 t3 t2 #2)Rows(t4 t3 t2 t1 #2)*/
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
 LOG:  pg_hint_plan:
 used hint:
 not used hint:
@@ -4454,26 +4450,27 @@ error hint:
                                       QUERY PLAN                                      
 --------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=1 width=xxx)
-   Join Filter: (t1.c1 = "*VALUES*_1".column1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         ->  Hash Join  (cost=xxx rows=1 width=xxx)
+         Join Filter: (t2.c1 = "*VALUES*_1".column1)
+         ->  Hash Join  (cost=xxx rows=2 width=xxx)
                Hash Cond: (t2.c1 = "*VALUES*".column1)
                ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-               ->  Hash  (cost=xxx rows=1 width=xxx)
-                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
-         ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = t2.c1)
-   ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+               ->  Hash  (cost=xxx rows=2 width=xxx)
+                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
+         ->  Materialize  (cost=xxx rows=2 width=xxx)
+               ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+   ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
+         Index Cond: (c1 = t2.c1)
 (12 rows)
 
 \o results/ut-R.tmpout
 /*+ Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)*/
-EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
+EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "Rows(*VALUES* t3 t2 t1 #2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -4490,16 +4487,17 @@ Rows(*VALUES* t1 t2 t3 #2)
                                       QUERY PLAN                                      
 --------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=1 width=xxx)
-   Join Filter: (t1.c1 = "*VALUES*_1".column1)
    ->  Nested Loop  (cost=xxx rows=1 width=xxx)
-         ->  Hash Join  (cost=xxx rows=1 width=xxx)
+         Join Filter: (t2.c1 = "*VALUES*_1".column1)
+         ->  Hash Join  (cost=xxx rows=2 width=xxx)
                Hash Cond: (t2.c1 = "*VALUES*".column1)
                ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-               ->  Hash  (cost=xxx rows=1 width=xxx)
-                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=1 width=xxx)
-         ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = t2.c1)
-   ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+               ->  Hash  (cost=xxx rows=2 width=xxx)
+                     ->  Values Scan on "*VALUES*"  (cost=xxx rows=2 width=xxx)
+         ->  Materialize  (cost=xxx rows=2 width=xxx)
+               ->  Values Scan on "*VALUES*_1"  (cost=xxx rows=2 width=xxx)
+   ->  Index Scan using t1_i1 on t1  (cost=xxx rows=1 width=xxx)
+         Index Cond: (c1 = t2.c1)
 (12 rows)
 
 ----
@@ -4514,19 +4512,18 @@ EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sb
 ------------------------------------------------------------------------------------------------------
  Aggregate  (cost=xxx rows=1 width=xxx)
    ->  Nested Loop  (cost=xxx rows=100 width=xxx)
-         Join Filter: (bmt1.c1 = bmt4.c1)
          ->  Merge Join  (cost=xxx rows=100 width=xxx)
                Merge Cond: (bmt1.c1 = bmt2.c1)
                ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                      Merge Cond: (bmt1.c1 = bmt3.c1)
                      ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=1000 width=xxx)
-                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+                     ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1130 width=xxx)
                ->  Sort  (cost=xxx rows=100 width=xxx)
                      Sort Key: bmt2.c1
                      ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
          ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-               Index Cond: (c1 = bmt3.c1)
-(15 rows)
+               Index Cond: (c1 = bmt1.c1)
+(13 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -4553,14 +4550,14 @@ error hint:
          Sort Key: bmt2.c1
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt2.c1)
-               ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+               ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                     ->  Hash  (cost=xxx rows=1100 width=xxx)
-                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                     ->  Hash  (cost=xxx rows=1130 width=xxx)
+                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 -- No. R-2-5-2
 \o results/ut-R.tmpout
@@ -4570,19 +4567,18 @@ EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2,
                                            QUERY PLAN                                           
 ------------------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=100 width=xxx)
-   Join Filter: (bmt1.c1 = bmt4.c1)
    ->  Merge Join  (cost=xxx rows=100 width=xxx)
          Merge Cond: (bmt1.c1 = bmt2.c1)
          ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                Merge Cond: (bmt1.c1 = bmt3.c1)
                ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=1000 width=xxx)
-               ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1130 width=xxx)
          ->  Sort  (cost=xxx rows=100 width=xxx)
                Sort Key: bmt2.c1
                ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
    ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-         Index Cond: (c1 = bmt3.c1)
-(14 rows)
+         Index Cond: (c1 = bmt1.c1)
+(12 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -4609,14 +4605,14 @@ error hint:
          Sort Key: bmt2.c1
          ->  Hash Join  (cost=xxx rows=60 width=xxx)
                Hash Cond: (bmt3.c1 = bmt2.c1)
-               ->  Hash Join  (cost=xxx rows=660 width=xxx)
+               ->  Hash Join  (cost=xxx rows=678 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                     ->  Hash  (cost=xxx rows=1100 width=xxx)
-                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                     ->  Hash  (cost=xxx rows=1130 width=xxx)
+                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 -- No. R-2-5-3
 \o results/ut-R.tmpout
@@ -4626,19 +4622,18 @@ EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2,
                                            QUERY PLAN                                           
 ------------------------------------------------------------------------------------------------
  Nested Loop  (cost=xxx rows=100 width=xxx)
-   Join Filter: (bmt1.c1 = bmt4.c1)
    ->  Merge Join  (cost=xxx rows=100 width=xxx)
          Merge Cond: (bmt1.c1 = bmt2.c1)
          ->  Merge Join  (cost=xxx rows=1000 width=xxx)
                Merge Cond: (bmt1.c1 = bmt3.c1)
                ->  Index Only Scan using t1_i1 on t1 bmt1  (cost=xxx rows=1000 width=xxx)
-               ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1100 width=xxx)
+               ->  Index Only Scan using t3_i1 on t3 bmt3  (cost=xxx rows=1130 width=xxx)
          ->  Sort  (cost=xxx rows=100 width=xxx)
                Sort Key: bmt2.c1
                ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
    ->  Index Only Scan using t4_i1 on t4 bmt4  (cost=xxx rows=1 width=xxx)
-         Index Cond: (c1 = bmt3.c1)
-(14 rows)
+         Index Cond: (c1 = bmt1.c1)
+(12 rows)
 
 \o results/ut-R.tmpout
 /*+
@@ -4665,14 +4660,14 @@ error hint:
          Sort Key: bmt2.c1
          ->  Hash Join  (cost=xxx rows=100 width=xxx)
                Hash Cond: (bmt3.c1 = bmt2.c1)
-               ->  Hash Join  (cost=xxx rows=1100 width=xxx)
+               ->  Hash Join  (cost=xxx rows=1130 width=xxx)
                      Hash Cond: (bmt3.c1 = bmt4.c1)
-                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1100 width=xxx)
-                     ->  Hash  (cost=xxx rows=1100 width=xxx)
-                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1100 width=xxx)
+                     ->  Seq Scan on t3 bmt3  (cost=xxx rows=1130 width=xxx)
+                     ->  Hash  (cost=xxx rows=1130 width=xxx)
+                           ->  Seq Scan on t4 bmt4  (cost=xxx rows=1130 width=xxx)
                ->  Hash  (cost=xxx rows=100 width=xxx)
                      ->  Seq Scan on t2 bmt2  (cost=xxx rows=100 width=xxx)
-(15 rows)
+(14 rows)
 
 ----
 ---- No. R-3-1 abusolute value
@@ -4699,7 +4694,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-1-2
 \o results/ut-R.tmpout
@@ -4722,7 +4717,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-3-2 increase or decrease value
@@ -4748,7 +4743,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-2-2
 \o results/ut-R.tmpout
@@ -4771,7 +4766,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-2-3
 \o results/ut-R.tmpout
@@ -4795,7 +4790,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-3-3 multiple 
@@ -4822,7 +4817,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-3-2
 \o results/ut-R.tmpout
@@ -4845,7 +4840,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-3-3
 \o results/ut-R.tmpout
@@ -4868,7 +4863,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-3-4 join inherit tables
@@ -4899,7 +4894,7 @@ EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
                ->  Seq Scan on p1c1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3  (cost=xxx rows=100 width=xxx)
-(20 rows)
+(19 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(p1 p2 #1)*/
@@ -4934,7 +4929,7 @@ error hint:
                ->  Seq Scan on p1c1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3  (cost=xxx rows=100 width=xxx)
-(20 rows)
+(19 rows)
 
 -- No. R-3-4-2
 \o results/ut-R.tmpout
@@ -4962,7 +4957,7 @@ EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
                ->  Seq Scan on p1c1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3  (cost=xxx rows=100 width=xxx)
-(20 rows)
+(19 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(p1c1 p2c1 #1)*/
@@ -4997,7 +4992,7 @@ error hint:
                ->  Seq Scan on p1c1  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c2  (cost=xxx rows=100 width=xxx)
                ->  Seq Scan on p1c3  (cost=xxx rows=100 width=xxx)
-(20 rows)
+(19 rows)
 
 ----
 ---- No. R-3-5 conflict join method hint
@@ -5015,12 +5010,12 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)Rows(t1 t2 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5040,7 +5035,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-5-2
 \o results/ut-R.tmpout
@@ -5055,14 +5050,14 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5083,7 +5078,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-5-3
 \o results/ut-R.tmpout
@@ -5098,12 +5093,12 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 #1)Rows(t2 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5123,7 +5118,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 -- No. R-3-5-4
 \o results/ut-R.tmpout
@@ -5138,14 +5133,14 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5166,7 +5161,7 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 ----
 ---- No. R-3-6 hint state output
@@ -5185,7 +5180,7 @@ EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \o results/ut-R.tmpout
 /*+Rows(t1 t2 +1)*/
@@ -5208,6 +5203,6 @@ error hint:
    ->  Sort  (cost=xxx rows=100 width=xxx)
          Sort Key: t2.c1
          ->  Seq Scan on t2  (cost=xxx rows=100 width=xxx)
-(7 rows)
+(6 rows)
 
 \! rm results/ut-R.tmpout