installcheck: $(REGRESSION_EXPECTED)
# pg_hint_plan.c includes core.c and make_join_rel.c
-pg_hint_plan.o: core.c make_join_rel.c pg_stat_statements.c
+pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
--------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Scan using t1_i1 on t1 t_1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
--------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t_1.c1 = t_2.c1)
- -> Index Scan using t1_i1 on t1 t_1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t_2.c1
- -> Seq Scan on t2 t_2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t1_1.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t1_1.c1
- -> Seq Scan on t1 t1_1 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t1_1.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t1_1.c1
- -> Seq Scan on t1 t1_1 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t1_1.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t1_1.c1
- -> Seq Scan on t1 t1_1 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = s2t1.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: s2t1.c1
- -> Seq Scan on t1 s2t1 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = s2t1.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: s2t1.c1
- -> Seq Scan on t1 s2t1 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (t1_1.c1 = t2_1.c1)
- -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2_1.c1
- -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(14 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (t1_1.c1 = t2_1.c1)
- -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2_1.c1
- -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(14 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- InitPlan 1 (returns $0)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (st1.c1 = st2.c1)
- -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: st2.c1
- -> Seq Scan on t2 st2 (cost=xxx rows=100 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(14 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=73)
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join (cost=xxx rows=1000 width=59)
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t3_i1 on t3 (cost=xxx rows=1100 width=44)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(9 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=100 width=117)
- Join Filter: (t1.c1 = t4.c1)
- -> Merge Join (cost=xxx rows=100 width=73)
- Merge Cond: (t1.c1 = t2.c1)
- -> Merge Join (cost=xxx rows=1000 width=59)
- Merge Cond: (t1.c1 = t3.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t3_i1 on t3 (cost=xxx rows=1100 width=44)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Index Scan using t4_i1 on t4 (cost=xxx rows=1 width=44)
- Index Cond: (c1 = t3.c1)
-(13 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (v1t1.c1 = v1t1_1.c1)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 v1t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (v1t1.c1 = v1t1_1.c1)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 v1t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=30)
- Hash Cond: (v1t1.c1 = v1t1_.c1)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 v1t1_ (cost=xxx rows=1000 width=15)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=19)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=4)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=19)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=4)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=19)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=4)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------
- Hash Join (cost=xxx rows=301 width=30)
- Hash Cond: (t1.c1 = t2.c1)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 t1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 t1_1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 t1_2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 t1_3 (cost=xxx rows=100 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 t2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 t2_1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 t2_2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 t2_3 (cost=xxx rows=100 width=16)
-(13 rows)
-
- QUERY PLAN
-------------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=30)
- Hash Cond: (t1.c1 = t2.c1)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 t1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 t1_1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 t1_2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 t1_3 (cost=xxx rows=100 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 t2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 t2_1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 t2_2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 t2_3 (cost=xxx rows=100 width=16)
-(13 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1100 width=88)
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on ul1 t1 (cost=xxx rows=1100 width=44)
- -> Hash (cost=xxx rows=1100 width=44)
- -> Seq Scan on ul1 t2 (cost=xxx rows=1100 width=44)
-(5 rows)
-
- QUERY PLAN
------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=88)
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on ul1 t1 (cost=xxx rows=1100 width=44)
- -> Hash (cost=xxx rows=1100 width=44)
- -> Seq Scan on ul1 t2 (cost=xxx rows=1100 width=44)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1100 width=88)
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on tm1 t1 (cost=xxx rows=1100 width=44)
- -> Hash (cost=xxx rows=1100 width=44)
- -> Seq Scan on tm1 t2 (cost=xxx rows=1100 width=44)
-(5 rows)
-
- QUERY PLAN
------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=88)
- Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on tm1 t1 (cost=xxx rows=1100 width=44)
- -> Hash (cost=xxx rows=1100 width=44)
- -> Seq Scan on tm1 t2 (cost=xxx rows=1100 width=44)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
-----------------------------------------------------------------------------
- Hash Join (cost=xxx rows=620 width=406)
- Hash Cond: (t1.oid = t2.oid)
- -> Seq Scan on pg_class t1 (cost=xxx rows=620 width=207)
- -> Hash (cost=xxx rows=620 width=207)
- -> Seq Scan on pg_class t2 (cost=xxx rows=620 width=207)
-(5 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=406)
- Hash Cond: (t1.oid = t2.oid)
- -> Seq Scan on pg_class t1 (cost=xxx rows=620 width=207)
- -> Hash (cost=xxx rows=620 width=207)
- -> Seq Scan on pg_class t2 (cost=xxx rows=620 width=207)
-(5 rows)
-
+++ /dev/null
- Nested Loop (cost=xxx rows=1 width=31)
- -> Nested Loop (cost=xxx rows=1 width=16)
- Join Filter: (ft_1.id = ft_2.id)
- -> Foreign Scan on ft1 ft_1 (cost=xxx rows=1 width=8)
- Foreign File: @pg_hint_plan@/data/data.csv
- Foreign File Size: 42
- -> Foreign Scan on ft1 ft_2 (cost=xxx rows=1 width=8)
- Foreign File: @pg_hint_plan@/data/data.csv
- Foreign File Size: 42
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = ft_1.id)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=88)
- Join Filter: (t1.c1 = t2.c1)
- -> Function Scan on f1 t1 (cost=xxx rows=1 width=44)
- -> Function Scan on f1 t2 (cost=xxx rows=1 width=44)
-(4 rows)
-
- QUERY PLAN
------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=88)
- Join Filter: (t1.c1 = t2.c1)
- -> Function Scan on f1 t1 (cost=xxx rows=1 width=44)
- -> Function Scan on f1 t2 (cost=xxx rows=1 width=44)
-(4 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=3 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=3 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=3 width=44)
-(5 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=3 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=3 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=3 width=44)
-(5 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=3 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=3 width=44)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=19)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (t1_1.c1 = t2.c1)
- -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=4)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = c1.c1)
-(12 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=2 width=19)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (t1_1.c1 = t2.c1)
- -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=4)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = c1.c1)
-(12 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(44 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(44 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- InitPlan 3 (returns $5)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(58 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- InitPlan 3 (returns $5)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(58 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: bmt2.c1
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt2.c1)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
-(15 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- -> Hash Join (cost=xxx rows=1 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(13 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: bmt2.c1
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt2.c1)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
-(15 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt2.c1 = bmt1.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- -> Hash Join (cost=xxx rows=1 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(13 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=998 width=4)
- Filter: ((c1 <> $1) AND (c1 <> $3))
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(45 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=998 width=4)
- Filter: ((c1 <> $1) AND (c1 <> $3))
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(45 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- InitPlan 3 (returns $5)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=997 width=4)
- Filter: ((c1 <> $1) AND (c1 <> $3) AND (c1 <> $5))
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(59 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- InitPlan 1 (returns $1)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- InitPlan 3 (returns $5)
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=997 width=4)
- Filter: ((c1 <> $1) AND (c1 <> $3) AND (c1 <> $5))
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(59 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- CTE c2
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Hash Join (cost=xxx rows=1 width=4)
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=20)
- -> Merge Join (cost=xxx rows=1 width=20)
- Merge Cond: (bmt3.c1 = bmt1.c1)
- -> Index Only Scan using t3_i1 on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt1.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt1.c1 = c1.c1)
- -> Seq Scan on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (c1.c1 = c2.c1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c2.c1
- -> CTE Scan on c2 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt1.c1)
-(54 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- CTE c2
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- -> Hash Join (cost=xxx rows=1 width=4)
- Hash Cond: (bmt4.c1 = bmt1.c1)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=20)
- -> Merge Join (cost=xxx rows=1 width=20)
- Merge Cond: (bmt3.c1 = bmt1.c1)
- -> Index Only Scan using t3_i1 on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt1.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt1.c1 = c1.c1)
- -> Seq Scan on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (c1.c1 = c2.c1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c2.c1
- -> CTE Scan on c2 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt1.c1)
-(54 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- CTE c2
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- -> Hash Join (cost=xxx rows=1000 width=12)
- Hash Cond: (b2t3.c1 = b2t1.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1000 width=4)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- CTE c3
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=24)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=20)
- -> Merge Join (cost=xxx rows=1 width=20)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt1.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (c2.c1 = c1.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (c2.c1 = c3.c1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c2.c1
- -> CTE Scan on c2 (cost=xxx rows=1 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c3.c1
- -> CTE Scan on c3 (cost=xxx rows=1 width=4)
- -> Hash (cost=xxx rows=1 width=4)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = c1.c1)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(74 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- CTE c1
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t4.c1 = b1t2.c1)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t2.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- CTE c2
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b2t1.c1 = b2t3.c1)
- -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t3.c1 = b2t4.c1)
- -> Index Only Scan using t3_i1 on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t1.c1)
- CTE c3
- -> Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b3t1.c1 = b3t2.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b3t1.c1 = b3t4.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t4_i1 on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t3_i1 on t3 b3t3 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Hash Join (cost=xxx rows=1 width=24)
- Hash Cond: (bmt3.c1 = bmt1.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=20)
- -> Merge Join (cost=xxx rows=1 width=20)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt1.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (c2.c1 = c1.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (c2.c1 = c3.c1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c2.c1
- -> CTE Scan on c2 (cost=xxx rows=1 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c3.c1
- -> CTE Scan on c3 (cost=xxx rows=1 width=4)
- -> Hash (cost=xxx rows=1 width=4)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = c1.c1)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(74 rows)
-
+++ /dev/null
- QUERY PLAN
-----------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=4)
- CTE c1
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- Filter: (c1 <> $2)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- Filter: (c1 = 1)
-(15 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=4)
- CTE c1
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 2 (returns $1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 3 (returns $2)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- Filter: (c1 <> $2)
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- Filter: (c1 = 1)
-(15 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------------
- Hash Join (cost=xxx rows=10 width=4)
- Hash Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- InitPlan 2 (returns $1)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2 (cost=xxx rows=100 width=4)
- InitPlan 3 (returns $2)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b3t2.c1
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Seq Scan on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $2)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt2.c1 = c1.c1)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=100 width=4)
-(34 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=4)
- Hash Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- InitPlan 2 (returns $1)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2 (cost=xxx rows=100 width=4)
- InitPlan 3 (returns $2)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: b3t2.c1
- -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=4)
- -> Seq Scan on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $2)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt2.c1 = c1.c1)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
-(34 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=10 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: b1t2.c1
- -> Nested Loop (cost=xxx rows=100 width=12)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (b1t3.c1 = b1t4.c1)
- -> Seq Scan on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b1t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: b2t2.c1
- -> Nested Loop (cost=xxx rows=100 width=12)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (b2t3.c1 = b2t4.c1)
- -> Seq Scan on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t3.c1)
- InitPlan 3 (returns $5)
- -> Merge Join (cost=xxx rows=100 width=4)
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: b3t2.c1
- -> Nested Loop (cost=xxx rows=100 width=12)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (b3t3.c1 = b3t4.c1)
- -> Seq Scan on t3 b3t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b3t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $5)
- -> Sort (cost=xxx rows=100 width=16)
- Sort Key: bmt2.c1
- -> Nested Loop (cost=xxx rows=100 width=16)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(61 rows)
-
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=1 width=12)
- Sort Key: b1t2.c1
- -> Nested Loop (cost=xxx rows=1 width=12)
- -> Hash Join (cost=xxx rows=1 width=8)
- Hash Cond: (b1t3.c1 = b1t4.c1)
- -> Seq Scan on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b1t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $3)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=1 width=12)
- Sort Key: b2t2.c1
- -> Nested Loop (cost=xxx rows=1 width=12)
- -> Hash Join (cost=xxx rows=1 width=8)
- Hash Cond: (b2t3.c1 = b2t4.c1)
- -> Seq Scan on t3 b2t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b2t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b2t3.c1)
- InitPlan 3 (returns $5)
- -> Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=1 width=12)
- Sort Key: b3t2.c1
- -> Nested Loop (cost=xxx rows=1 width=12)
- -> Hash Join (cost=xxx rows=1 width=8)
- Hash Cond: (b3t3.c1 = b3t4.c1)
- -> Seq Scan on t3 b3t3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 b3t4 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t2_i1 on t2 b3t2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b3t3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $5)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt2.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(61 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=10 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (b1t3.c1 = b1t2.c1)
- -> Merge Join (cost=xxx rows=1100 width=8)
- Merge Cond: (b1t3.c1 = b1t4.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $2)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 3 (returns $3)
- -> Seq Scan on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $3)
- -> Sort (cost=xxx rows=100 width=16)
- Sort Key: bmt2.c1
- -> Nested Loop (cost=xxx rows=100 width=16)
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=8)
- -> Merge Join (cost=xxx rows=100 width=8)
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(37 rows)
-
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- CTE c1
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t2.c1 = b1t1.c1)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (b1t3.c1 = b1t2.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t3.c1 = b1t4.c1)
- -> Index Only Scan using t3_i1 on t3 b1t3 (cost=xxx rows=1100 width=4)
- -> Index Only Scan using t4_i1 on t4 b1t4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = b1t3.c1)
- InitPlan 2 (returns $2)
- -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = 1)
- InitPlan 3 (returns $3)
- -> Seq Scan on t1 b3t1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=4)
- Filter: (c1 <> $3)
- -> Sort (cost=xxx rows=1 width=16)
- Sort Key: bmt2.c1
- -> Nested Loop (cost=xxx rows=1 width=16)
- -> Hash Join (cost=xxx rows=1 width=12)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1 width=8)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (bmt4.c1 = c1.c1)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: c1.c1
- -> CTE Scan on c1 (cost=xxx rows=1 width=4)
- -> Index Only Scan using t2_i1 on t2 bmt2 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(37 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(20 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(18 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(20 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r1_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(18 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(41 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(37 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(41 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b2t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r2_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(37 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (t1.c1 = t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(62 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (t1.c1 = t4.c1)
- -> Tid Scan on t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (t1.c1 = t3.c1)
- -> Tid Scan on t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (t1.c1 = t2.c1)
- -> Seq Scan on t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3 (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(56 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b1t1.c1 = b1t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b1t2.c1
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b2t1.c1 = b2t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b2t2.c1
- -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=1 width=4)
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Nested Loop (cost=xxx rows=1 width=12)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Merge Join (cost=xxx rows=1 width=8)
- Merge Cond: (b3t1.c1 = b3t2.c1)
- -> Nested Loop (cost=xxx rows=6 width=4)
- -> Index Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
- -> Sort (cost=xxx rows=1 width=4)
- Sort Key: b3t2.c1
- -> Seq Scan on t2 b3t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on t3 b3t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Tid Scan on t4 b3t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
-(62 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b1t1.c1 = b1t4.c1)
- -> Tid Scan on t4 b1t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b1t1.c1 = b1t3.c1)
- -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b1t1.c1 = b1t2.c1)
- -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b2t1.c1 = b2t4.c1)
- -> Tid Scan on t4 b2t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b2t1.c1 = b2t3.c1)
- -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b2t1.c1 = b2t2.c1)
- -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b2t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=2 width=4)
- Join Filter: (b3t1.c1 = b3t4.c1)
- -> Tid Scan on t4 b3t4 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=12)
- Join Filter: (b3t1.c1 = b3t3.c1)
- -> Tid Scan on t3 b3t3 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=8)
- Join Filter: (b3t1.c1 = b3t2.c1)
- -> Seq Scan on t2 b3t2 (cost=xxx rows=1 width=4)
- Filter: (ctid = '(1,1)'::tid)
- -> Nested Loop (cost=xxx rows=2 width=4)
- -> Tid Scan on t1 b3t1 (cost=xxx rows=1 width=4)
- TID Cond: (ctid = '(1,1)'::tid)
- -> Seq Scan on r3_ (cost=xxx rows=6 width=0)
- Filter: (c1 = 1)
-(56 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (v1t1.c1 = v1t1_1.c1)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 v1t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (v1t1.c1 = v1t1_1.c1)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 v1t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1000 width=30)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t1_i1 on t1 v1t1_ (cost=xxx rows=1 width=15)
- Index Cond: (c1 = v1t1.c1)
-(4 rows)
-
- QUERY PLAN
------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=30)
- -> Seq Scan on t1 v1t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t1_i1 on t1 v1t1_ (cost=xxx rows=1 width=15)
- Index Cond: (c1 = v1t1.c1)
-(4 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (r4t1.c1 = r4t1_1.c1)
- -> Seq Scan on t1 r4t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 r4t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1000 width=30)
- Hash Cond: (r4t1.c1 = r4t1_1.c1)
- -> Seq Scan on t1 r4t1 (cost=xxx rows=1000 width=15)
- -> Hash (cost=xxx rows=1000 width=15)
- -> Seq Scan on t1 r4t1_1 (cost=xxx rows=1000 width=15)
-(5 rows)
-
+++ /dev/null
- QUERY PLAN
-----------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1000 width=30)
- -> Seq Scan on t1 r4t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t1_i1 on t1 r5t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = r4t1.c1)
-(4 rows)
-
- QUERY PLAN
-----------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=30)
- -> Seq Scan on t1 r4t1 (cost=xxx rows=1000 width=15)
- -> Index Scan using t1_i1 on t1 r5t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = r4t1.c1)
-(4 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=73)
- -> Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=1 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=73)
- -> Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=1 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = t2.c1)
-(8 rows)
-
- QUERY PLAN
------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=73)
- -> Nested Loop (cost=xxx rows=2 width=59)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = "*VALUES*".column1)
- -> Index Scan using t2_i1 on t2 (cost=xxx rows=1 width=14)
- Index Cond: (c1 = t1.c1)
-(7 rows)
-
+++ /dev/null
- QUERY PLAN
---------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=117)
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
- -> Nested Loop (cost=xxx rows=1 width=73)
- -> Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=1 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1" (cost=xxx rows=2 width=44)
-(11 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=117)
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
- -> Nested Loop (cost=xxx rows=1 width=73)
- -> Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=1 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1" (cost=xxx rows=2 width=44)
-(11 rows)
-
- QUERY PLAN
---------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=1 width=117)
- Join Filter: (t1.c1 = "*VALUES*_1".column1)
- -> Nested Loop (cost=xxx rows=1 width=73)
- -> Hash Join (cost=xxx rows=1 width=58)
- Hash Cond: (t2.c1 = "*VALUES*".column1)
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
- -> Hash (cost=xxx rows=1 width=44)
- -> Values Scan on "*VALUES*" (cost=xxx rows=1 width=44)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=15)
- Index Cond: (c1 = t2.c1)
- -> Values Scan on "*VALUES*_1" (cost=xxx rows=2 width=44)
-(11 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------------------------------
- Aggregate (cost=xxx rows=1 width=4)
- -> Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Merge Join (cost=xxx rows=100 width=12)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t3_i1 on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(14 rows)
-
- QUERY PLAN
------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=70 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: bmt2.c1
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt2.c1)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
-(14 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Merge Join (cost=xxx rows=100 width=12)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t3_i1 on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(13 rows)
-
- QUERY PLAN
------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=60 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=60 width=12)
- Sort Key: bmt2.c1
- -> Hash Join (cost=xxx rows=60 width=12)
- Hash Cond: (bmt3.c1 = bmt2.c1)
- -> Hash Join (cost=xxx rows=660 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
-(14 rows)
-
+++ /dev/null
- QUERY PLAN
-------------------------------------------------------------------------------------------------
- Nested Loop (cost=xxx rows=100 width=4)
- Join Filter: (bmt1.c1 = bmt4.c1)
- -> Merge Join (cost=xxx rows=100 width=12)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Merge Join (cost=xxx rows=1000 width=8)
- Merge Cond: (bmt1.c1 = bmt3.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Index Only Scan using t3_i1 on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Sort (cost=xxx rows=100 width=4)
- Sort Key: bmt2.c1
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
- -> Index Only Scan using t4_i1 on t4 bmt4 (cost=xxx rows=1 width=4)
- Index Cond: (c1 = bmt3.c1)
-(13 rows)
-
- QUERY PLAN
------------------------------------------------------------------------------------------
- Merge Join (cost=xxx rows=50 width=4)
- Merge Cond: (bmt1.c1 = bmt2.c1)
- -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=4)
- -> Sort (cost=xxx rows=100 width=12)
- Sort Key: bmt2.c1
- -> Hash Join (cost=xxx rows=100 width=12)
- Hash Cond: (bmt3.c1 = bmt2.c1)
- -> Hash Join (cost=xxx rows=1100 width=8)
- Hash Cond: (bmt3.c1 = bmt4.c1)
- -> Seq Scan on t3 bmt3 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=1100 width=4)
- -> Seq Scan on t4 bmt4 (cost=xxx rows=1100 width=4)
- -> Hash (cost=xxx rows=100 width=4)
- -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=4)
-(14 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=5 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=101 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=99 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=200 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=10 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
--------------------------------------------------------------------------
- Hash Join (cost=xxx rows=301 width=31)
- Hash Cond: (p2.c1 = p1.c1)
- -> Append (cost=xxx rows=304 width=16)
- -> Seq Scan on p2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c3 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=14)
- -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=15)
- -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 (cost=xxx rows=100 width=16)
-(19 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------
- Hash Join (cost=xxx rows=1 width=31)
- Hash Cond: (p2.c1 = p1.c1)
- -> Append (cost=xxx rows=304 width=16)
- -> Seq Scan on p2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c3 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=14)
- -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=15)
- -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 (cost=xxx rows=100 width=16)
-(19 rows)
-
+++ /dev/null
- QUERY PLAN
--------------------------------------------------------------------------
- Hash Join (cost=xxx rows=301 width=31)
- Hash Cond: (p2.c1 = p1.c1)
- -> Append (cost=xxx rows=304 width=16)
- -> Seq Scan on p2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c3 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=14)
- -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=15)
- -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 (cost=xxx rows=100 width=16)
-(19 rows)
-
- QUERY PLAN
--------------------------------------------------------------------------
- Hash Join (cost=xxx rows=301 width=31)
- Hash Cond: (p2.c1 = p1.c1)
- -> Append (cost=xxx rows=304 width=16)
- -> Seq Scan on p2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c2 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c3 (cost=xxx rows=1 width=44)
- -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=14)
- -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=15)
- -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=16)
- -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=16)
- -> Hash (cost=xxx rows=301 width=15)
- -> Append (cost=xxx rows=301 width=15)
- -> Seq Scan on p1 (cost=xxx rows=1 width=44)
- -> Seq Scan on p1c1 (cost=xxx rows=100 width=14)
- -> Seq Scan on p1c2 (cost=xxx rows=100 width=16)
- -> Seq Scan on p1c3 (cost=xxx rows=100 width=16)
-(19 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=1 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
+++ /dev/null
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=100 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
- QUERY PLAN
----------------------------------------------------------------------------
- Merge Join (cost=xxx rows=101 width=29)
- Merge Cond: (t1.c1 = t2.c1)
- -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15)
- -> Sort (cost=xxx rows=100 width=14)
- Sort Key: t2.c1
- -> Seq Scan on t2 (cost=xxx rows=100 width=14)
-(6 rows)
-
* The following GUC parameters need the setting of the default value to
* succeed in regression test.
*/
+/* Fix auto-tunable parameters */
+ALTER SYSTEM SET effective_cache_size TO 16384;
+\! pg_ctl reload
+server signaled
+SET effective_cache_size TO 16384;
CREATE VIEW settings AS
SELECT name, setting, category
FROM pg_settings
client_min_messages | notice | Reporting and Logging / When to Log
(30 rows)
+ANALYZE;
SET search_path TO public;
+SET client_min_messages TO log;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
QUERY PLAN
--------------------------------------
LOAD 'pg_hint_plan';
SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
QUERY PLAN
--------------------------------------
/*+Set(work_mem "1M")*/
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
INFO: invalid value for parameter "work_mem": "1M"
-HINT: Valid units for this parameter are "kB", "MB", and "GB".
+HINT: Valid units for this parameter are "kB", "MB", "GB", and "TB".
LOG: pg_hint_plan:
used hint:
not used hint:
Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c1
Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(11 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(9 rows)
/*+IndexScan(p2 p2_pkey)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c3
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(24 rows)
+ -> Seq Scan on p2_c4
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+(19 rows)
/*+IndexScan(p2 p2_val)*/
EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c3
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(24 rows)
+ -> Seq Scan on p2_c4
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+(19 rows)
/*+IndexScan(p2 p2_pkey)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
duplication hint:
error hint:
- QUERY PLAN
--------------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------------------
Append
-> Index Scan using p2_id2_val on p2
Index Cond: ((id >= 50) AND (id <= 51))
-> Index Scan using p2_c1_id2_val on p2_c1
Index Cond: ((id >= 50) AND (id <= 51))
Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(13 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(11 rows)
/*+IndexScan(p2 p2_val2_id)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
Filter: (ctid = '(1,1)'::tid)
-> Seq Scan on p2_c1
Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(10 rows)
/*+IndexScan(p2 p2_pkey)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-> Index Scan using p2_c1_id_val_idx on p2_c1
Index Cond: ((id >= 50) AND (id <= 51))
Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(10 rows)
/*+IndexScan(p2 no_exist)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c1
Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(11 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(9 rows)
/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
-> Index Scan using p2_c1_id_val_idx on p2_c1
Index Cond: ((id >= 50) AND (id <= 51))
Filter: (ctid = '(1,1)'::tid)
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((id >= 50) AND (id <= 51))
-(12 rows)
+ -> Seq Scan on p2_c1_c1
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((id >= 50) AND (id <= 51) AND (ctid = '(1,1)'::tid))
+(10 rows)
/*+IndexScan(p2 p2_pkey p2_c1_id_val_idx no_exist)*/
EXPLAIN (COSTS false) SELECT * FROM p2 WHERE id >= 50 AND id <= 51 AND p2.ctid = '(1,1)';
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c3
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(24 rows)
+ -> Seq Scan on p2_c4
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+(19 rows)
/*+IndexScan(p2 p2_val_idx6)*/
EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
-> Seq Scan on p2_c3
Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
- -> Tid Scan on p2_c4
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c1_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c1
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
- -> Tid Scan on p2_c3_c2
- TID Cond: (ctid = '(1,1)'::tid)
- Filter: ((val >= '50'::text) AND (val <= '51'::text))
-(24 rows)
+ -> Seq Scan on p2_c4
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c1_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c1
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+ -> Seq Scan on p2_c3_c2
+ Filter: ((val >= '50'::text) AND (val <= '51'::text) AND (ctid = '(1,1)'::tid))
+(19 rows)
/*+IndexScan(p2 p2_val_idx p2_val_idx6)*/
EXPLAIN (COSTS false) SELECT val FROM p2 WHERE val >= '50' AND val <= '51' AND p2.ctid = '(1,1)';
--
-- Rows hint tests
--
+-- Explain result includes "Planning time" if COSTS is enabled, but
+-- this test needs it enabled for get rows count. So do tests via psql
+-- and grep -v the mutable line.
-- value types
+\o results/pg_hint_plan.tmpout
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=1000 width=16)
+ Merge Join (cost=xxx rows=1000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=99 width=16)
+ Merge Join (cost=xxx rows=99 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 +99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=1099 width=16)
+ Merge Join (cost=xxx rows=1099 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 -99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=901 width=16)
+ Merge Join (cost=xxx rows=901 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 *99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=99000 width=16)
+ Merge Join (cost=xxx rows=99000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 *0.01) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=10 width=16)
+ Merge Join (cost=xxx rows=10 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #aa) */
-EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
INFO: hint syntax error at or near "aa"
DETAIL: Rows hint requires valid number as rows estimation.
LOG: pg_hint_plan:
error hint:
Rows(t1 t2 #aa)
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=1000 width=16)
+ Merge Join (cost=xxx rows=1000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 /99) */
-EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
INFO: hint syntax error at or near "/99"
DETAIL: Unrecognized rows value type notation.
LOG: pg_hint_plan:
error hint:
Rows(t1 t2 /99)
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=1000 width=16)
+ Merge Join (cost=xxx rows=1000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
-- round up to 1
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 -99999) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
WARNING: Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 -99999)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------
- Merge Join (cost=0.56..90.36 rows=1 width=16)
+ Merge Join (cost=xxx rows=1 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
-(4 rows)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+(5 rows)
-- complex join tree
+\o results/pg_hint_plan.tmpout
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join (cost=5.88..7.40 rows=10 width=24)
+ Merge Join (cost=xxx rows=10 width=xxx)
Merge Cond: (t1.id = t3.id)
- -> Merge Join (cost=0.56..90.36 rows=1000 width=16)
+ -> Merge Join (cost=xxx rows=1000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
- -> Sort (cost=5.32..5.57 rows=100 width=8)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
Sort Key: t3.id
- -> Seq Scan on t3 (cost=0.00..2.00 rows=100 width=8)
-(9 rows)
+ -> Seq Scan on t3 (cost=xxx rows=100 width=xxx)
+(10 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #22) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join (cost=5.88..10.48 rows=1 width=24)
+ Merge Join (cost=xxx rows=1 width=xxx)
Merge Cond: (t1.id = t3.id)
- -> Merge Join (cost=0.56..90.36 rows=22 width=16)
+ -> Merge Join (cost=xxx rows=22 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
- -> Sort (cost=5.32..5.57 rows=100 width=8)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
Sort Key: t3.id
- -> Seq Scan on t3 (cost=0.00..2.00 rows=100 width=8)
-(9 rows)
+ -> Seq Scan on t3 (cost=xxx rows=100 width=xxx)
+(10 rows)
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t3 *10) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
QUERY PLAN
------------------------------------------------------------------------------------
- Merge Join (cost=5.88..7.40 rows=100 width=24)
+ Merge Join (cost=xxx rows=100 width=xxx)
Merge Cond: (t1.id = t3.id)
- -> Merge Join (cost=0.56..90.36 rows=1000 width=16)
+ -> Merge Join (cost=xxx rows=1000 width=xxx)
Merge Cond: (t1.id = t2.id)
- -> Index Scan using t1_pkey on t1 (cost=0.29..318.29 rows=10000 width=8)
- -> Index Scan using t2_pkey on t2 (cost=0.28..43.27 rows=1000 width=8)
- -> Sort (cost=5.32..5.57 rows=100 width=8)
+ -> Index Scan using t1_pkey on t1 (cost=xxx rows=10000 width=xxx)
+ -> Index Scan using t2_pkey on t2 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
Sort Key: t3.id
- -> Seq Scan on t3 (cost=0.00..2.00 rows=100 width=8)
-(9 rows)
+ -> Seq Scan on t3 (cost=xxx rows=100 width=xxx)
+(10 rows)
+\! rm results/pg_hint_plan.tmpout
----
---- No. A-8-1 original GUC parameter
----
+---- Don't test postgresql itself.
-- No. A-8-1-1
-SET ROLE super_user;
-SET pg_hint_plan.debug_print TO off;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- error
-(1 row)
-
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
--- No. A-8-1-2
-SET ROLE normal_user;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- error
-(1 row)
-
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-SHOW pg_hint_plan.debug_print;
- pg_hint_plan.debug_print
---------------------------
- off
-(1 row)
-
-SHOW pg_hint_plan.parse_messages;
- pg_hint_plan.parse_messages
------------------------------
- info
-(1 row)
-
-RESET ROLE;
+-- SET ROLE super_user;
+-- SET pg_hint_plan.debug_print TO off;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- SET pg_hint_plan.enable_hint TO off;
+-- SET pg_hint_plan.debug_print TO on;
+-- SET pg_hint_plan.parse_messages TO error;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- RESET pg_hint_plan.enable_hint;
+-- RESET pg_hint_plan.debug_print;
+-- RESET pg_hint_plan.parse_messages;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+--
+-- -- No. A-8-1-2
+-- SET ROLE normal_user;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- SET pg_hint_plan.enable_hint TO off;
+-- SET pg_hint_plan.debug_print TO on;
+-- SET pg_hint_plan.parse_messages TO error;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- RESET pg_hint_plan.enable_hint;
+-- RESET pg_hint_plan.debug_print;
+-- RESET pg_hint_plan.parse_messages;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+--
+-- RESET ROLE;
----
---- No. A-8-2 original GUC parameter pg_hint_plan.enable_hint
----
-- No. A-8-2-1
+SET pg_hint_plan.debug_print TO off;
SET pg_hint_plan.enable_hint TO on;
SHOW pg_hint_plan.enable_hint;
pg_hint_plan.enable_hint
(2 rows)
-- No. A-8-2-3
-SET pg_hint_plan.enable_hint TO DEFAULT;
-SHOW pg_hint_plan.enable_hint;
- pg_hint_plan.enable_hint
---------------------------
- on
-(1 row)
-
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
- QUERY PLAN
-----------------------------------
- Bitmap Heap Scan on t1
- Recheck Cond: (c1 = 1)
- -> Bitmap Index Scan on t1_i1
- Index Cond: (c1 = 1)
-(4 rows)
-
+-- Don't test PostgreSQL itself.
+-- SET pg_hint_plan.enable_hint TO DEFAULT;
+-- SHOW pg_hint_plan.enable_hint;
+-- /*+Set(enable_indexscan off)*/
+-- EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-- No. A-8-2-4
-SET pg_hint_plan.enable_hint TO enable;
-ERROR: parameter "pg_hint_plan.enable_hint" requires a Boolean value
+-- Don't test PostgreSQL itself
+-- SET pg_hint_plan.enable_hint TO enable;
+-- SHOW pg_hint_plan.enable_hint;
+----
+---- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
+----
+-- No. A-8-3-1
+SET pg_hint_plan.enable_hint TO on;
SHOW pg_hint_plan.enable_hint;
pg_hint_plan.enable_hint
--------------------------
on
(1 row)
-----
----- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
-----
--- No. A-8-3-1
SET pg_hint_plan.debug_print TO on;
SHOW pg_hint_plan.debug_print;
pg_hint_plan.debug_print
Filter: (c1 = $0)
(13 rows)
+\o results/ut-J.tmpout
/*+MergeJoin(t1 t2)NestLoop(st1 st2)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-J.tmpout
QUERY PLAN
---------------------------------------------------------------------------------------------
- Nested Loop (cost=10000000077.03..10000000087.31 rows=1 width=29)
+ Nested Loop (cost=xxx rows=1 width=xxx)
InitPlan 1 (returns $1)
- -> Aggregate (cost=76.75..76.76 rows=1 width=4)
- -> Nested Loop (cost=0.28..76.50 rows=100 width=4)
- -> Seq Scan on t2 st2 (cost=0.00..2.00 rows=100 width=4)
- -> Index Only Scan using t1_i1 on t1 st1 (cost=0.28..0.74 rows=1 width=4)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 st2 (cost=xxx rows=100 width=xxx)
+ -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1 width=xxx)
Index Cond: (c1 = st2.c1)
- -> Index Scan using t1_i1 on t1 (cost=0.28..8.29 rows=1 width=15)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
Index Cond: (c1 = $1)
- -> Seq Scan on t2 (cost=0.00..2.25 rows=1 width=14)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
Filter: (c1 = $1)
-(11 rows)
+(12 rows)
--
-- There are cases where difference in the measured value and predicted value
-> Seq Scan on t2
(5 rows)
+\o results/ut-J.tmpout
/*+NestLoop(t1 t2)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-J.tmpout
QUERY PLAN
--------------------------------------------------------------------------
- Hash Full Join (cost=10000000003.25..10000000024.00 rows=1000 width=29)
+ Hash Full Join (cost=xxx rows=1000 width=xxx)
Hash Cond: (t1.c1 = t2.c1)
- -> Seq Scan on t1 (cost=0.00..16.00 rows=1000 width=15)
- -> Hash (cost=2.00..2.00 rows=100 width=14)
- -> Seq Scan on t2 (cost=0.00..2.00 rows=100 width=14)
-(5 rows)
+ -> Seq Scan on t1 (cost=xxx rows=1000 width=xxx)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(6 rows)
+\! rm results/ut-J.tmpout
SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
SET search_path TO public;
-\o results/R_sample.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_sample.out.log > results/R_sample.out
-\! diff expected/R_sample.out results/R_sample.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-1-1 specified pattern of the object name
----
-- No. R-1-1-1
-\o results/R_1-1-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-1.out.log > results/R_1-1-1.out
-\! diff expected/R_1-1-1.out results/R_1-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-1-2
-\o results/R_1-1-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-2.out.log > results/R_1-1-2.out
-\! diff expected/R_1-1-2.out results/R_1-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t_1.c1 = t_2.c1)
+ -> Index Scan using t1_i1 on t1 t_1 (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
-- No. R-1-1-3
-\o results/R_1-1-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t_1 t_2 #1)*/
EXPLAIN SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-3.out.log > results/R_1-1-3.out
-\! diff expected/R_1-1-3.out results/R_1-1-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t_1.c1 = t_2.c1)
+ -> Index Scan using t1_i1 on t1 t_1 (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
----
---- No. R-1-2 specified schema name in the hint option
----
-- No. R-1-2-1
-\o results/R_1-2-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-2-1.out.log > results/R_1-2-1.out
-\! diff expected/R_1-2-1.out results/R_1-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-2-2
-\o results/R_1-2-2.out.log
+\o results/ut-R.tmpout
/*+Rows(s1.t1 s1.t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-2-2.out.log > results/R_1-2-2.out
-\! diff expected/R_1-2-2.out results/R_1-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-1-3 table doesn't exist in the hint option
----
-- No. R-1-3-1
-\o results/R_1-3-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-3-1.out.log > results/R_1-3-1.out
-\! diff expected/R_1-3-1.out results/R_1-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-3-2
-\o results/R_1-3-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t3 t4 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-3-2.out.log > results/R_1-3-2.out
-\! diff expected/R_1-3-2.out results/R_1-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-1-4 conflict table name
----
-- No. R-1-4-1
-\o results/R_1-4-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-1.out.log > results/R_1-4-1.out
-\! diff expected/R_1-4-1.out results/R_1-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-4-2
-\o results/R_1-4-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t1_1.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
+\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)"
error hint:
Rows(t1 t1 #1)
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t1_1.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(s1.t1 s2.t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t1_1.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = s2t1.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: s2t1.c1
+ -> Seq Scan on t1 s2t1 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
+\o results/ut-R.tmpout
/*+Rows(t1 s2t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-2.out.log > results/R_1-4-2.out
-\! diff expected/R_1-4-2.out results/R_1-4-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = s2t1.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: s2t1.c1
+ -> Seq Scan on t1 s2t1 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-4-3
-\o results/R_1-4-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ InitPlan 1 (returns $0)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1_1.c1 = t2_1.c1)
+ -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2_1.c1
+ -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ InitPlan 1 (returns $0)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1_1.c1 = t2_1.c1)
+ -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2_1.c1
+ -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
+\o results/ut-R.tmpout
/*+Rows(st1 st2 #1)Rows(t1 t2 #1)*/
EXPLAIN SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-3.out.log > results/R_1-4-3.out
-\! diff expected/R_1-4-3.out results/R_1-4-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ InitPlan 1 (returns $0)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (st1.c1 = st2.c1)
+ -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: st2.c1
+ -> Seq Scan on t2 st2 (cost=xxx rows=100 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
----
---- No. R-1-5 conflict table name
----
-- No. R-1-5-1
-\o results/R_1-5-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-1.out.log > results/R_1-5-1.out
-\! diff expected/R_1-5-1.out results/R_1-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-5-2
-\o results/R_1-5-2.out.log
+\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)"
Rows(t1 t1 #1)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-2.out.log > results/R_1-5-2.out
-\! diff expected/R_1-5-2.out results/R_1-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-5-3
-\o results/R_1-5-3.out.log
+\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)"
DETAIL: Unrecognized hint keyword "".
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 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;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------------
+ 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(10 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)"
DETAIL: Unrecognized hint keyword "".
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-3.out.log > results/R_1-5-3.out
-\! diff expected/R_1-5-3.out results/R_1-5-3.out
+\! 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)
+ -> 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)
+
----
---- No. R-1-6 object type for the hint
----
-- No. R-1-6-1
-\o results/R_1-6-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-1.out.log > results/R_1-6-1.out
-\! diff expected/R_1-6-1.out results/R_1-6-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-6-2
-\o results/R_1-6-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=301 width=xxx)
+ Hash Cond: (t1.c1 = t2.c1)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 t1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p1c1 t1_1 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on p1c2 t1_2 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on p1c3 t1_3 (cost=xxx rows=100 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 t2 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-2.out.log > results/R_1-6-2.out
-\! diff expected/R_1-6-2.out results/R_1-6-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (t1.c1 = t2.c1)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 t1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p1c1 t1_1 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on p1c2 t1_2 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on p1c3 t1_3 (cost=xxx rows=100 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 t2 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
-- No. R-1-6-3
-\o results/R_1-6-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1100 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-3.out.log > results/R_1-6-3.out
-\! diff expected/R_1-6-3.out results/R_1-6-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------
+ 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)
+
-- No. R-1-6-4
CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
-\o results/R_1-6-4.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1100 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-4.out.log > results/R_1-6-4.out
-\! diff expected/R_1-6-4.out results/R_1-6-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------
+ 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)
+
-- No. R-1-6-5
-\o results/R_1-6-5.out.log
-EXPLAIN SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+CREATE TEMP TABLE t_pg_class WITH OIDS AS SELECT * from pg_class LIMIT 100;
+\o results/ut-R.tmpout
+EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=360 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
-EXPLAIN SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
LOG: pg_hint_plan:
used hint:
Rows(t1 t2 #1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-5.out.log > results/R_1-6-5.out
-\! diff expected/R_1-6-5.out results/R_1-6-5.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------
+ 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)
+
-- No. R-1-6-6
-- refer ut-fdw.sql
-- No. R-1-6-7
-\o results/R_1-6-7.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-7.out.log > results/R_1-6-7.out
-\! diff expected/R_1-6-7.out results/R_1-6-7.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+
-- No. R-1-6-8
-\o results/R_1-6-8.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=3 width=xxx)
+ Hash Cond: (t2.c1 = "*VALUES*".column1)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=3 width=xxx)
+ Hash Cond: (t2.c1 = "*VALUES*".column1)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(*VALUES* t2 #1)*/
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-8.out.log > results/R_1-6-8.out
-\! diff expected/R_1-6-8.out results/R_1-6-8.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (t2.c1 = "*VALUES*".column1)
+ -> 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)
+
-- No. R-1-6-9
-\o results/R_1-6-9.out.log
+\o results/ut-R.tmpout
EXPLAIN WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1_1.c1 = t2.c1)
+ -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)Rows(t1 c1 +1)*/
EXPLAIN WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-9.out.log > results/R_1-6-9.out
-\! diff expected/R_1-6-9.out results/R_1-6-9.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=2 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1_1.c1 = t2.c1)
+ -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+ -> 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)
+
-- No. R-1-6-10
-\o results/R_1-6-10.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (v1t1.c1 = v1t1_1.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)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (v1t1.c1 = v1t1_1.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)
+
+\o results/ut-R.tmpout
/*+Rows(v1t1 v1t1_ #1)*/
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1_ t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-10.out.log > results/R_1-6-10.out
-\! diff expected/R_1-6-10.out results/R_1-6-10.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (v1t1.c1 = v1t1_.c1)
+ -> 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)
+
-- No. R-1-6-11
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
QUERY PLAN
-------------------------------------------------------------------------------------------------
- Nested Loop (cost=12.28..22.56 rows=1 width=29)
+ Nested Loop (cost=xxx rows=1 width=xxx)
InitPlan 1 (returns $0)
- -> Aggregate (cost=12.00..12.01 rows=1 width=4)
- -> Merge Join (cost=5.60..11.75 rows=100 width=4)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
Merge Cond: (st1.c1 = st2.c1)
- -> Index Only Scan using t1_i1 on t1 st1 (cost=0.28..44.27 rows=1000 width=4)
- -> Sort (cost=5.32..5.57 rows=100 width=4)
+ -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
Sort Key: st2.c1
- -> Seq Scan on t2 st2 (cost=0.00..2.00 rows=100 width=4)
- -> Index Scan using t1_i1 on t1 (cost=0.28..8.29 rows=1 width=15)
+ -> Seq Scan on t2 st2 (cost=xxx rows=100 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
Index Cond: (c1 = $0)
- -> Seq Scan on t2 (cost=0.00..2.25 rows=1 width=14)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
Filter: (c1 = $0)
-(13 rows)
+(14 rows)
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)Rows(st1 st2 #1)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
QUERY PLAN
-------------------------------------------------------------------------------------------------
- Nested Loop (cost=12.03..22.31 rows=1 width=29)
+ Nested Loop (cost=xxx rows=1 width=xxx)
InitPlan 1 (returns $0)
- -> Aggregate (cost=11.75..11.76 rows=1 width=4)
- -> Merge Join (cost=5.60..11.75 rows=1 width=4)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
Merge Cond: (st1.c1 = st2.c1)
- -> Index Only Scan using t1_i1 on t1 st1 (cost=0.28..44.27 rows=1000 width=4)
- -> Sort (cost=5.32..5.57 rows=100 width=4)
+ -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
Sort Key: st2.c1
- -> Seq Scan on t2 st2 (cost=0.00..2.00 rows=100 width=4)
- -> Index Scan using t1_i1 on t1 (cost=0.28..8.29 rows=1 width=15)
+ -> Seq Scan on t2 st2 (cost=xxx rows=100 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
Index Cond: (c1 = $0)
- -> Seq Scan on t2 (cost=0.00..2.25 rows=1 width=14)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
Filter: (c1 = $0)
-(13 rows)
+(14 rows)
--
-- There are cases where difference in the measured value and predicted value
-- depending upon the version of PostgreSQL
--
-\o results/R_1-6-11.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
+\o results/ut-R.tmpout
/*+Rows(t1 st2 #1)*/
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-11.out.log > results/R_1-6-11.out
-\! diff expected/R_1-6-11.out results/R_1-6-11.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-1-7 specified number of conditions
----
-- No. R-1-7-1
-\o results/R_1-7-1.out.log
+\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 ""
Rows(t1 #1)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-1.out.log > results/R_1-7-1.out
-\! diff expected/R_1-7-1.out results/R_1-7-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-7-2
-\o results/R_1-7-2.out.log
+\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"
Rows(t1 t2 1)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-2.out.log > results/R_1-7-2.out
-\! diff expected/R_1-7-2.out results/R_1-7-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-1-7-3
-\o results/R_1-7-3.out.log
+\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"
Rows(t1 t2 #notrows)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-3.out.log > results/R_1-7-3.out
-\! diff expected/R_1-7-3.out results/R_1-7-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-2-1 some complexity query blocks
----
-- No. R-2-1-1
-\o results/R_2-1-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 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)
+(45 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-1.out.log > results/R_2-1-1.out
-\! diff expected/R_2-1-1.out results/R_2-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 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)
+(45 rows)
+
-- No. R-2-1-2
-\o results/R_2-1-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 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)
+(59 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-2.out.log > results/R_2-1-2.out
-\! diff expected/R_2-1-2.out results/R_2-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 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)
+(59 rows)
+
-- No. R-2-1-3
-\o results/R_2-1-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ 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 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+(16 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 #1)Rows(bmt4 bmt3 bmt2 #1)Rows(bmt1 bmt2 bmt3 bmt4 #1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-3.out.log > results/R_2-1-3.out
-\! diff expected/R_2-1-3.out results/R_2-1-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (bmt2.c1 = bmt1.c1)
+ -> 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)
+ -> 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)
+
-- No. R-2-1-4
-\o results/R_2-1-4.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ 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 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+(16 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 #1)Rows(bmt4 bmt3 bmt2 #1)Rows(bmt1 bmt2 bmt3 bmt4 #1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-4.out.log > results/R_2-1-4.out
-\! diff expected/R_2-1-4.out results/R_2-1-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (bmt2.c1 = bmt1.c1)
+ -> 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)
+ -> 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)
+
-- No. R-2-1-5
-\o results/R_2-1-5.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t2 b1t3)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=998 width=xxx)
+ Filter: ((c1 <> $1) AND (c1 <> $3))
+ -> 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)
+(46 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-5.out.log > results/R_2-1-5.out
-\! diff expected/R_2-1-5.out results/R_2-1-5.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=998 width=xxx)
+ Filter: ((c1 <> $1) AND (c1 <> $3))
+ -> 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)
+(46 rows)
+
-- No. R-2-1-6
-\o results/R_2-1-6.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=997 width=xxx)
+ Filter: ((c1 <> $1) AND (c1 <> $3) AND (c1 <> $5))
+ -> 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)
+(60 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-6.out.log > results/R_2-1-6.out
-\! diff expected/R_2-1-6.out results/R_2-1-6.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ InitPlan 1 (returns $1)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=997 width=xxx)
+ Filter: ((c1 <> $1) AND (c1 <> $3) AND (c1 <> $5))
+ -> 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)
+(60 rows)
+
-- No. R-2-1-7
-\o results/R_2-1-7.out.log
+\o results/ut-R.tmpout
/*+
Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ CTE c2
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> 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)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt1.c1
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (bmt1.c1 = c1.c1)
+ -> Seq Scan on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (c1.c1 = c2.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c1.c1
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c2.c1
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
, c1, c2
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
+AND bmt1.c1 = c2.c1;
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t2 b1t3)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-7.out.log > results/R_2-1-7.out
-\! diff expected/R_2-1-7.out results/R_2-1-7.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ CTE c2
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt1.c1
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (bmt1.c1 = c1.c1)
+ -> Seq Scan on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (c1.c1 = c2.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c1.c1
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c2.c1
+ -> 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)
+
-- No. R-2-1-8
-\o results/R_2-1-8.out.log
+\o results/ut-R.tmpout
/*+
Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
+AND bmt1.c1 = c3.c1;
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t2 b1t3)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ CTE c2
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> 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 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)
+ -> 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)
+ 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt1.c1
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (c2.c1 = c1.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (c2.c1 = c3.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c2.c1
+ -> CTE Scan on c2 (cost=xxx rows=1 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c3.c1
+ -> CTE Scan on c3 (cost=xxx rows=1 width=xxx)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = c1.c1)
+ -> 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)
+(75 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
+AND bmt1.c1 = c3.c1;
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t2 b1t3)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-8.out.log > results/R_2-1-8.out
-\! diff expected/R_2-1-8.out results/R_2-1-8.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ CTE c2
+ -> Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (b2t1.c1 = b2t3.c1)
+ -> Seq Scan on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> 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)
+ -> 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)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt1.c1
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (c2.c1 = c1.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (c2.c1 = c3.c1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c2.c1
+ -> CTE Scan on c2 (cost=xxx rows=1 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c3.c1
+ -> CTE Scan on c3 (cost=xxx rows=1 width=xxx)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = c1.c1)
+ -> 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)
+(75 rows)
+
----
---- No. R-2-2 the number of the tables per quiry block
----
-- No. R-2-2-1
-\o results/R_2-2-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt1)
*/
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1 WHERE b3t1.c1 = 1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
Leading(c1 bmt1)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 2 (returns $1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 3 (returns $2)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ Filter: (c1 <> $2)
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ Filter: (c1 = 1)
+(16 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt1)
Rows(bmt1 c1 #1)
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1 WHERE b3t1.c1 = 1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
Leading(c1 bmt1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-1.out.log > results/R_2-2-1.out
-\! diff expected/R_2-2-1.out results/R_2-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ CTE c1
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 2 (returns $1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 3 (returns $2)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ Filter: (c1 <> $2)
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+ Filter: (c1 = 1)
+(16 rows)
+
-- No. R-2-2-2
-\o results/R_2-2-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt2 bmt1)
Leading(b1t2 b1t1)
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.c1 = b3t2.c1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t1 b1t2)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=10 width=xxx)
+ Hash Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=xxx)
+ InitPlan 2 (returns $1)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b2t2.c1
+ -> Seq Scan on t2 b2t2 (cost=xxx rows=100 width=xxx)
+ InitPlan 3 (returns $2)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b3t1.c1 = b3t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b3t2.c1
+ -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t1 bmt1 (cost=xxx rows=999 width=xxx)
+ Filter: (c1 <> $2)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (bmt2.c1 = c1.c1)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: bmt2.c1
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: c1.c1
+ -> CTE Scan on c1 (cost=xxx rows=100 width=xxx)
+(35 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt2 bmt1)
Leading(b1t2 b1t1)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-2.out.log > results/R_2-2-2.out
-\! diff expected/R_2-2-2.out results/R_2-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b1t2.c1
+ -> Seq Scan on t2 b1t2 (cost=xxx rows=100 width=xxx)
+ InitPlan 2 (returns $1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b2t2.c1
+ -> Seq Scan on t2 b2t2 (cost=xxx rows=100 width=xxx)
+ InitPlan 3 (returns $2)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b3t1.c1 = b3t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: b3t2.c1
+ -> Seq Scan on t2 b3t2 (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t1 bmt1 (cost=xxx rows=999 width=xxx)
+ Filter: (c1 <> $2)
+ -> Hash (cost=xxx rows=1 width=xxx)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt2.c1 = c1.c1)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: bmt2.c1
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: c1.c1
+ -> CTE Scan on c1 (cost=xxx rows=1 width=xxx)
+(35 rows)
+
-- No. R-2-2-3
-\o results/R_2-2-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.c1 = b3t2.c1 AND b3t1.c1 = b3t3.c1 AND b3t1.c1 = b3t4.c1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
HashJoin(b1t3 b1t4)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=10 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> Index Only Scan using t2_i1 on t2 b1t2 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = b2t3.c1)
+ InitPlan 3 (returns $5)
+ -> Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (b3t1.c1 = b3t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> 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 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)
+ -> 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)
+ Filter: (c1 <> $5)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: bmt2.c1
+ -> 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)
+ -> 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)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.c1 = b3t2.c1 AND b3t1.c1 = b3t3.c1 AND b3t1.c1 = b3t4.c1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
HashJoin(b1t3 b1t4)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-3.out.log > results/R_2-2-3.out
-\! diff expected/R_2-2-3.out results/R_2-2-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: b1t2.c1
+ -> 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)
+ -> Index Only Scan using t2_i1 on t2 b1t2 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $3)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: b2t2.c1
+ -> 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)
+ -> Index Only Scan using t2_i1 on t2 b2t2 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = b2t3.c1)
+ InitPlan 3 (returns $5)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b3t1.c1 = b3t2.c1)
+ -> Index Only Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: b3t2.c1
+ -> 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)
+ -> 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)
+ Filter: (c1 <> $5)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt2.c1
+ -> 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=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)
+ -> 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)
+
-- No. R-2-2-4
-\o results/R_2-2-4.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t3 b1t4)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=10 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Nested Loop (cost=xxx rows=100 width=xxx)
+ 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 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)
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $2)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 3 (returns $3)
+ -> Seq Scan on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=xxx)
+ Filter: (c1 <> $3)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: bmt2.c1
+ -> 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)
+ -> 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)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1
-)
-;
+);
LOG: pg_hint_plan:
used hint:
MergeJoin(b1t3 b1t4)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-4.out.log > results/R_2-2-4.out
-\! diff expected/R_2-2-4.out results/R_2-2-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ CTE c1
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t2.c1 = b1t1.c1)
+ -> Hash Join (cost=xxx rows=1 width=xxx)
+ 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)
+ -> 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)
+ Index Cond: (c1 = b1t3.c1)
+ InitPlan 2 (returns $2)
+ -> Index Only Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = 1)
+ InitPlan 3 (returns $3)
+ -> Seq Scan on t1 b3t1 (cost=xxx rows=1000 width=xxx)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=999 width=xxx)
+ Filter: (c1 <> $3)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ Sort Key: bmt2.c1
+ -> 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=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)
+ -> 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)
+
----
---- No. R-2-3 RULE or VIEW
----
-- No. R-2-3-1
-\o results/R_2-3-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(r1 t1 t2 t3 t4)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r1 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(21 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r1 t1 t2 t3 t4)
Rows(r1 t1 t2 t3 t4 #2)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r1 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(19 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r1_ b1t1 b1t2 b1t3 b1t4)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r1_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(21 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r1_ b1t1 b1t2 b1t3 b1t4)
Rows(r1_ b1t1 b1t2 b1t3 b1t4 #2)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-1.out.log > results/R_2-3-1.out
-\! diff expected/R_2-3-1.out results/R_2-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t2.c1)
+ -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r1_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(19 rows)
+
-- No. R-2-3-2
-\o results/R_2-3-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(r2 t1 t2 t3 t4)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(43 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r2 t1 t2 t3 t4)
Rows(r2 t1 t2 t3 t4 #2)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(39 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r2_ b1t1 b1t2 b1t3 b1t4)
Leading(r2_ b2t1 b2t2 b2t3 b2t4)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b2t1.c1 = b2t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b2t1.c1 = b2t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(43 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r2_ b1t1 b1t2 b1t3 b1t4)
Leading(r2_ b2t1 b2t2 b2t3 b2t4)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-2.out.log > results/R_2-3-2.out
-\! diff expected/R_2-3-2.out results/R_2-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t2.c1)
+ -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b2t1.c1 = b2t3.c1)
+ -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b2t1.c1 = b2t2.c1)
+ -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r2_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(39 rows)
+
-- No. R-2-3-3
-\o results/R_2-3-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(r3 t1 t2 t3 t4)
*/
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(65 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r3 t1 t2 t3 t4)
Rows(r3 t1 t2 t3 t4 #2)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (t1.c1 = t3.c1)
+ -> Tid Scan on t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (t1.c1 = t2.c1)
+ -> Seq Scan on t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3 (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(59 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r3_ b1t1 b1t2 b1t3 b1t4)
Leading(r3_ b2t1 b2t2 b2t3 b2t4)
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b1t1.c1 = b1t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b2t1.c1 = b2t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b2t1.c1 = b2t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b2t1.c1 = b2t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b3t1.c1 = b3t4.c1)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (b3t1.c1 = b3t3.c1)
+ -> Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (b3t1.c1 = b3t2.c1)
+ -> Nested Loop (cost=xxx rows=6 width=xxx)
+ -> Index Scan using t1_i1 on t1 b3t1 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+ -> Sort (cost=xxx rows=1 width=xxx)
+ 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)
+(65 rows)
+
+\o results/ut-R.tmpout
/*+
Leading(r3_ b1t1 b1t2 b1t3 b1t4)
Leading(r3_ b2t1 b2t2 b2t3 b2t4)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-3.out.log > results/R_2-3-3.out
-\! diff expected/R_2-3-3.out results/R_2-3-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------------------
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t3.c1)
+ -> Tid Scan on t3 b1t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b1t1.c1 = b1t2.c1)
+ -> Seq Scan on t2 b1t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b1t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b2t1.c1 = b2t3.c1)
+ -> Tid Scan on t3 b2t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b2t1.c1 = b2t2.c1)
+ -> Seq Scan on t2 b2t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b2t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+
+ Aggregate (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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=2 width=xxx)
+ Join Filter: (b3t1.c1 = b3t3.c1)
+ -> Tid Scan on t3 b3t3 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ Join Filter: (b3t1.c1 = b3t2.c1)
+ -> Seq Scan on t2 b3t2 (cost=xxx rows=1 width=xxx)
+ Filter: (ctid = '(1,1)'::tid)
+ -> Nested Loop (cost=xxx rows=2 width=xxx)
+ -> Tid Scan on t1 b3t1 (cost=xxx rows=1 width=xxx)
+ TID Cond: (ctid = '(1,1)'::tid)
+ -> Seq Scan on r3_ (cost=xxx rows=6 width=xxx)
+ Filter: (c1 = 1)
+(59 rows)
+
-- No. R-2-3-4
-\o results/R_2-3-4.out.log
+\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)"
error hint:
HashJoin(v1t1 v1t1)
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (v1t1.c1 = v1t1_1.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)
+
+\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)"
Rows(v1t1 v1t1 #1)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-4.out.log > results/R_2-3-4.out
-\! diff expected/R_2-3-4.out results/R_2-3-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (v1t1.c1 = v1t1_1.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)
+
-- No. R-2-3-5
-\o results/R_2-3-5.out.log
+\o results/ut-R.tmpout
/*+NestLoop(v1t1 v1t1_)*/
EXPLAIN SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+NestLoop(v1t1 v1t1_)Rows(v1t1 v1t1_ #1)*/
EXPLAIN SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-5.out.log > results/R_2-3-5.out
-\! diff expected/R_2-3-5.out results/R_2-3-5.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ -> 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)
+
-- No. R-2-3-6
-\o results/R_2-3-6.out.log
+\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)"
DETAIL: Unrecognized hint keyword "RowsHashJoin".
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (r4t1.c1 = r4t1_1.c1)
+ -> 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)
+
+\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)"
DETAIL: Unrecognized hint keyword "RowsHashJoin".
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-6.out.log > results/R_2-3-6.out
-\! diff expected/R_2-3-6.out results/R_2-3-6.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1000 width=xxx)
+ Hash Cond: (r4t1.c1 = r4t1_1.c1)
+ -> 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)
+
-- No. R-2-3-7
-\o results/R_2-3-7.out.log
+\o results/ut-R.tmpout
/*+NestLoop(r4t1 r5t1)*/
EXPLAIN SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1000 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+NestLoop(r4t1 r5t1)Rows(r4t1 r5t1 #1)*/
EXPLAIN SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-7.out.log > results/R_2-3-7.out
-\! diff expected/R_2-3-7.out results/R_2-3-7.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ -> 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)
+
----
---- No. R-2-4 VALUES clause
----
-- No. R-2-4-1
-\o results/R_2-4-1.out.log
+\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;
+\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 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)
+(9 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;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\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 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)
+(9 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;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-4-1.out.log > results/R_2-4-1.out
-\! diff expected/R_2-4-1.out results/R_2-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=2 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 = "*VALUES*".column1)
+ -> Index Scan using t2_i1 on t2 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = t1.c1)
+(8 rows)
+
-- No. R-2-4-2
-\o results/R_2-4-2.out.log
+\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;
+\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)
+ 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)
+(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;
LOG: pg_hint_plan:
duplication hint:
error hint:
+\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)
+ 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)
+(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)"
Rows(*VALUES* t1 t2 t3 #2)
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-4-2.out.log > results/R_2-4-2.out
-\! diff expected/R_2-4-2.out results/R_2-4-2.out
+\! 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)
+ 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)
+(12 rows)
+
----
---- No. R-2-5
----
-- No. R-2-5-1
-\o results/R_2-5-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------
+ 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)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt1 bmt2 bmt3 bmt4 *0.7)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-1.out.log > results/R_2-5-1.out
-\! diff expected/R_2-5-1.out results/R_2-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=70 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ 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 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
-- No. R-2-5-2
-\o results/R_2-5-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ 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)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 *0.6)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-2.out.log > results/R_2-5-2.out
-\! diff expected/R_2-5-2.out results/R_2-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=60 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=60 width=xxx)
+ 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 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
-- No. R-2-5-3
-\o results/R_2-5-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ 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)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt1 *0.5)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-3.out.log > results/R_2-5-3.out
-\! diff expected/R_2-5-3.out results/R_2-5-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=50 width=xxx)
+ Merge Cond: (bmt1.c1 = bmt2.c1)
+ -> Index Only Scan using t1_i1 on t1 bmt1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ 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 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)
+ -> Hash (cost=xxx rows=100 width=xxx)
+ -> Seq Scan on t2 bmt2 (cost=xxx rows=100 width=xxx)
+(15 rows)
+
----
---- No. R-3-1 abusolute value
----
-- No. R-3-1-1
-\o results/R_3-1-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #0)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
WARNING: Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 #0)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-1.out.log > results/R_3-1-1.out
-\! diff expected/R_3-1-1.out results/R_3-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-1-2
-\o results/R_3-1-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #5)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-2.out.log > results/R_3-1-2.out
-\! diff expected/R_3-1-2.out results/R_3-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=5 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-3-2 increase or decrease value
----
-- No. R-3-2-1
-\o results/R_3-2-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 +1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-1.out.log > results/R_3-2-1.out
-\! diff expected/R_3-2-1.out results/R_3-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=101 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-2-2
-\o results/R_3-2-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 -1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-2.out.log > results/R_3-2-2.out
-\! diff expected/R_3-2-2.out results/R_3-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=99 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-2-3
-\o results/R_3-2-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 -1000)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
WARNING: Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 -1000)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-3.out.log > results/R_3-2-3.out
-\! diff expected/R_3-2-3.out results/R_3-2-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-3-3 multiple
----
-- No. R-3-3-1
-\o results/R_3-3-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *0)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
WARNING: Force estimate to be at least one row, to avoid possible divide-by-zero when interpolating costs : Rows(t1 t2 *0)
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-1.out.log > results/R_3-3-1.out
-\! diff expected/R_3-3-1.out results/R_3-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-3-2
-\o results/R_3-3-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *2)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-2.out.log > results/R_3-3-2.out
-\! diff expected/R_3-3-2.out results/R_3-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=200 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-3-3
-\o results/R_3-3-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *0.1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-3.out.log > results/R_3-3-3.out
-\! diff expected/R_3-3-3.out results/R_3-3-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=10 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-3-4 join inherit tables
----
-- No. R-3-4-1
-\o results/R_3-4-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=301 width=xxx)
+ Hash Cond: (p2.c1 = p1.c1)
+ -> Append (cost=xxx rows=304 width=xxx)
+ -> Seq Scan on p2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c3 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(p1 p2 #1)*/
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-4-1.out.log > results/R_3-4-1.out
-\! diff expected/R_3-4-1.out results/R_3-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=1 width=xxx)
+ Hash Cond: (p2.c1 = p1.c1)
+ -> Append (cost=xxx rows=304 width=xxx)
+ -> Seq Scan on p2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c3 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
-- No. R-3-4-2
-\o results/R_3-4-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=301 width=xxx)
+ Hash Cond: (p2.c1 = p1.c1)
+ -> Append (cost=xxx rows=304 width=xxx)
+ -> Seq Scan on p2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c3 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
+\o results/ut-R.tmpout
/*+Rows(p1c1 p2c1 #1)*/
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-4-2.out.log > results/R_3-4-2.out
-\! diff expected/R_3-4-2.out results/R_3-4-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Hash Join (cost=xxx rows=301 width=xxx)
+ Hash Cond: (p2.c1 = p1.c1)
+ -> Append (cost=xxx rows=304 width=xxx)
+ -> Seq Scan on p2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c2 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c3 (cost=xxx rows=1 width=xxx)
+ -> Seq Scan on p2c1c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c1c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c2c2 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c1 (cost=xxx rows=50 width=xxx)
+ -> Seq Scan on p2c3c2 (cost=xxx rows=50 width=xxx)
+ -> Hash (cost=xxx rows=301 width=xxx)
+ -> Append (cost=xxx rows=301 width=xxx)
+ -> Seq Scan on p1 (cost=xxx rows=1 width=xxx)
+ -> 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)
+
----
---- No. R-3-5 conflict join method hint
----
-- No. R-3-5-1
-\o results/R_3-5-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 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)"
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-1.out.log > results/R_3-5-1.out
-\! diff expected/R_3-5-1.out results/R_3-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-5-2
-\o results/R_3-5-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 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)"
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-2.out.log > results/R_3-5-2.out
-\! diff expected/R_3-5-2.out results/R_3-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-5-3
-\o results/R_3-5-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 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)"
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-3.out.log > results/R_3-5-3.out
-\! diff expected/R_3-5-3.out results/R_3-5-3.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
-- No. R-3-5-4
-\o results/R_3-5-4.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 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)"
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-4.out.log > results/R_3-5-4.out
-\! diff expected/R_3-5-4.out results/R_3-5-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=1 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
----
---- No. R-3-6 hint state output
----
-- No. R-3-6-1
SET client_min_messages TO DEBUG1;
-\o results/R_3-6-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=100 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 +1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
DEBUG: adjusted rows 100 to 101
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-6-1.out.log > results/R_3-6-1.out
-\! diff expected/R_3-6-1.out results/R_3-6-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Merge Join (cost=xxx rows=101 width=xxx)
+ Merge Cond: (t1.c1 = t2.c1)
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=xxx)
+ -> Sort (cost=xxx rows=100 width=xxx)
+ Sort Key: t2.c1
+ -> Seq Scan on t2 (cost=xxx rows=100 width=xxx)
+(7 rows)
+
+\! rm results/ut-R.tmpout
LOAD 'pg_hint_plan';
+-- We cannot do ALTER USER current_user SET ...
+DELETE FROM pg_db_role_setting WHERE setrole = (SELECT oid FROM pg_roles WHERE rolname = current_user);
+INSERT INTO pg_db_role_setting (SELECT 0, (SELECT oid FROM pg_roles WHERE rolname = current_user), '{client_min_messages=log,pg_hint_plan.debug_print=on}');
+ALTER SYSTEM SET session_preload_libraries TO 'pg_hint_plan';
+\! pg_ctl reload
+server signaled
SET pg_hint_plan.enable_hint TO on;
SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
---- No. S-3-5 not used index
----
-- No. S-3-5-1
-/*+IndexScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for IndexScan(ti1): ti1_pred
LOG: pg_hint_plan:
used hint:
------------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-2
-/*+BitmapScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+BitmapScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for BitmapScan(ti1): ti1_pred
LOG: pg_hint_plan:
used hint:
------------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-3
-/*+IndexOnlyScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexOnlyScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for IndexOnlyScan(ti1): ti1_pred
LOG: pg_hint_plan:
used hint:
-----------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=4)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-4
-/*+IndexScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for IndexScan(ti1):
LOG: pg_hint_plan:
used hint:
------------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-5
-/*+BitmapScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+BitmapScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for BitmapScan(ti1):
LOG: pg_hint_plan:
used hint:
------------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-6
-/*+IndexOnlyScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexOnlyScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
LOG: available indexes for IndexOnlyScan(ti1):
LOG: pg_hint_plan:
used hint:
-----------------------------------------------------------------------
Seq Scan on ti1 (cost=10000000000.00..10000000018.50 rows=1 width=4)
Filter: (c1 = 100)
-(2 rows)
+(3 rows)
-- No. S-3-5-7
EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
Index Cond: (c1 = 1)
(2 rows)
-/*+TidScan(t1)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+\! psql contrib_regression -c "/*+TidScan(t1)*/ EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1" | grep -v "Planning time:"
LOG: pg_hint_plan:
used hint:
TidScan(t1)
-----------------------------------------------------------------------
Seq Scan on t1 (cost=10000000000.00..10000000018.50 rows=1 width=15)
Filter: (c1 = 1)
-(2 rows)
+(3 rows)
----
---- No. S-3-6 query structure
(7 rows)
-- No. S-3-10-3
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
+\! psql contrib_regression -c "EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10" | grep -v "Planning time:"
QUERY PLAN
----------------------------------------------------------
Append (cost=0.00..2.75 rows=4 width=10)
Filter: ((c1 < 10) AND ((c2 * 2) < 100))
-> Seq Scan on p1c1 (cost=0.00..2.75 rows=3 width=2)
Filter: ((c1 < 10) AND ((c2 * 2) < 100))
-(5 rows)
+(6 rows)
-/*+IndexScan(p1 p1_parent)*/
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
+\! psql contrib_regression -c "/*+IndexScan(p1 p1_parent)*/ EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10" | grep -v "Planning time:"
LOG: available indexes for IndexScan(p1): p1_parent
LOG: available indexes for IndexScan(p1c1): p1c1_c4_expr_idx
LOG: available indexes for IndexScan(p1c2): p1c2_c4_expr_idx
Filter: ((c2 * 2) < 100)
-> Index Scan using p1c1_c4_expr_idx on p1c1 (cost=0.14..12.34 rows=3 width=2)
Filter: ((c2 * 2) < 100)
-(5 rows)
+(6 rows)
-- No. S-3-10-4
-/*+IndexScan(p1 p1_i2)*/
-EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1;
+\! psql contrib_regression -c "/*+IndexScan(p1 p1_i2)*/ EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1" | grep -v "Planning time:"
LOG: available indexes for IndexScan(p1): p1_i2
LOG: available indexes for IndexScan(p1c1):
LOG: available indexes for IndexScan(p1c2):
Filter: (c2 = 1)
-> Seq Scan on p1c3 (cost=10000000000.00..10000000002.25 rows=1 width=4)
Filter: (c2 = 1)
-(9 rows)
+(10 rows)
-- No. S-3-10-5
-/*+IndexScan(p2 p2c1_pkey)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
+\! psql contrib_regression -c "/*+IndexScan(p2 p2c1_pkey)*/ EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1" | grep -v "Planning time:"
LOG: available indexes for IndexScan(p2):
LOG: available indexes for IndexScan(p2c1): p2c1_pkey
LOG: available indexes for IndexScan(p2c2):
Index Cond: (c1 = 1)
-> Seq Scan on p2c1c1 (cost=10000000000.00..10000000001.62 rows=1 width=14)
Filter: (c1 = 1)
-(7 rows)
+(8 rows)
----
---- No. S-3-12 specified same table
Filter: (c2 = 1)
(2 rows)
+DELETE FROM pg_db_role_setting WHERE setrole = (SELECT oid FROM pg_roles WHERE rolname = current_user);
+ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
+\! pg_ctl reload
+server signaled
----
-- No. R-1-6-6
-\o results/R_1-6-6.out.log
+\o results/ut-fdw.tmpout
/*+Rows(ft_1 ft_2 #1)Leading(ft_1 ft_2 t1)*/
EXPLAIN SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-6.out.log > results/R_1-6-6.out_2.log
-\! sed 's/Foreign File: .*/Foreign File: @pg_hint_plan@\/data\/data.csv/' results/R_1-6-6.out_2.log > results/R_1-6-6.out
-\! diff expected/R_1-6-6.out results/R_1-6-6.out
-
+\! sql/maskout.sh results/ut-fdw.tmpout
+\! rm results/ut-fdw.tmpout
---- No. R-1-6 object type for the hint
----
-- No. R-1-6-6
-\o results/R_1-6-6.out.log
+\o results/ut-fdw.tmpout
/*+Rows(ft_1 ft_2 #1)Leading(ft_1 ft_2 t1)*/
EXPLAIN SELECT * FROM s1.t1, ft1 ft_1, ft1 ft_2 WHERE t1.c1 = ft_1.id AND t1.c1 = ft_2.id;
LOG: pg_hint_plan:
error hint:
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-6.out.log > results/R_1-6-6.out_2.log
-\! sed 's/Foreign File: .*/Foreign File: @pg_hint_plan@\/data\/data.csv/' results/R_1-6-6.out_2.log > results/R_1-6-6.out
-\! diff expected/R_1-6-6.out results/R_1-6-6.out
+\! sql/maskout.sh results/ut-fdw.tmpout
+ Nested Loop (cost=xxx rows=1 width=xxx)
+ -> Nested Loop (cost=xxx rows=1 width=xxx)
+ Join Filter: (ft_1.id = ft_2.id)
+ -> Foreign Scan on ft1 ft_1 (cost=xxx rows=1 width=xxx)
+ Foreign File: @abs_srcdir@/data/data.csv
+ Foreign File Size: 42
+ -> Foreign Scan on ft1 ft_2 (cost=xxx rows=1 width=xxx)
+ Foreign File: @abs_srcdir@/data/data.csv
+ Foreign File Size: 42
+ -> Index Scan using t1_i1 on t1 (cost=xxx rows=1 width=xxx)
+ Index Cond: (c1 = ft_1.id)
+
+\! rm results/ut-fdw.tmpout
* Track statement execution times across a whole database cluster.
*
* Execution costs are totalled for each distinct source query, and kept in
- * a shared hashtable. (We track only as many distinct queries as will fit
+ * a shared hashtable. (We track only as many distinct queries as will fit
* in the designated amount of shared memory.)
*
* As of Postgres 9.2, this module normalizes query entries. Normalization
*
* Normalization is implemented by fingerprinting queries, selectively
* serializing those fields of each query tree's nodes that are judged to be
- * essential to the query. This is referred to as a query jumble. This is
+ * essential to the query. This is referred to as a query jumble. This is
* distinct from a regular serialization in that various extraneous
* information is ignored as irrelevant or not essential to the query, such
* as the collations of Vars and, most notably, the values of constants.
* tree(s) generated from the query. The executor can then use this value
* to blame query costs on the proper queryId.
*
+ * To facilitate presenting entries to users, we create "representative" query
+ * strings in which constants are replaced with '?' characters, to make it
+ * clearer what a normalized entry can represent. To save on shared memory,
+ * and to avoid having to truncate oversized query strings, we store these
+ * strings in a temporary external query-texts file. Offsets into this
+ * file are kept in shared memory.
+ *
* Note about locking issues: to create or delete an entry in the shared
* hashtable, one must hold pgss->lock exclusively. Modifying any field
* in an entry except the counters requires the same. To look up an entry,
* one must hold the lock shared. To read or update the counters within
* an entry, one must hold the lock shared or exclusive (so the entry doesn't
* disappear!) and also take the entry's mutex spinlock.
+ * The shared state variable pgss->extent (the next free spot in the external
+ * query-text file) should be accessed only while holding either the
+ * pgss->mutex spinlock, or exclusive lock on pgss->lock. We use the mutex to
+ * allow reserving file space while holding only shared lock on pgss->lock.
+ * Rewriting the entire external query-text file, eg for garbage collection,
+ * requires holding pgss->lock exclusively; this allows individual entries
+ * in the file to be read or written while holding only shared lock.
*
*
* Copyright (c) 2008-2014, PostgreSQL Global Development Group
*/
#include "postgres.h"
-#ifdef NOT_USED
+#include <sys/stat.h>
+#ifdef NOT_USED
#include <unistd.h>
-
#endif
+
#include "access/hash.h"
#ifdef NOT_USED
#include "executor/instrument.h"
#include "storage/spin.h"
#include "tcop/utility.h"
#include "utils/builtins.h"
+#include "utils/memutils.h"
PG_MODULE_MAGIC;
-/* Location of stats file */
-#define PGSS_DUMP_FILE "global/pg_stat_statements.stat"
+/* Location of permanent stats file (valid when database is shut down) */
+#define PGSS_DUMP_FILE PGSTAT_STAT_PERMANENT_DIRECTORY "/pg_stat_statements.stat"
-/* This constant defines the magic number in the stats file header */
-static const uint32 PGSS_FILE_HEADER = 0x20120328;
+/*
+ * Location of external query text file. We don't keep it in the core
+ * system's stats_temp_directory. The core system can safely use that GUC
+ * setting, because the statistics collector temp file paths are set only once
+ * as part of changing the GUC, but pg_stat_statements has no way of avoiding
+ * race conditions. Besides, we only expect modest, infrequent I/O for query
+ * strings, so placing the file on a faster filesystem is not compelling.
+ */
+#define PGSS_TEXT_FILE PG_STAT_TMP_DIR "/pgss_query_texts.stat"
+
+/* Magic number identifying the stats file format */
+static const uint32 PGSS_FILE_HEADER = 0x20140125;
+
+/* PostgreSQL major version number, changes in which invalidate all entries */
+static const uint32 PGSS_PG_MAJOR_VERSION = PG_VERSION_NUM / 100;
/* XXX: Should USAGE_EXEC reflect execution time and/or buffer usage? */
#define USAGE_EXEC(duration) (1.0)
#define USAGE_INIT (1.0) /* including initial planning */
#define ASSUMED_MEDIAN_INIT (10.0) /* initial assumed median usage */
+#define ASSUMED_LENGTH_INIT 1024 /* initial assumed mean query length */
#define USAGE_DECREASE_FACTOR (0.99) /* decreased every entry_dealloc */
#define STICKY_DECREASE_FACTOR (0.50) /* factor for sticky entries */
#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */
#define JUMBLE_SIZE 1024 /* query serialization buffer size */
/*
+ * Extension version number, for supporting older extension versions' objects
+ */
+typedef enum pgssVersion
+{
+ PGSS_V1_0 = 0,
+ PGSS_V1_1,
+ PGSS_V1_2
+} pgssVersion;
+
+/*
* Hashtable key that defines the identity of a hashtable entry. We separate
* queries by user and by database even if they are otherwise identical.
- *
- * Presently, the query encoding is fully determined by the source database
- * and so we don't really need it to be in the key. But that might not always
- * be true. Anyway it's notationally convenient to pass it as part of the key.
*/
typedef struct pgssHashKey
{
Oid userid; /* user OID */
Oid dbid; /* database OID */
- int encoding; /* query encoding */
uint32 queryid; /* query identifier */
} pgssHashKey;
/*
* Statistics per statement
*
- * NB: see the file read/write code before changing field order here.
+ * Note: in event of a failure in garbage collection of the query text file,
+ * we reset query_offset to zero and query_len to -1. This will be seen as
+ * an invalid state by qtext_fetch().
*/
typedef struct pgssEntry
{
pgssHashKey key; /* hash key of entry - MUST BE FIRST */
Counters counters; /* the statistics for this query */
+ Size query_offset; /* query text offset in external file */
int query_len; /* # of valid bytes in query string */
+ int encoding; /* query text encoding */
slock_t mutex; /* protects the counters only */
- char query[1]; /* VARIABLE LENGTH ARRAY - MUST BE LAST */
- /* Note: the allocated length of query[] is actually pgss->query_size */
} pgssEntry;
/*
*/
typedef struct pgssSharedState
{
- LWLockId lock; /* protects hashtable search/modification */
- int query_size; /* max query length in bytes */
+ LWLock *lock; /* protects hashtable search/modification */
double cur_median_usage; /* current median usage in hashtable */
+ Size mean_query_len; /* current mean entry text length */
+ slock_t mutex; /* protects following fields only: */
+ Size extent; /* current extent of query file */
+ int n_writers; /* number of active writers to query file */
+ int gc_count; /* query file garbage collection cycle count */
} pgssSharedState;
/*
(pgss_track == PGSS_TRACK_ALL || \
(pgss_track == PGSS_TRACK_TOP && nested_level == 0))
+#define record_gc_qtexts() \
+ do { \
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss; \
+ SpinLockAcquire(&s->mutex); \
+ s->gc_count++; \
+ SpinLockRelease(&s->mutex); \
+ } while(0)
+
/*---- Function declarations ----*/
void _PG_init(void);
void _PG_fini(void);
-Datum pg_stat_statements_reset(PG_FUNCTION_ARGS);
-Datum pg_stat_statements(PG_FUNCTION_ARGS);
-
PG_FUNCTION_INFO_V1(pg_stat_statements_reset);
+PG_FUNCTION_INFO_V1(pg_stat_statements_1_2);
PG_FUNCTION_INFO_V1(pg_stat_statements);
static void pgss_shmem_startup(void);
double total_time, uint64 rows,
const BufferUsage *bufusage,
pgssJumbleState *jstate);
+static void pg_stat_statements_internal(FunctionCallInfo fcinfo,
+ pgssVersion api_version,
+ bool showtext);
static Size pgss_memsize(void);
-static pgssEntry *entry_alloc(pgssHashKey *key, const char *query,
- int query_len, bool sticky);
+static pgssEntry *entry_alloc(pgssHashKey *key, Size query_offset, int query_len,
+ int encoding, bool sticky);
static void entry_dealloc(void);
+static bool qtext_store(const char *query, int query_len,
+ Size *query_offset, int *gc_count);
+static char *qtext_load_file(Size *buffer_size);
+static char *qtext_fetch(Size query_offset, int query_len,
+ char *buffer, Size buffer_size);
+static bool need_gc_qtexts(void);
+static void gc_qtexts(void);
static void entry_reset(void);
#endif
static void AppendJumble(pgssJumbleState *jstate,
const unsigned char *item, Size size);
-#ifdef NOT_USED
static void JumbleQuery(pgssJumbleState *jstate, Query *query);
-#endif
static void JumbleRangeTable(pgssJumbleState *jstate, List *rtable);
static void JumbleExpr(pgssJumbleState *jstate, Node *node);
static void RecordConstLocation(pgssJumbleState *jstate, int location);
#endif
static void fill_in_constant_lengths(pgssJumbleState *jstate, const char *query);
static int comp_location(const void *a, const void *b);
-#ifdef NOT_USED
+#ifdef NOT_USED
/*
* Module load callback
*/
"Sets the maximum number of statements tracked by pg_stat_statements.",
NULL,
&pgss_max,
- 1000,
+ 5000,
100,
INT_MAX,
PGC_POSTMASTER,
/*
* shmem_startup hook: allocate or attach to shared memory,
* then load any pre-existing statistics from file.
+ * Also create and load the query-texts file, which is expected to exist
+ * (even if empty) while the module is enabled.
*/
static void
pgss_shmem_startup(void)
{
bool found;
HASHCTL info;
- FILE *file;
+ FILE *file = NULL;
+ FILE *qfile = NULL;
uint32 header;
int32 num;
+ int32 pgver;
int32 i;
- int query_size;
int buffer_size;
char *buffer = NULL;
{
/* First time through ... */
pgss->lock = LWLockAssign();
- pgss->query_size = pgstat_track_activity_query_size;
pgss->cur_median_usage = ASSUMED_MEDIAN_INIT;
+ pgss->mean_query_len = ASSUMED_LENGTH_INIT;
+ SpinLockInit(&pgss->mutex);
+ pgss->extent = 0;
+ pgss->n_writers = 0;
+ pgss->gc_count = 0;
}
- /* Be sure everyone agrees on the hash table entry size */
- query_size = pgss->query_size;
-
memset(&info, 0, sizeof(info));
info.keysize = sizeof(pgssHashKey);
- info.entrysize = offsetof(pgssEntry, query) +query_size;
+ info.entrysize = sizeof(pgssEntry);
info.hash = pgss_hash_fn;
info.match = pgss_match_fn;
pgss_hash = ShmemInitHash("pg_stat_statements hash",
on_shmem_exit(pgss_shmem_shutdown, (Datum) 0);
/*
- * Attempt to load old statistics from the dump file, if this is the first
- * time through and we weren't told not to.
+ * Done if some other process already completed our initialization.
*/
- if (found || !pgss_save)
+ if (found)
return;
/*
* Note: we don't bother with locks here, because there should be no other
* processes running when this code is reached.
*/
+
+ /* Unlink query text file possibly left over from crash */
+ unlink(PGSS_TEXT_FILE);
+
+ /* Allocate new query text temp file */
+ qfile = AllocateFile(PGSS_TEXT_FILE, PG_BINARY_W);
+ if (qfile == NULL)
+ goto write_error;
+
+ /*
+ * If we were told not to load old statistics, we're done. (Note we do
+ * not try to unlink any old dump file in this case. This seems a bit
+ * questionable but it's the historical behavior.)
+ */
+ if (!pgss_save)
+ {
+ FreeFile(qfile);
+ return;
+ }
+
+ /*
+ * Attempt to load old statistics from the dump file.
+ */
file = AllocateFile(PGSS_DUMP_FILE, PG_BINARY_R);
if (file == NULL)
{
- if (errno == ENOENT)
- return; /* ignore not-found error */
- goto error;
+ if (errno != ENOENT)
+ goto read_error;
+ /* No existing persisted stats file, so we're done */
+ FreeFile(qfile);
+ return;
}
- buffer_size = query_size;
+ buffer_size = 2048;
buffer = (char *) palloc(buffer_size);
if (fread(&header, sizeof(uint32), 1, file) != 1 ||
- header != PGSS_FILE_HEADER ||
+ fread(&pgver, sizeof(uint32), 1, file) != 1 ||
fread(&num, sizeof(int32), 1, file) != 1)
- goto error;
+ goto read_error;
+
+ if (header != PGSS_FILE_HEADER ||
+ pgver != PGSS_PG_MAJOR_VERSION)
+ goto data_error;
for (i = 0; i < num; i++)
{
pgssEntry temp;
pgssEntry *entry;
+ Size query_offset;
- if (fread(&temp, offsetof(pgssEntry, mutex), 1, file) != 1)
- goto error;
+ if (fread(&temp, sizeof(pgssEntry), 1, file) != 1)
+ goto read_error;
/* Encoding is the only field we can easily sanity-check */
- if (!PG_VALID_BE_ENCODING(temp.key.encoding))
- goto error;
+ if (!PG_VALID_BE_ENCODING(temp.encoding))
+ goto data_error;
- /* Previous incarnation might have had a larger query_size */
+ /* Resize buffer as needed */
if (temp.query_len >= buffer_size)
{
- buffer = (char *) repalloc(buffer, temp.query_len + 1);
- buffer_size = temp.query_len + 1;
+ buffer_size = Max(buffer_size * 2, temp.query_len + 1);
+ buffer = repalloc(buffer, buffer_size);
}
- if (fread(buffer, 1, temp.query_len, file) != temp.query_len)
- goto error;
+ if (fread(buffer, 1, temp.query_len + 1, file) != temp.query_len + 1)
+ goto read_error;
+
+ /* Should have a trailing null, but let's make sure */
buffer[temp.query_len] = '\0';
/* Skip loading "sticky" entries */
if (temp.counters.calls == 0)
continue;
- /* Clip to available length if needed */
- if (temp.query_len >= query_size)
- temp.query_len = pg_encoding_mbcliplen(temp.key.encoding,
- buffer,
- temp.query_len,
- query_size - 1);
+ /* Store the query text */
+ query_offset = pgss->extent;
+ if (fwrite(buffer, 1, temp.query_len + 1, qfile) != temp.query_len + 1)
+ goto write_error;
+ pgss->extent += temp.query_len + 1;
/* make the hashtable entry (discards old entries if too many) */
- entry = entry_alloc(&temp.key, buffer, temp.query_len, false);
+ entry = entry_alloc(&temp.key, query_offset, temp.query_len,
+ temp.encoding,
+ false);
/* copy in the actual stats */
entry->counters = temp.counters;
pfree(buffer);
FreeFile(file);
+ FreeFile(qfile);
/*
- * Remove the file so it's not included in backups/replication slaves,
- * etc. A new file will be written on next shutdown.
+ * Remove the persisted stats file so it's not included in
+ * backups/replication slaves, etc. A new file will be written on next
+ * shutdown.
+ *
+ * Note: it's okay if the PGSS_TEXT_FILE is included in a basebackup,
+ * because we remove that file on startup; it acts inversely to
+ * PGSS_DUMP_FILE, in that it is only supposed to be around when the
+ * server is running, whereas PGSS_DUMP_FILE is only supposed to be around
+ * when the server is not running. Leaving the file creates no danger of
+ * a newly restored database having a spurious record of execution costs,
+ * which is what we're really concerned about here.
*/
unlink(PGSS_DUMP_FILE);
return;
-error:
+read_error:
ereport(LOG,
(errcode_for_file_access(),
errmsg("could not read pg_stat_statement file \"%s\": %m",
PGSS_DUMP_FILE)));
+ goto fail;
+data_error:
+ ereport(LOG,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ignoring invalid data in pg_stat_statement file \"%s\"",
+ PGSS_DUMP_FILE)));
+ goto fail;
+write_error:
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not write pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+fail:
if (buffer)
pfree(buffer);
if (file)
FreeFile(file);
+ if (qfile)
+ FreeFile(qfile);
/* If possible, throw away the bogus file; ignore any error */
unlink(PGSS_DUMP_FILE);
+
+ /*
+ * Don't unlink PGSS_TEXT_FILE here; it should always be around while the
+ * server is running with pg_stat_statements enabled
+ */
}
/*
pgss_shmem_shutdown(int code, Datum arg)
{
FILE *file;
+ char *qbuffer = NULL;
+ Size qbuffer_size = 0;
HASH_SEQ_STATUS hash_seq;
int32 num_entries;
pgssEntry *entry;
if (fwrite(&PGSS_FILE_HEADER, sizeof(uint32), 1, file) != 1)
goto error;
+ if (fwrite(&PGSS_PG_MAJOR_VERSION, sizeof(uint32), 1, file) != 1)
+ goto error;
num_entries = hash_get_num_entries(pgss_hash);
if (fwrite(&num_entries, sizeof(int32), 1, file) != 1)
goto error;
+ qbuffer = qtext_load_file(&qbuffer_size);
+ if (qbuffer == NULL)
+ goto error;
+
+ /*
+ * When serializing to disk, we store query texts immediately after their
+ * entry data. Any orphaned query texts are thereby excluded.
+ */
hash_seq_init(&hash_seq, pgss_hash);
while ((entry = hash_seq_search(&hash_seq)) != NULL)
{
int len = entry->query_len;
+ char *qstr = qtext_fetch(entry->query_offset, len,
+ qbuffer, qbuffer_size);
+
+ if (qstr == NULL)
+ continue; /* Ignore any entries with bogus texts */
- if (fwrite(entry, offsetof(pgssEntry, mutex), 1, file) != 1 ||
- fwrite(entry->query, 1, len, file) != len)
+ if (fwrite(entry, sizeof(pgssEntry), 1, file) != 1 ||
+ fwrite(qstr, 1, len + 1, file) != len + 1)
+ {
+ /* note: we assume hash_seq_term won't change errno */
+ hash_seq_term(&hash_seq);
goto error;
+ }
}
+ free(qbuffer);
+ qbuffer = NULL;
+
if (FreeFile(file))
{
file = NULL;
}
/*
- * Rename file into place, so we atomically replace the old one.
+ * Rename file into place, so we atomically replace any old one.
*/
if (rename(PGSS_DUMP_FILE ".tmp", PGSS_DUMP_FILE) != 0)
ereport(LOG,
errmsg("could not rename pg_stat_statement file \"%s\": %m",
PGSS_DUMP_FILE ".tmp")));
+ /* Unlink query-texts file; it's not needed while shutdown */
+ unlink(PGSS_TEXT_FILE);
+
return;
error:
(errcode_for_file_access(),
errmsg("could not write pg_stat_statement file \"%s\": %m",
PGSS_DUMP_FILE ".tmp")));
+ if (qbuffer)
+ free(qbuffer);
if (file)
FreeFile(file);
unlink(PGSS_DUMP_FILE ".tmp");
+ unlink(PGSS_TEXT_FILE);
}
/*
{
pgssJumbleState jstate;
+ if (prev_post_parse_analyze_hook)
+ prev_post_parse_analyze_hook(pstate, query);
+
/* Assert we didn't do this already */
Assert(query->queryId == 0);
{
instr_time start;
instr_time duration;
- uint64 rows = 0;
+ uint64 rows;
BufferUsage bufusage_start,
bufusage;
uint32 queryId;
/* parse command tag to retrieve the number of affected rows. */
if (completionTag &&
- sscanf(completionTag, "COPY " UINT64_FORMAT, &rows) != 1)
+ strncmp(completionTag, "COPY ", 5) == 0)
+ {
+#ifdef HAVE_STRTOULL
+ rows = strtoull(completionTag + 5, NULL, 10);
+#else
+ rows = strtoul(completionTag + 5, NULL, 10);
+#endif
+ }
+ else
rows = 0;
/* calc differences of buffer counters. */
{
const pgssHashKey *k = (const pgssHashKey *) key;
- /* we don't bother to include encoding in the hash */
return hash_uint32((uint32) k->userid) ^
hash_uint32((uint32) k->dbid) ^
hash_uint32((uint32) k->queryid);
if (k1->userid == k2->userid &&
k1->dbid == k2->dbid &&
- k1->encoding == k2->encoding &&
k1->queryid == k2->queryid)
return 0;
else
pgssHashKey key;
pgssEntry *entry;
char *norm_query = NULL;
+ int encoding = GetDatabaseEncoding();
+ int query_len;
Assert(query != NULL);
if (!pgss || !pgss_hash)
return;
+ query_len = strlen(query);
+
/* Set up key for hashtable search */
key.userid = GetUserId();
key.dbid = MyDatabaseId;
- key.encoding = GetDatabaseEncoding();
key.queryid = queryId;
/* Lookup the hash table entry with shared lock. */
/* Create new entry, if not present */
if (!entry)
{
- int query_len;
+ Size query_offset;
+ int gc_count;
+ bool stored;
+ bool do_gc;
/*
- * We'll need exclusive lock to make a new entry. There is no point
- * in holding shared lock while we normalize the string, though.
+ * Create a new, normalized query string if caller asked. We don't
+ * need to hold the lock while doing this work. (Note: in any case,
+ * it's possible that someone else creates a duplicate hashtable entry
+ * in the interval where we don't hold the lock below. That case is
+ * handled by entry_alloc.)
*/
- LWLockRelease(pgss->lock);
-
- query_len = strlen(query);
-
if (jstate)
{
- /* Normalize the string if enabled */
+ LWLockRelease(pgss->lock);
norm_query = generate_normalized_query(jstate, query,
&query_len,
- key.encoding);
+ encoding);
+ LWLockAcquire(pgss->lock, LW_SHARED);
+ }
- /* Acquire exclusive lock as required by entry_alloc() */
- LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
+ /* Append new query text to file with only shared lock held */
+ stored = qtext_store(norm_query ? norm_query : query, query_len,
+ &query_offset, &gc_count);
- entry = entry_alloc(&key, norm_query, query_len, true);
- }
- else
- {
- /*
- * We're just going to store the query string as-is; but we have
- * to truncate it if over-length.
- */
- if (query_len >= pgss->query_size)
- query_len = pg_encoding_mbcliplen(key.encoding,
- query,
- query_len,
- pgss->query_size - 1);
+ /*
+ * Determine whether we need to garbage collect external query texts
+ * while the shared lock is still held. This micro-optimization
+ * avoids taking the time to decide this while holding exclusive lock.
+ */
+ do_gc = need_gc_qtexts();
- /* Acquire exclusive lock as required by entry_alloc() */
- LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
+ /* Need exclusive lock to make a new hashtable entry - promote */
+ LWLockRelease(pgss->lock);
+ LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
- entry = entry_alloc(&key, query, query_len, false);
- }
+ /*
+ * A garbage collection may have occurred while we weren't holding the
+ * lock. In the unlikely event that this happens, the query text we
+ * stored above will have been garbage collected, so write it again.
+ * This should be infrequent enough that doing it while holding
+ * exclusive lock isn't a performance problem.
+ */
+ if (!stored || pgss->gc_count != gc_count)
+ stored = qtext_store(norm_query ? norm_query : query, query_len,
+ &query_offset, NULL);
+
+ /* If we failed to write to the text file, give up */
+ if (!stored)
+ goto done;
+
+ /* OK to create a new hashtable entry */
+ entry = entry_alloc(&key, query_offset, query_len, encoding,
+ jstate != NULL);
+
+ /* If needed, perform garbage collection while exclusive lock held */
+ if (do_gc)
+ gc_qtexts();
}
/* Increment the counts, except when jstate is not NULL */
SpinLockRelease(&e->mutex);
}
+done:
LWLockRelease(pgss->lock);
- /* We postpone this pfree until we're out of the lock */
+ /* We postpone this clean-up until we're out of the lock */
if (norm_query)
pfree(norm_query);
}
PG_RETURN_VOID();
}
+/* Number of output arguments (columns) for various API versions */
#define PG_STAT_STATEMENTS_COLS_V1_0 14
-#define PG_STAT_STATEMENTS_COLS 18
+#define PG_STAT_STATEMENTS_COLS_V1_1 18
+#define PG_STAT_STATEMENTS_COLS_V1_2 19
+#define PG_STAT_STATEMENTS_COLS 19 /* maximum of above */
/*
* Retrieve statement statistics.
+ *
+ * The SQL API of this function has changed multiple times, and will likely
+ * do so again in future. To support the case where a newer version of this
+ * loadable module is being used with an old SQL declaration of the function,
+ * we continue to support the older API versions. For 1.2 and later, the
+ * expected API version is identified by embedding it in the C name of the
+ * function. Unfortunately we weren't bright enough to do that for 1.1.
+ */
+Datum
+pg_stat_statements_1_2(PG_FUNCTION_ARGS)
+{
+ bool showtext = PG_GETARG_BOOL(0);
+
+ pg_stat_statements_internal(fcinfo, PGSS_V1_2, showtext);
+
+ return (Datum) 0;
+}
+
+/*
+ * Legacy entry point for pg_stat_statements() API versions 1.0 and 1.1.
+ * This can be removed someday, perhaps.
*/
Datum
pg_stat_statements(PG_FUNCTION_ARGS)
{
+ /* If it's really API 1.1, we'll figure that out below */
+ pg_stat_statements_internal(fcinfo, PGSS_V1_0, true);
+
+ return (Datum) 0;
+}
+
+/* Common code for all versions of pg_stat_statements() */
+static void
+pg_stat_statements_internal(FunctionCallInfo fcinfo,
+ pgssVersion api_version,
+ bool showtext)
+{
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
TupleDesc tupdesc;
Tuplestorestate *tupstore;
MemoryContext oldcontext;
Oid userid = GetUserId();
bool is_superuser = superuser();
+ char *qbuffer = NULL;
+ Size qbuffer_size = 0;
+ Size extent = 0;
+ int gc_count = 0;
HASH_SEQ_STATUS hash_seq;
pgssEntry *entry;
- bool sql_supports_v1_1_counters = true;
+ /* hash table must exist already */
if (!pgss || !pgss_hash)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("materialize mode required, but it is not " \
"allowed in this context")));
+ /* Switch into long-lived context to construct returned data structures */
+ per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
+ oldcontext = MemoryContextSwitchTo(per_query_ctx);
+
/* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
elog(ERROR, "return type must be a row type");
- if (tupdesc->natts == PG_STAT_STATEMENTS_COLS_V1_0)
- sql_supports_v1_1_counters = false;
- per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
- oldcontext = MemoryContextSwitchTo(per_query_ctx);
+ /*
+ * Check we have the expected number of output arguments. Aside from
+ * being a good safety check, we need a kluge here to detect API version
+ * 1.1, which was wedged into the code in an ill-considered way.
+ */
+ switch (tupdesc->natts)
+ {
+ case PG_STAT_STATEMENTS_COLS_V1_0:
+ if (api_version != PGSS_V1_0)
+ elog(ERROR, "incorrect number of output arguments");
+ break;
+ case PG_STAT_STATEMENTS_COLS_V1_1:
+ /* pg_stat_statements() should have told us 1.0 */
+ if (api_version != PGSS_V1_0)
+ elog(ERROR, "incorrect number of output arguments");
+ api_version = PGSS_V1_1;
+ break;
+ case PG_STAT_STATEMENTS_COLS_V1_2:
+ if (api_version != PGSS_V1_2)
+ elog(ERROR, "incorrect number of output arguments");
+ break;
+ default:
+ elog(ERROR, "incorrect number of output arguments");
+ }
tupstore = tuplestore_begin_heap(true, false, work_mem);
rsinfo->returnMode = SFRM_Materialize;
MemoryContextSwitchTo(oldcontext);
+ /*
+ * We'd like to load the query text file (if needed) while not holding any
+ * lock on pgss->lock. In the worst case we'll have to do this again
+ * after we have the lock, but it's unlikely enough to make this a win
+ * despite occasional duplicated work. We need to reload if anybody
+ * writes to the file (either a retail qtext_store(), or a garbage
+ * collection) between this point and where we've gotten shared lock. If
+ * a qtext_store is actually in progress when we look, we might as well
+ * skip the speculative load entirely.
+ */
+ if (showtext)
+ {
+ int n_writers;
+
+ /* Take the mutex so we can examine variables */
+ {
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss;
+
+ SpinLockAcquire(&s->mutex);
+ extent = s->extent;
+ n_writers = s->n_writers;
+ gc_count = s->gc_count;
+ SpinLockRelease(&s->mutex);
+ }
+
+ /* No point in loading file now if there are active writers */
+ if (n_writers == 0)
+ qbuffer = qtext_load_file(&qbuffer_size);
+ }
+
+ /*
+ * Get shared lock, load or reload the query text file if we must, and
+ * iterate over the hashtable entries.
+ *
+ * With a large hash table, we might be holding the lock rather longer
+ * than one could wish. However, this only blocks creation of new hash
+ * table entries, and the larger the hash table the less likely that is to
+ * be needed. So we can hope this is okay. Perhaps someday we'll decide
+ * we need to partition the hash table to limit the time spent holding any
+ * one lock.
+ */
LWLockAcquire(pgss->lock, LW_SHARED);
+ if (showtext)
+ {
+ /*
+ * Here it is safe to examine extent and gc_count without taking the
+ * mutex. Note that although other processes might change
+ * pgss->extent just after we look at it, the strings they then write
+ * into the file cannot yet be referenced in the hashtable, so we
+ * don't care whether we see them or not.
+ *
+ * If qtext_load_file fails, we just press on; we'll return NULL for
+ * every query text.
+ */
+ if (qbuffer == NULL ||
+ pgss->extent != extent ||
+ pgss->gc_count != gc_count)
+ {
+ if (qbuffer)
+ free(qbuffer);
+ qbuffer = qtext_load_file(&qbuffer_size);
+ }
+ }
+
hash_seq_init(&hash_seq, pgss_hash);
while ((entry = hash_seq_search(&hash_seq)) != NULL)
{
bool nulls[PG_STAT_STATEMENTS_COLS];
int i = 0;
Counters tmp;
+ int64 queryid = entry->key.queryid;
memset(values, 0, sizeof(values));
memset(nulls, 0, sizeof(nulls));
if (is_superuser || entry->key.userid == userid)
{
- char *qstr;
-
- qstr = (char *)
- pg_do_encoding_conversion((unsigned char *) entry->query,
- entry->query_len,
- entry->key.encoding,
- GetDatabaseEncoding());
- values[i++] = CStringGetTextDatum(qstr);
- if (qstr != entry->query)
- pfree(qstr);
+ if (api_version >= PGSS_V1_2)
+ values[i++] = Int64GetDatumFast(queryid);
+
+ if (showtext)
+ {
+ char *qstr = qtext_fetch(entry->query_offset,
+ entry->query_len,
+ qbuffer,
+ qbuffer_size);
+
+ if (qstr)
+ {
+ char *enc;
+
+ enc = pg_any_to_server(qstr,
+ entry->query_len,
+ entry->encoding);
+
+ values[i++] = CStringGetTextDatum(enc);
+
+ if (enc != qstr)
+ pfree(enc);
+ }
+ else
+ {
+ /* Just return a null if we fail to find the text */
+ nulls[i++] = true;
+ }
+ }
+ else
+ {
+ /* Query text not requested */
+ nulls[i++] = true;
+ }
}
else
- values[i++] = CStringGetTextDatum("<insufficient privilege>");
+ {
+ /* Don't show queryid */
+ if (api_version >= PGSS_V1_2)
+ nulls[i++] = true;
+
+ /*
+ * Don't show query text, but hint as to the reason for not doing
+ * so if it was requested
+ */
+ if (showtext)
+ values[i++] = CStringGetTextDatum("<insufficient privilege>");
+ else
+ nulls[i++] = true;
+ }
/* copy counters to a local variable to keep locking time short */
{
values[i++] = Int64GetDatumFast(tmp.rows);
values[i++] = Int64GetDatumFast(tmp.shared_blks_hit);
values[i++] = Int64GetDatumFast(tmp.shared_blks_read);
- if (sql_supports_v1_1_counters)
+ if (api_version >= PGSS_V1_1)
values[i++] = Int64GetDatumFast(tmp.shared_blks_dirtied);
values[i++] = Int64GetDatumFast(tmp.shared_blks_written);
values[i++] = Int64GetDatumFast(tmp.local_blks_hit);
values[i++] = Int64GetDatumFast(tmp.local_blks_read);
- if (sql_supports_v1_1_counters)
+ if (api_version >= PGSS_V1_1)
values[i++] = Int64GetDatumFast(tmp.local_blks_dirtied);
values[i++] = Int64GetDatumFast(tmp.local_blks_written);
values[i++] = Int64GetDatumFast(tmp.temp_blks_read);
values[i++] = Int64GetDatumFast(tmp.temp_blks_written);
- if (sql_supports_v1_1_counters)
+ if (api_version >= PGSS_V1_1)
{
values[i++] = Float8GetDatumFast(tmp.blk_read_time);
values[i++] = Float8GetDatumFast(tmp.blk_write_time);
}
- Assert(i == (sql_supports_v1_1_counters ?
- PG_STAT_STATEMENTS_COLS : PG_STAT_STATEMENTS_COLS_V1_0));
+ Assert(i == (api_version == PGSS_V1_0 ? PG_STAT_STATEMENTS_COLS_V1_0 :
+ api_version == PGSS_V1_1 ? PG_STAT_STATEMENTS_COLS_V1_1 :
+ api_version == PGSS_V1_2 ? PG_STAT_STATEMENTS_COLS_V1_2 :
+ -1 /* fail if you forget to update this assert */ ));
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
+ /* clean up and return the tuplestore */
LWLockRelease(pgss->lock);
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
+ if (qbuffer)
+ free(qbuffer);
- return (Datum) 0;
+ tuplestore_donestoring(tupstore);
}
/*
pgss_memsize(void)
{
Size size;
- Size entrysize;
size = MAXALIGN(sizeof(pgssSharedState));
- entrysize = offsetof(pgssEntry, query) +pgstat_track_activity_query_size;
- size = add_size(size, hash_estimate_size(pgss_max, entrysize));
+ size = add_size(size, hash_estimate_size(pgss_max, sizeof(pgssEntry)));
return size;
}
* would be difficult to demonstrate this even under artificial conditions.)
*
* Note: despite needing exclusive lock, it's not an error for the target
- * entry to already exist. This is because pgss_store releases and
+ * entry to already exist. This is because pgss_store releases and
* reacquires lock after failing to find a match; so someone else could
* have made the entry while we waited to get exclusive lock.
*/
static pgssEntry *
-entry_alloc(pgssHashKey *key, const char *query, int query_len, bool sticky)
+entry_alloc(pgssHashKey *key, Size query_offset, int query_len, int encoding,
+ bool sticky)
{
pgssEntry *entry;
bool found;
entry->counters.usage = sticky ? pgss->cur_median_usage : USAGE_INIT;
/* re-initialize the mutex each time ... we assume no one using it */
SpinLockInit(&entry->mutex);
- /* ... and don't forget the query text */
- Assert(query_len >= 0 && query_len < pgss->query_size);
+ /* ... and don't forget the query text metadata */
+ Assert(query_len >= 0);
+ entry->query_offset = query_offset;
entry->query_len = query_len;
- memcpy(entry->query, query, query_len);
- entry->query[query_len] = '\0';
+ entry->encoding = encoding;
}
return entry;
pgssEntry *entry;
int nvictims;
int i;
+ Size totlen = 0;
/*
* Sort entries by usage and deallocate USAGE_DEALLOC_PERCENT of them.
entry->counters.usage *= STICKY_DECREASE_FACTOR;
else
entry->counters.usage *= USAGE_DECREASE_FACTOR;
+ /* Accumulate total size, too. */
+ totlen += entry->query_len + 1;
}
qsort(entries, i, sizeof(pgssEntry *), entry_cmp);
- /* Also, record the (approximate) median usage */
if (i > 0)
+ {
+ /* Record the (approximate) median usage */
pgss->cur_median_usage = entries[i / 2]->counters.usage;
+ /* Record the mean query length */
+ pgss->mean_query_len = totlen / i;
+ }
nvictims = Max(10, i * USAGE_DEALLOC_PERCENT / 100);
nvictims = Min(nvictims, i);
}
/*
+ * Given a null-terminated string, allocate a new entry in the external query
+ * text file and store the string there.
+ *
+ * Although we could compute the string length via strlen(), callers already
+ * have it handy, so we require them to pass it too.
+ *
+ * If successful, returns true, and stores the new entry's offset in the file
+ * into *query_offset. Also, if gc_count isn't NULL, *gc_count is set to the
+ * number of garbage collections that have occurred so far.
+ *
+ * On failure, returns false.
+ *
+ * At least a shared lock on pgss->lock must be held by the caller, so as
+ * to prevent a concurrent garbage collection. Share-lock-holding callers
+ * should pass a gc_count pointer to obtain the number of garbage collections,
+ * so that they can recheck the count after obtaining exclusive lock to
+ * detect whether a garbage collection occurred (and removed this entry).
+ */
+static bool
+qtext_store(const char *query, int query_len,
+ Size *query_offset, int *gc_count)
+{
+ Size off;
+ int fd;
+
+ /*
+ * We use a spinlock to protect extent/n_writers/gc_count, so that
+ * multiple processes may execute this function concurrently.
+ */
+ {
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss;
+
+ SpinLockAcquire(&s->mutex);
+ off = s->extent;
+ s->extent += query_len + 1;
+ s->n_writers++;
+ if (gc_count)
+ *gc_count = s->gc_count;
+ SpinLockRelease(&s->mutex);
+ }
+
+ *query_offset = off;
+
+ /* Now write the data into the successfully-reserved part of the file */
+ fd = OpenTransientFile(PGSS_TEXT_FILE, O_RDWR | O_CREAT | PG_BINARY,
+ S_IRUSR | S_IWUSR);
+ if (fd < 0)
+ goto error;
+
+ if (lseek(fd, off, SEEK_SET) != off)
+ goto error;
+
+ if (write(fd, query, query_len + 1) != query_len + 1)
+ goto error;
+
+ CloseTransientFile(fd);
+
+ /* Mark our write complete */
+ {
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss;
+
+ SpinLockAcquire(&s->mutex);
+ s->n_writers--;
+ SpinLockRelease(&s->mutex);
+ }
+
+ return true;
+
+error:
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not write pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+
+ if (fd >= 0)
+ CloseTransientFile(fd);
+
+ /* Mark our write complete */
+ {
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss;
+
+ SpinLockAcquire(&s->mutex);
+ s->n_writers--;
+ SpinLockRelease(&s->mutex);
+ }
+
+ return false;
+}
+
+/*
+ * Read the external query text file into a malloc'd buffer.
+ *
+ * Returns NULL (without throwing an error) if unable to read, eg
+ * file not there or insufficient memory.
+ *
+ * On success, the buffer size is also returned into *buffer_size.
+ *
+ * This can be called without any lock on pgss->lock, but in that case
+ * the caller is responsible for verifying that the result is sane.
+ */
+static char *
+qtext_load_file(Size *buffer_size)
+{
+ char *buf;
+ int fd;
+ struct stat stat;
+
+ fd = OpenTransientFile(PGSS_TEXT_FILE, O_RDONLY | PG_BINARY, 0);
+ if (fd < 0)
+ {
+ if (errno != ENOENT)
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not read pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ return NULL;
+ }
+
+ /* Get file length */
+ if (fstat(fd, &stat))
+ {
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not stat pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ CloseTransientFile(fd);
+ return NULL;
+ }
+
+ /* Allocate buffer; beware that off_t might be wider than size_t */
+ if (stat.st_size <= MaxAllocSize)
+ buf = (char *) malloc(stat.st_size);
+ else
+ buf = NULL;
+ if (buf == NULL)
+ {
+ ereport(LOG,
+ (errcode(ERRCODE_OUT_OF_MEMORY),
+ errmsg("out of memory")));
+ CloseTransientFile(fd);
+ return NULL;
+ }
+
+ /*
+ * OK, slurp in the file. If we get a short read and errno doesn't get
+ * set, the reason is probably that garbage collection truncated the file
+ * since we did the fstat(), so we don't log a complaint --- but we don't
+ * return the data, either, since it's most likely corrupt due to
+ * concurrent writes from garbage collection.
+ */
+ errno = 0;
+ if (read(fd, buf, stat.st_size) != stat.st_size)
+ {
+ if (errno)
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not read pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ free(buf);
+ CloseTransientFile(fd);
+ return NULL;
+ }
+
+ CloseTransientFile(fd);
+
+ *buffer_size = stat.st_size;
+ return buf;
+}
+
+/*
+ * Locate a query text in the file image previously read by qtext_load_file().
+ *
+ * We validate the given offset/length, and return NULL if bogus. Otherwise,
+ * the result points to a null-terminated string within the buffer.
+ */
+static char *
+qtext_fetch(Size query_offset, int query_len,
+ char *buffer, Size buffer_size)
+{
+ /* File read failed? */
+ if (buffer == NULL)
+ return NULL;
+ /* Bogus offset/length? */
+ if (query_len < 0 ||
+ query_offset + query_len >= buffer_size)
+ return NULL;
+ /* As a further sanity check, make sure there's a trailing null */
+ if (buffer[query_offset + query_len] != '\0')
+ return NULL;
+ /* Looks OK */
+ return buffer + query_offset;
+}
+
+/*
+ * Do we need to garbage-collect the external query text file?
+ *
+ * Caller should hold at least a shared lock on pgss->lock.
+ */
+static bool
+need_gc_qtexts(void)
+{
+ Size extent;
+
+ /* Read shared extent pointer */
+ {
+ volatile pgssSharedState *s = (volatile pgssSharedState *) pgss;
+
+ SpinLockAcquire(&s->mutex);
+ extent = s->extent;
+ SpinLockRelease(&s->mutex);
+ }
+
+ /* Don't proceed if file does not exceed 512 bytes per possible entry */
+ if (extent < 512 * pgss_max)
+ return false;
+
+ /*
+ * Don't proceed if file is less than about 50% bloat. Nothing can or
+ * should be done in the event of unusually large query texts accounting
+ * for file's large size. We go to the trouble of maintaining the mean
+ * query length in order to prevent garbage collection from thrashing
+ * uselessly.
+ */
+ if (extent < pgss->mean_query_len * pgss_max * 2)
+ return false;
+
+ return true;
+}
+
+/*
+ * Garbage-collect orphaned query texts in external file.
+ *
+ * This won't be called often in the typical case, since it's likely that
+ * there won't be too much churn, and besides, a similar compaction process
+ * occurs when serializing to disk at shutdown or as part of resetting.
+ * Despite this, it seems prudent to plan for the edge case where the file
+ * becomes unreasonably large, with no other method of compaction likely to
+ * occur in the foreseeable future.
+ *
+ * The caller must hold an exclusive lock on pgss->lock.
+ */
+static void
+gc_qtexts(void)
+{
+ char *qbuffer;
+ Size qbuffer_size;
+ FILE *qfile;
+ HASH_SEQ_STATUS hash_seq;
+ pgssEntry *entry;
+ Size extent;
+ int nentries;
+
+ /*
+ * When called from pgss_store, some other session might have proceeded
+ * with garbage collection in the no-lock-held interim of lock strength
+ * escalation. Check once more that this is actually necessary.
+ */
+ if (!need_gc_qtexts())
+ return;
+
+ /*
+ * Load the old texts file. If we fail (out of memory, for instance) just
+ * skip the garbage collection.
+ */
+ qbuffer = qtext_load_file(&qbuffer_size);
+ if (qbuffer == NULL)
+ return;
+
+ /*
+ * We overwrite the query texts file in place, so as to reduce the risk of
+ * an out-of-disk-space failure. Since the file is guaranteed not to get
+ * larger, this should always work on traditional filesystems; though we
+ * could still lose on copy-on-write filesystems.
+ */
+ qfile = AllocateFile(PGSS_TEXT_FILE, PG_BINARY_W);
+ if (qfile == NULL)
+ {
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not write pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ goto gc_fail;
+ }
+
+ extent = 0;
+ nentries = 0;
+
+ hash_seq_init(&hash_seq, pgss_hash);
+ while ((entry = hash_seq_search(&hash_seq)) != NULL)
+ {
+ int query_len = entry->query_len;
+ char *qry = qtext_fetch(entry->query_offset,
+ query_len,
+ qbuffer,
+ qbuffer_size);
+
+ if (qry == NULL)
+ {
+ /* Trouble ... drop the text */
+ entry->query_offset = 0;
+ entry->query_len = -1;
+ continue;
+ }
+
+ if (fwrite(qry, 1, query_len + 1, qfile) != query_len + 1)
+ {
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not write pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ hash_seq_term(&hash_seq);
+ goto gc_fail;
+ }
+
+ entry->query_offset = extent;
+ extent += query_len + 1;
+ nentries++;
+ }
+
+ /*
+ * Truncate away any now-unused space. If this fails for some odd reason,
+ * we log it, but there's no need to fail.
+ */
+ if (ftruncate(fileno(qfile), extent) != 0)
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not truncate pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+
+ if (FreeFile(qfile))
+ {
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not write pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ qfile = NULL;
+ goto gc_fail;
+ }
+
+ elog(DEBUG1, "pgss gc of queries file shrunk size from %zu to %zu",
+ pgss->extent, extent);
+
+ /* Reset the shared extent pointer */
+ pgss->extent = extent;
+
+ /*
+ * Also update the mean query length, to be sure that need_gc_qtexts()
+ * won't still think we have a problem.
+ */
+ if (nentries > 0)
+ pgss->mean_query_len = extent / nentries;
+ else
+ pgss->mean_query_len = ASSUMED_LENGTH_INIT;
+
+ free(qbuffer);
+
+ /*
+ * OK, count a garbage collection cycle. (Note: even though we have
+ * exclusive lock on pgss->lock, we must take pgss->mutex for this, since
+ * other processes may examine gc_count while holding only the mutex.
+ * Also, we have to advance the count *after* we've rewritten the file,
+ * else other processes might not realize they read a stale file.)
+ */
+ record_gc_qtexts();
+
+ return;
+
+gc_fail:
+ /* clean up resources */
+ if (qfile)
+ FreeFile(qfile);
+ if (qbuffer)
+ free(qbuffer);
+
+ /*
+ * Since the contents of the external file are now uncertain, mark all
+ * hashtable entries as having invalid texts.
+ */
+ hash_seq_init(&hash_seq, pgss_hash);
+ while ((entry = hash_seq_search(&hash_seq)) != NULL)
+ {
+ entry->query_offset = 0;
+ entry->query_len = -1;
+ }
+
+ /* Seems like a good idea to bump the GC count even though we failed */
+ record_gc_qtexts();
+}
+
+/*
* Release all entries.
*/
static void
{
HASH_SEQ_STATUS hash_seq;
pgssEntry *entry;
+ FILE *qfile;
LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
hash_search(pgss_hash, &entry->key, HASH_REMOVE, NULL);
}
+ /*
+ * Write new empty query file, perhaps even creating a new one to recover
+ * if the file was missing.
+ */
+ qfile = AllocateFile(PGSS_TEXT_FILE, PG_BINARY_W);
+ if (qfile == NULL)
+ {
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not create pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+ goto done;
+ }
+
+ /* If ftruncate fails, log it, but it's not a fatal problem */
+ if (ftruncate(fileno(qfile), 0) != 0)
+ ereport(LOG,
+ (errcode_for_file_access(),
+ errmsg("could not truncate pg_stat_statement file \"%s\": %m",
+ PGSS_TEXT_FILE)));
+
+ FreeFile(qfile);
+
+done:
+ pgss->extent = 0;
+ /* This counts as a query text garbage collection for our purposes */
+ record_gc_qtexts();
+
LWLockRelease(pgss->lock);
}
#endif
APP_JUMB(rte->jointype);
break;
case RTE_FUNCTION:
- JumbleExpr(jstate, rte->funcexpr);
+ JumbleExpr(jstate, (Node *) rte->functions);
break;
case RTE_VALUES:
JumbleExpr(jstate, (Node *) rte->values_lists);
*
* Note: the reason we don't simply use expression_tree_walker() is that the
* point of that function is to support tree walkers that don't care about
- * most tree node types, but here we care about all types. We should complain
+ * most tree node types, but here we care about all types. We should complain
* about any unrecognized node type.
*/
static void
Aggref *expr = (Aggref *) node;
APP_JUMB(expr->aggfnoid);
+ JumbleExpr(jstate, (Node *) expr->aggdirectargs);
JumbleExpr(jstate, (Node *) expr->args);
JumbleExpr(jstate, (Node *) expr->aggorder);
JumbleExpr(jstate, (Node *) expr->aggdistinct);
+ JumbleExpr(jstate, (Node *) expr->aggfilter);
}
break;
case T_WindowFunc:
APP_JUMB(expr->winfnoid);
APP_JUMB(expr->winref);
JumbleExpr(jstate, (Node *) expr->args);
+ JumbleExpr(jstate, (Node *) expr->aggfilter);
}
break;
case T_ArrayRef:
JumbleExpr(jstate, setop->rarg);
}
break;
+ case T_RangeTblFunction:
+ {
+ RangeTblFunction *rtfunc = (RangeTblFunction *) node;
+
+ JumbleExpr(jstate, rtfunc->funcexpr);
+ }
+ break;
default:
/* Only a warning, since we can stumble along anyway */
elog(WARNING, "unrecognized node type: %d",
* *query_len_p contains the input string length, and is updated with
* the result string length (which cannot be longer) on exit.
*
- * Returns a palloc'd string, which is not necessarily null-terminated.
+ * Returns a palloc'd string.
*/
static char *
generate_normalized_query(pgssJumbleState *jstate, const char *query,
{
char *norm_query;
int query_len = *query_len_p;
- int max_output_len;
int i,
len_to_wrt, /* Length (in bytes) to write */
quer_loc = 0, /* Source query byte location */
*/
fill_in_constant_lengths(jstate, query);
- /* Allocate result buffer, ensuring we limit result to allowed size */
-#ifdef NOT_USED
- max_output_len = Min(query_len, pgss->query_size - 1);
-#endif
- /* XXX: pg_hint_plan doesn't truncate query string. */
- max_output_len = query_len;
- norm_query = palloc(max_output_len);
+ /* Allocate result buffer */
+ norm_query = palloc(query_len + 1);
for (i = 0; i < jstate->clocations_count; i++)
{
if (tok_len < 0)
continue; /* ignore any duplicates */
- /* Copy next chunk, or as much as will fit */
+ /* Copy next chunk (what precedes the next constant) */
len_to_wrt = off - last_off;
len_to_wrt -= last_tok_len;
- len_to_wrt = Min(len_to_wrt, max_output_len - n_quer_loc);
Assert(len_to_wrt >= 0);
memcpy(norm_query + n_quer_loc, query + quer_loc, len_to_wrt);
n_quer_loc += len_to_wrt;
- if (n_quer_loc < max_output_len)
- norm_query[n_quer_loc++] = '?';
+ /* And insert a '?' in place of the constant token */
+ norm_query[n_quer_loc++] = '?';
quer_loc = off + tok_len;
last_off = off;
last_tok_len = tok_len;
-
- /* If we run out of space, might as well stop iterating */
- if (n_quer_loc >= max_output_len)
- break;
}
/*
* We've copied up until the last ignorable constant. Copy over the
- * remaining bytes of the original query string, or at least as much as
- * will fit.
+ * remaining bytes of the original query string.
*/
len_to_wrt = query_len - quer_loc;
- len_to_wrt = Min(len_to_wrt, max_output_len - n_quer_loc);
Assert(len_to_wrt >= 0);
memcpy(norm_query + n_quer_loc, query + quer_loc, len_to_wrt);
n_quer_loc += len_to_wrt;
- /* XXX: pg_hint_plan doesn't truncate query string. */
-#ifdef NOT_USED
- /*
- * If we ran out of space, we need to do an encoding-aware truncation,
- * just to make sure we don't have an incomplete character at the end.
- */
- if (n_quer_loc >= max_output_len)
- query_len = pg_encoding_mbcliplen(encoding,
- norm_query,
- n_quer_loc,
- pgss->query_size - 1);
- else
-#endif
- query_len = n_quer_loc;
+ Assert(n_quer_loc <= query_len);
+ norm_query[n_quer_loc] = '\0';
- *query_len_p = query_len;
+ *query_len_p = n_quer_loc;
return norm_query;
}
* a problem.
*
* Duplicate constant pointers are possible, and will have their lengths
- * marked as '-1', so that they are later ignored. (Actually, we assume the
+ * marked as '-1', so that they are later ignored. (Actually, we assume the
* lengths were initialized as -1 to start with, and don't change them here.)
*
* N.B. There is an assumption that a '-' character at a Const location begins
* adjustment of location to that of the leading '-'
* operator in the event of a negative constant. It is
* also useful for our purposes to start from the minus
- * symbol. In this way, queries like "select * from foo
+ * symbol. In this way, queries like "select * from foo
* where bar = 1" and "select * from foo where bar = -2"
* will have identical normalized query strings.
*/
else
return 0;
}
-
* The following GUC parameters need the setting of the default value to
* succeed in regression test.
*/
+
+/* Fix auto-tunable parameters */
+ALTER SYSTEM SET effective_cache_size TO 16384;
+\! pg_ctl reload
+SET effective_cache_size TO 16384;
+
CREATE VIEW settings AS
SELECT name, setting, category
FROM pg_settings
OR name = 'client_min_messages'
ORDER BY category, name;
SELECT * FROM settings;
+
+ANALYZE;
\ No newline at end of file
--- /dev/null
+#! /bin/sh
+cat $1 | \
+sed 's/cost=[\.0-9]*/cost=xxx/;s/width=[0-9]*/width=xxx/' |\
+grep -v "Planning time:"
SET search_path TO public;
+SET client_min_messages TO log;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
LOAD 'pg_hint_plan';
SET pg_hint_plan.debug_print TO on;
-SET client_min_messages TO LOG;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
--
-- Rows hint tests
--
+-- Explain result includes "Planning time" if COSTS is enabled, but
+-- this test needs it enabled for get rows count. So do tests via psql
+-- and grep -v the mutable line.
+
-- value types
+\o results/pg_hint_plan.tmpout
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 +99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 -99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 *99) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 *0.01) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #aa) */
-EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 /99) */
-EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id); -- ERROR
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
-- round up to 1
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 -99999) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
-- complex join tree
+\o results/pg_hint_plan.tmpout
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t2 #22) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+
+\o results/pg_hint_plan.tmpout
/*+ Rows(t1 t3 *10) */
EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON (t3.id = t2.id);
+\o
+\! sql/maskout.sh results/pg_hint_plan.tmpout
+\! rm results/pg_hint_plan.tmpout
----
---- No. A-8-1 original GUC parameter
----
-
+---- Don't test postgresql itself.
-- No. A-8-1-1
-SET ROLE super_user;
-SET pg_hint_plan.debug_print TO off;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-
--- No. A-8-1-2
-SET ROLE normal_user;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-SET pg_hint_plan.enable_hint TO off;
-SET pg_hint_plan.debug_print TO on;
-SET pg_hint_plan.parse_messages TO error;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-RESET pg_hint_plan.enable_hint;
-RESET pg_hint_plan.debug_print;
-RESET pg_hint_plan.parse_messages;
-SHOW pg_hint_plan.enable_hint;
-SHOW pg_hint_plan.debug_print;
-SHOW pg_hint_plan.parse_messages;
-
-RESET ROLE;
+-- SET ROLE super_user;
+-- SET pg_hint_plan.debug_print TO off;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- SET pg_hint_plan.enable_hint TO off;
+-- SET pg_hint_plan.debug_print TO on;
+-- SET pg_hint_plan.parse_messages TO error;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- RESET pg_hint_plan.enable_hint;
+-- RESET pg_hint_plan.debug_print;
+-- RESET pg_hint_plan.parse_messages;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+--
+-- -- No. A-8-1-2
+-- SET ROLE normal_user;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- SET pg_hint_plan.enable_hint TO off;
+-- SET pg_hint_plan.debug_print TO on;
+-- SET pg_hint_plan.parse_messages TO error;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+-- RESET pg_hint_plan.enable_hint;
+-- RESET pg_hint_plan.debug_print;
+-- RESET pg_hint_plan.parse_messages;
+-- SHOW pg_hint_plan.enable_hint;
+-- SHOW pg_hint_plan.debug_print;
+-- SHOW pg_hint_plan.parse_messages;
+--
+-- RESET ROLE;
----
---- No. A-8-2 original GUC parameter pg_hint_plan.enable_hint
----
-- No. A-8-2-1
+SET pg_hint_plan.debug_print TO off;
SET pg_hint_plan.enable_hint TO on;
SHOW pg_hint_plan.enable_hint;
/*+Set(enable_indexscan off)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-- No. A-8-2-3
-SET pg_hint_plan.enable_hint TO DEFAULT;
-SHOW pg_hint_plan.enable_hint;
-/*+Set(enable_indexscan off)*/
-EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+-- Don't test PostgreSQL itself.
+-- SET pg_hint_plan.enable_hint TO DEFAULT;
+-- SHOW pg_hint_plan.enable_hint;
+-- /*+Set(enable_indexscan off)*/
+-- EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-- No. A-8-2-4
-SET pg_hint_plan.enable_hint TO enable;
-SHOW pg_hint_plan.enable_hint;
+-- Don't test PostgreSQL itself
+-- SET pg_hint_plan.enable_hint TO enable;
+-- SHOW pg_hint_plan.enable_hint;
----
---- No. A-8-3 original GUC parameter pg_hint_plan.debug_print
----
-- No. A-8-3-1
+SET pg_hint_plan.enable_hint TO on;
+SHOW pg_hint_plan.enable_hint;
SET pg_hint_plan.debug_print TO on;
SHOW pg_hint_plan.debug_print;
/*+Set(enable_indexscan off)*/
-- No. J-1-6-11
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+
+\o results/ut-J.tmpout
/*+MergeJoin(t1 t2)NestLoop(st1 st2)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+\o
+\! sql/maskout.sh results/ut-J.tmpout
+
--
-- There are cases where difference in the measured value and predicted value
-- depending upon the version of PostgreSQL
----
-- No. J-3-5-1
EXPLAIN (COSTS false) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
+\o results/ut-J.tmpout
/*+NestLoop(t1 t2)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1 FULL OUTER JOIN s1.t2 ON (t1.c1 = t2.c1);
+\o
+\! sql/maskout.sh results/ut-J.tmpout
+\! rm results/ut-J.tmpout
SET client_min_messages TO LOG;
SET search_path TO public;
-\o results/R_sample.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_sample.out.log > results/R_sample.out
-\! diff expected/R_sample.out results/R_sample.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-1 specified pattern of the object name
----
-- No. R-1-1-1
-\o results/R_1-1-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-1.out.log > results/R_1-1-1.out
-\! diff expected/R_1-1-1.out results/R_1-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-1-2
-\o results/R_1-1-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-2.out.log > results/R_1-1-2.out
-\! diff expected/R_1-1-2.out results/R_1-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-1-3
-\o results/R_1-1-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t_1 t_2 #1)*/
EXPLAIN SELECT * FROM s1.t1 t_1, s1.t2 t_2 WHERE t_1.c1 = t_2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-1-3.out.log > results/R_1-1-3.out
-\! diff expected/R_1-1-3.out results/R_1-1-3.out
-
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-2 specified schema name in the hint option
----
-- No. R-1-2-1
-\o results/R_1-2-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-2-1.out.log > results/R_1-2-1.out
-\! diff expected/R_1-2-1.out results/R_1-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-2-2
-\o results/R_1-2-2.out.log
+\o results/ut-R.tmpout
/*+Rows(s1.t1 s1.t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-2-2.out.log > results/R_1-2-2.out
-\! diff expected/R_1-2-2.out results/R_1-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-3 table doesn't exist in the hint option
----
-- No. R-1-3-1
-\o results/R_1-3-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-3-1.out.log > results/R_1-3-1.out
-\! diff expected/R_1-3-1.out results/R_1-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-3-2
-\o results/R_1-3-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t3 t4 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-3-2.out.log > results/R_1-3-2.out
-\! diff expected/R_1-3-2.out results/R_1-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-4 conflict table name
----
-- No. R-1-4-1
-\o results/R_1-4-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-1.out.log > results/R_1-4-1.out
-\! diff expected/R_1-4-1.out results/R_1-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+
-- No. R-1-4-2
-\o results/R_1-4-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(s1.t1 s2.t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 s2t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s2.t1 s2t1 WHERE s1.t1.c1 = s2t1.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-2.out.log > results/R_1-4-2.out
-\! diff expected/R_1-4-2.out results/R_1-4-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-4-3
-\o results/R_1-4-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(st1 st2 #1)Rows(t1 t2 #1)*/
EXPLAIN SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-4-3.out.log > results/R_1-4-3.out
-\! diff expected/R_1-4-3.out results/R_1-4-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-5 conflict table name
----
-- No. R-1-5-1
-\o results/R_1-5-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-1.out.log > results/R_1-5-1.out
-\! diff expected/R_1-5-1.out results/R_1-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-5-2
-\o results/R_1-5-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-2.out.log > results/R_1-5-2.out
-\! diff expected/R_1-5-2.out results/R_1-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-5-3
-\o results/R_1-5-3.out.log
+\o results/ut-R.tmpout
/*+(t1 t1)(t2 t2)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-3.out.log > results/R_1-5-3.out
-\! diff expected/R_1-5-3.out results/R_1-5-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-1-6 object type for the hint
----
-- No. R-1-6-1
-\o results/R_1-6-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-1.out.log > results/R_1-6-1.out
-\! diff expected/R_1-6-1.out results/R_1-6-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-2
-\o results/R_1-6-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.p1 t1, s1.p1 t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-2.out.log > results/R_1-6-2.out
-\! diff expected/R_1-6-2.out results/R_1-6-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-3
-\o results/R_1-6-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.ul1 t1, s1.ul1 t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-3.out.log > results/R_1-6-3.out
-\! diff expected/R_1-6-3.out results/R_1-6-3.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-4
CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
-\o results/R_1-6-4.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM tm1 t1, tm1 t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-4.out.log > results/R_1-6-4.out
-\! diff expected/R_1-6-4.out results/R_1-6-4.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-5
-\o results/R_1-6-5.out.log
-EXPLAIN SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+CREATE TEMP TABLE t_pg_class WITH OIDS AS SELECT * from pg_class LIMIT 100;
+\o results/ut-R.tmpout
+EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
-EXPLAIN SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2 WHERE t1.oid = t2.oid;
+EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-5.out.log > results/R_1-6-5.out
-\! diff expected/R_1-6-5.out results/R_1-6-5.out
+\! sql/maskout.sh results/ut-R.tmpout
+
-- No. R-1-6-6
-- refer ut-fdw.sql
-- No. R-1-6-7
-\o results/R_1-6-7.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.f1() t1, s1.f1() t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-7.out.log > results/R_1-6-7.out
-\! diff expected/R_1-6-7.out results/R_1-6-7.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-8
-\o results/R_1-6-8.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(*VALUES* t2 #1)*/
EXPLAIN SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')) AS t1 (c1, c2, c3, c4), s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-8.out.log > results/R_1-6-8.out
-\! diff expected/R_1-6-8.out results/R_1-6-8.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-9
-\o results/R_1-6-9.out.log
+\o results/ut-R.tmpout
EXPLAIN WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)Rows(t1 c1 +1)*/
EXPLAIN WITH c1(c1) AS (SELECT max(t1.c1) FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1) SELECT * FROM s1.t1, c1 WHERE t1.c1 = c1.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-9.out.log > results/R_1-6-9.out
-\! diff expected/R_1-6-9.out results/R_1-6-9.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-10
-\o results/R_1-6-10.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(v1t1 v1t1_ #1)*/
EXPLAIN SELECT * FROM s1.v1 t1, s1.v1_ t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-10.out.log > results/R_1-6-10.out
-\! diff expected/R_1-6-10.out results/R_1-6-10.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-6-11
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)Rows(st1 st2 #1)*/
EXPLAIN (COSTS true) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1 AND t1.c1 = (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2 WHERE st1.c1 = st2.c1);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
--
-- There are cases where difference in the measured value and predicted value
-- depending upon the version of PostgreSQL
--
-\o results/R_1-6-11.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 st2 #1)*/
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #1)*/
EXPLAIN SELECT * FROM s1.t1, (SELECT t2.c1 FROM s1.t2) st2 WHERE t1.c1 = st2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-6-11.out.log > results/R_1-6-11.out
-\! diff expected/R_1-6-11.out results/R_1-6-11.out
+\! sql/maskout.sh results/ut-R.tmpout
+
----
---- No. R-1-7 specified number of conditions
----
-- No. R-1-7-1
-\o results/R_1-7-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 #1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-1.out.log > results/R_1-7-1.out
-\! diff expected/R_1-7-1.out results/R_1-7-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-7-2
-\o results/R_1-7-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-2.out.log > results/R_1-7-2.out
-\! diff expected/R_1-7-2.out results/R_1-7-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-1-7-3
-\o results/R_1-7-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #notrows)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-7-3.out.log > results/R_1-7-3.out
-\! diff expected/R_1-7-3.out results/R_1-7-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-2-1 some complexity query blocks
----
-- No. R-2-1-1
-\o results/R_2-1-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-1.out.log > results/R_2-1-1.out
-\! diff expected/R_2-1-1.out results/R_2-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-2
-\o results/R_2-1-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-2.out.log > results/R_2-1-2.out
-\! diff expected/R_2-1-2.out results/R_2-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-3
-\o results/R_2-1-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 #1)Rows(bmt4 bmt3 bmt2 #1)Rows(bmt1 bmt2 bmt3 bmt4 #1)
*/
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-3.out.log > results/R_2-1-3.out
-\! diff expected/R_2-1-3.out results/R_2-1-3.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-4
-\o results/R_2-1-4.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 #1)Rows(bmt4 bmt3 bmt2 #1)Rows(bmt1 bmt2 bmt3 bmt4 #1)
*/
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-4.out.log > results/R_2-1-4.out
-\! diff expected/R_2-1-4.out results/R_2-1-4.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-5
-\o results/R_2-1-5.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.c1 = b1t2.c1 AND b1t1.c1 = b1t3.c1 AND b1t1.c1 = b1t4.c1
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.c1 = b2t2.c1 AND b2t1.c1 = b2t3.c1 AND b2t1.c1 = b2t4.c1
-)
-;
+);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
)
;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-5.out.log > results/R_2-1-5.out
-\! diff expected/R_2-1-5.out results/R_2-1-5.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-6
-\o results/R_2-1-6.out.log
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.c1 = b3t2.c1 AND b3t1.c1 = b3t3.c1 AND b3t1.c1 = b3t4.c1
)
;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
)
;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-6.out.log > results/R_2-1-6.out
-\! diff expected/R_2-1-6.out results/R_2-1-6.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-7
-\o results/R_2-1-7.out.log
+\o results/ut-R.tmpout
/*+
Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
, c1, c2
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
-AND bmt1.c1 = c2.c1
-;
+AND bmt1.c1 = c2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-7.out.log > results/R_2-1-7.out
-\! diff expected/R_2-1-7.out results/R_2-1-7.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-1-8
-\o results/R_2-1-8.out.log
+\o results/ut-R.tmpout
/*+
Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
+AND bmt1.c1 = c3.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
-AND bmt1.c1 = c3.c1
-;
+AND bmt1.c1 = c3.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-1-8.out.log > results/R_2-1-8.out
-\! diff expected/R_2-1-8.out results/R_2-1-8.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-2-2 the number of the tables per quiry block
----
-- No. R-2-2-1
-\o results/R_2-2-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt1)
*/
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1 WHERE b3t1.c1 = 1
-)
-;
+);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt1)
Rows(bmt1 c1 #1)
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1 WHERE b3t1.c1 = 1
-)
-;
+);
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-1.out.log > results/R_2-2-1.out
-\! diff expected/R_2-2-1.out results/R_2-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-2-2
-\o results/R_2-2-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt2 bmt1)
Leading(b1t2 b1t1)
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.c1 = b3t2.c1
-)
-;
+);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt2 bmt1)
Leading(b1t2 b1t1)
)
;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-2.out.log > results/R_2-2-2.out
-\! diff expected/R_2-2-2.out results/R_2-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-2-3
-\o results/R_2-2-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.c1 = b3t2.c1 AND b3t1.c1 = b3t3.c1 AND b3t1.c1 = b3t4.c1
-)
-;
+);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.c1 = b3t2.c1 AND b3t1.c1 = b3t3.c1 AND b3t1.c1 = b3t4.c1
-)
-;
+);
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-3.out.log > results/R_2-2-3.out
-\! diff expected/R_2-2-3.out results/R_2-2-3.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-2-4
-\o results/R_2-2-4.out.log
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1
-)
-;
+);
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.c1 = bmt2.c1 AND bmt1.c1 = bmt3.c1 AND bmt1.c1 = bmt4.c1 AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT b3t1.c1 FROM s1.t1 b3t1
-)
-;
+);
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-2-4.out.log > results/R_2-2-4.out
-\! diff expected/R_2-2-4.out results/R_2-2-4.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-2-3 RULE or VIEW
----
-- No. R-2-3-1
-\o results/R_2-3-1.out.log
+\o results/ut-R.tmpout
/*+
Leading(r1 t1 t2 t3 t4)
*/
EXPLAIN UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r1 t1 t2 t3 t4)
Rows(r1 t1 t2 t3 t4 #2)
Rows(r1 t1 #2)
*/
EXPLAIN UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r1_ b1t1 b1t2 b1t3 b1t4)
*/
EXPLAIN UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r1_ b1t1 b1t2 b1t3 b1t4)
Rows(r1_ b1t1 b1t2 b1t3 b1t4 #2)
*/
EXPLAIN UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-1.out.log > results/R_2-3-1.out
-\! diff expected/R_2-3-1.out results/R_2-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-2
-\o results/R_2-3-2.out.log
+\o results/ut-R.tmpout
/*+
Leading(r2 t1 t2 t3 t4)
*/
EXPLAIN UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r2 t1 t2 t3 t4)
Rows(r2 t1 t2 t3 t4 #2)
Rows(r2 t1 #2)
*/
EXPLAIN UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r2_ b1t1 b1t2 b1t3 b1t4)
Leading(r2_ b2t1 b2t2 b2t3 b2t4)
*/
EXPLAIN UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r2_ b1t1 b1t2 b1t3 b1t4)
Leading(r2_ b2t1 b2t2 b2t3 b2t4)
*/
EXPLAIN UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-2.out.log > results/R_2-3-2.out
-\! diff expected/R_2-3-2.out results/R_2-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-3
-\o results/R_2-3-3.out.log
+\o results/ut-R.tmpout
/*+
Leading(r3 t1 t2 t3 t4)
*/
EXPLAIN UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r3 t1 t2 t3 t4)
Rows(r3 t1 t2 t3 t4 #2)
Rows(r3 t1 #2)
*/
EXPLAIN UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r3_ b1t1 b1t2 b1t3 b1t4)
Leading(r3_ b2t1 b2t2 b2t3 b2t4)
Leading(r3_ b3t1 b3t2 b3t3 b3t4)
*/
EXPLAIN UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(r3_ b1t1 b1t2 b1t3 b1t4)
Leading(r3_ b2t1 b2t2 b2t3 b2t4)
*/
EXPLAIN UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-3.out.log > results/R_2-3-3.out
-\! diff expected/R_2-3-3.out results/R_2-3-3.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-4
-\o results/R_2-3-4.out.log
+\o results/ut-R.tmpout
/*+HashJoin(v1t1 v1t1)*/
EXPLAIN SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-4.out.log > results/R_2-3-4.out
-\! diff expected/R_2-3-4.out results/R_2-3-4.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-5
-\o results/R_2-3-5.out.log
+\o results/ut-R.tmpout
/*+NestLoop(v1t1 v1t1_)*/
EXPLAIN SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+NestLoop(v1t1 v1t1_)Rows(v1t1 v1t1_ #1)*/
EXPLAIN SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-5.out.log > results/R_2-3-5.out
-\! diff expected/R_2-3-5.out results/R_2-3-5.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-6
-\o results/R_2-3-6.out.log
+\o results/ut-R.tmpout
/*+RowsHashJoin(r4t1 r4t1)*/
EXPLAIN SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-6.out.log > results/R_2-3-6.out
-\! diff expected/R_2-3-6.out results/R_2-3-6.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-3-7
-\o results/R_2-3-7.out.log
+\o results/ut-R.tmpout
/*+NestLoop(r4t1 r5t1)*/
EXPLAIN SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+NestLoop(r4t1 r5t1)Rows(r4t1 r5t1 #1)*/
EXPLAIN SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-7.out.log > results/R_2-3-7.out
-\! diff expected/R_2-3-7.out results/R_2-3-7.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-2-4 VALUES clause
----
-- No. R-2-4-1
-\o results/R_2-4-1.out.log
+\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;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-4-1.out.log > results/R_2-4-1.out
-\! diff expected/R_2-4-1.out results/R_2-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-4-2
-\o results/R_2-4-2.out.log
+\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;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-4-2.out.log > results/R_2-4-2.out
-\! diff expected/R_2-4-2.out results/R_2-4-2.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-2-5
----
-- No. R-2-5-1
-\o results/R_2-5-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt1 bmt2 bmt3 bmt4 *0.7)
*/
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-1.out.log > results/R_2-5-1.out
-\! diff expected/R_2-5-1.out results/R_2-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-5-2
-\o results/R_2-5-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt3 *0.6)
*/
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-2.out.log > results/R_2-5-2.out
-\! diff expected/R_2-5-2.out results/R_2-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-2-5-3
-\o results/R_2-5-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
Rows(bmt4 bmt1 *0.5)
*/
EXPLAIN SELECT bmt1.c1 FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.c1 = sbmt2.c1 AND bmt1.c1 = sbmt3.c1 AND bmt1.c1 = sbmt4.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-5-3.out.log > results/R_2-5-3.out
-\! diff expected/R_2-5-3.out results/R_2-5-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-3-1 abusolute value
----
-- No. R-3-1-1
-\o results/R_3-1-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #0)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-1.out.log > results/R_3-1-1.out
-\! diff expected/R_3-1-1.out results/R_3-1-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-1-2
-\o results/R_3-1-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 #5)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-1-2.out.log > results/R_3-1-2.out
-\! diff expected/R_3-1-2.out results/R_3-1-2.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-3-2 increase or decrease value
----
-- No. R-3-2-1
-\o results/R_3-2-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 +1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-1.out.log > results/R_3-2-1.out
-\! diff expected/R_3-2-1.out results/R_3-2-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-2-2
-\o results/R_3-2-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 -1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-2.out.log > results/R_3-2-2.out
-\! diff expected/R_3-2-2.out results/R_3-2-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-2-3
-\o results/R_3-2-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 -1000)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-2-3.out.log > results/R_3-2-3.out
-\! diff expected/R_3-2-3.out results/R_3-2-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-3-3 multiple
----
-- No. R-3-3-1
-\o results/R_3-3-1.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *0)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-1.out.log > results/R_3-3-1.out
-\! diff expected/R_3-3-1.out results/R_3-3-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-3-2
-\o results/R_3-3-2.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *2)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-2.out.log > results/R_3-3-2.out
-\! diff expected/R_3-3-2.out results/R_3-3-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-3-3
-\o results/R_3-3-3.out.log
+\o results/ut-R.tmpout
/*+Rows(t1 t2 *0.1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-3-3.out.log > results/R_3-3-3.out
-\! diff expected/R_3-3-3.out results/R_3-3-3.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-3-4 join inherit tables
----
-- No. R-3-4-1
-\o results/R_3-4-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(p1 p2 #1)*/
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-4-1.out.log > results/R_3-4-1.out
-\! diff expected/R_3-4-1.out results/R_3-4-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-4-2
-\o results/R_3-4-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(p1c1 p2c1 #1)*/
EXPLAIN SELECT * FROM s1.p1, s1.p2 WHERE p1.c1 = p2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-4-2.out.log > results/R_3-4-2.out
-\! diff expected/R_3-4-2.out results/R_3-4-2.out
+\! sql/maskout.sh results/ut-R.tmpout
----
---- No. R-3-5 conflict join method hint
----
-- No. R-3-5-1
-\o results/R_3-5-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-1.out.log > results/R_3-5-1.out
-\! diff expected/R_3-5-1.out results/R_3-5-1.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-5-2
-\o results/R_3-5-2.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-2.out.log > results/R_3-5-2.out
-\! diff expected/R_3-5-2.out results/R_3-5-2.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-5-3
-\o results/R_3-5-3.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-3.out.log > results/R_3-5-3.out
-\! diff expected/R_3-5-3.out results/R_3-5-3.out
+\! sql/maskout.sh results/ut-R.tmpout
-- No. R-3-5-4
-\o results/R_3-5-4.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\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;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-5-4.out.log > results/R_3-5-4.out
-\! diff expected/R_3-5-4.out results/R_3-5-4.out
+\! sql/maskout.sh results/ut-R.tmpout
+
----
---- No. R-3-6 hint state output
----
-- No. R-3-6-1
SET client_min_messages TO DEBUG1;
-\o results/R_3-6-1.out.log
+\o results/ut-R.tmpout
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
+\o
+\! sql/maskout.sh results/ut-R.tmpout
+
+\o results/ut-R.tmpout
/*+Rows(t1 t2 +1)*/
EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
\o
-\! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_3-6-1.out.log > results/R_3-6-1.out
-\! diff expected/R_3-6-1.out results/R_3-6-1.out
+\! sql/maskout.sh results/ut-R.tmpout
+\! rm results/ut-R.tmpout
LOAD 'pg_hint_plan';
+-- We cannot do ALTER USER current_user SET ...
+DELETE FROM pg_db_role_setting WHERE setrole = (SELECT oid FROM pg_roles WHERE rolname = current_user);
+INSERT INTO pg_db_role_setting (SELECT 0, (SELECT oid FROM pg_roles WHERE rolname = current_user), '{client_min_messages=log,pg_hint_plan.debug_print=on}');
+ALTER SYSTEM SET session_preload_libraries TO 'pg_hint_plan';
+\! pg_ctl reload
SET pg_hint_plan.enable_hint TO on;
SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
----
-- No. S-3-5-1
-/*+IndexScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-2
-/*+BitmapScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+BitmapScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-3
-/*+IndexOnlyScan(ti1 ti1_pred)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexOnlyScan(ti1 ti1_pred)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-4
-/*+IndexScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-5
-/*+BitmapScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+BitmapScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT * FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-6
-/*+IndexOnlyScan(ti1 not_exist)*/
-EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100;
+\! psql contrib_regression -c "/*+IndexOnlyScan(ti1 not_exist)*/ EXPLAIN (COSTS true) SELECT c1 FROM s1.ti1 WHERE c1 = 100" | grep -v "Planning time:"
-- No. S-3-5-7
EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-/*+TidScan(t1)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
+\! psql contrib_regression -c "/*+TidScan(t1)*/ EXPLAIN (COSTS true) SELECT * FROM s1.t1 WHERE t1.c1 = 1" | grep -v "Planning time:"
----
---- No. S-3-6 query structure
EXPLAIN (COSTS false) SELECT * FROM s1.p2 WHERE c1 = 1;
-- No. S-3-10-3
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
-/*+IndexScan(p1 p1_parent)*/
-EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10;
+\! psql contrib_regression -c "EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10" | grep -v "Planning time:"
+\! psql contrib_regression -c "/*+IndexScan(p1 p1_parent)*/ EXPLAIN SELECT c4 FROM s1.p1 WHERE c2 * 2 < 100 AND c1 < 10" | grep -v "Planning time:"
-- No. S-3-10-4
-/*+IndexScan(p1 p1_i2)*/
-EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1;
+
+\! psql contrib_regression -c "/*+IndexScan(p1 p1_i2)*/ EXPLAIN SELECT c2 FROM s1.p1 WHERE c2 = 1" | grep -v "Planning time:"
-- No. S-3-10-5
-/*+IndexScan(p2 p2c1_pkey)*/
-EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1;
+\! psql contrib_regression -c "/*+IndexScan(p2 p2c1_pkey)*/ EXPLAIN (COSTS true) SELECT * FROM s1.p2 WHERE c1 = 1" | grep -v "Planning time:"
----
---- No. S-3-12 specified same table
-- No. S-3-15-5
/*+IndexScan(ti1 not_exist1 not_exist2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c2 = 1;
+
+DELETE FROM pg_db_role_setting WHERE setrole = (SELECT oid FROM pg_roles WHERE rolname = current_user);
+
+ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
+\! pg_ctl reload