summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-07-15 17:01:50 +0000
committerTomas Vondra2017-07-15 17:19:31 +0000
commitee92c90e6bf9935a2a642819e1cb2c408a817b45 (patch)
tree7141f75126cca29aa847d1f6fe891dcf897e085f
parent5218ae2994516f6b73697266d4baf7c76290292d (diff)
Accept plan changes in the equivclass regression test
The plans are fairly close to those generated on Postgres-XL 9.5, with some minor differences due to upstream optimizer changes (e.g. missing Subquery Scan when we can do Index Scan instead). The main change is that when a Merge Join is identified as unique, we may replace -> Materialize -> Sort Sort Key: ec1.f1 USING < -> Remote Subquery Scan on all (datanode1) -> Index Scan using ec1_pkey on ec1 Index Cond: (ff = '42'::bigint) with -> Remote Subquery Scan on all (datanode_1) -> Sort Sort Key: ec1.f1 USING < -> Index Scan using ec1_pkey on ec1 Index Cond: (ff = '42'::bigint) as there will be no rescans on the inner relation (so we do not need the additional Materialize step).
-rw-r--r--src/test/regress/expected/equivclass.out69
1 files changed, 38 insertions, 31 deletions
diff --git a/src/test/regress/expected/equivclass.out b/src/test/regress/expected/equivclass.out
index 2082b8a77b..cfa96c4264 100644
--- a/src/test/regress/expected/equivclass.out
+++ b/src/test/regress/expected/equivclass.out
@@ -317,6 +317,8 @@ explain (costs off)
-- let's try that as a mergejoin
set enable_mergejoin = on;
set enable_nestloop = off;
+-- excluding as XL does not support complex queries
+-- with 'union all'
-- check partially indexed scan
set enable_nestloop = on;
set enable_mergejoin = off;
@@ -358,22 +360,23 @@ explain (costs off)
union all
select ff + 4 as x from ec1) as ss1
where ss1.x = ec1.f1 and ec1.ff = 42::int8;
- QUERY PLAN
------------------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------
Merge Join
- Merge Cond: ((((ec1_1.ff + 2) + 1)) = ec1.f1)
- -> Merge Append
- Sort Key: (((ec1_1.ff + 2) + 1))
- -> Index Scan using ec1_expr2 on ec1 ec1_1
+ Merge Cond: (x = ec1.f1)
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
-> Sort
- Sort Key: (((ec1_2.ff + 3) + 1))
- -> Seq Scan on ec1 ec1_2
- -> Index Scan using ec1_expr4 on ec1 ec1_3
- -> Sort
- Sort Key: ec1.f1 USING <
- -> Index Scan using ec1_pkey on ec1
- Index Cond: (ff = '42'::bigint)
-(13 rows)
+ Sort Key: (((ec1_1.ff + 2) + 1))
+ -> Append
+ -> Seq Scan on ec1 ec1_1
+ -> Seq Scan on ec1 ec1_2
+ -> Seq Scan on ec1 ec1_3
+ -> Remote Subquery Scan on all (datanode_1)
+ -> Sort
+ Sort Key: ec1.f1 USING <
+ -> Index Scan using ec1_pkey on ec1
+ Index Cond: (ff = '42'::bigint)
+(14 rows)
-- check effects of row-level security
set enable_nestloop = on;
@@ -387,14 +390,16 @@ grant select on ec1 to regress_user_ectest;
explain (costs off)
select * from ec0 a, ec1 b
where a.ff = b.ff and a.ff = 43::bigint::int8alias1;
- QUERY PLAN
----------------------------------------------
- Nested Loop
- -> Index Scan using ec0_pkey on ec0 a
- Index Cond: (ff = '43'::int8alias1)
- -> Index Scan using ec1_pkey on ec1 b
- Index Cond: (ff = '43'::int8alias1)
-(5 rows)
+ QUERY PLAN
+---------------------------------------------------
+ Remote Fast Query Execution
+ Node/s: datanode_1, datanode_2
+ -> Nested Loop
+ -> Index Scan using ec0_pkey on ec0 a
+ Index Cond: (ff = '43'::int8alias1)
+ -> Index Scan using ec1_pkey on ec1 b
+ Index Cond: (ff = '43'::int8alias1)
+(7 rows)
set session authorization regress_user_ectest;
-- with RLS active, the non-leakproof a.ff = 43 clause is not treated
@@ -403,15 +408,17 @@ set session authorization regress_user_ectest;
explain (costs off)
select * from ec0 a, ec1 b
where a.ff = b.ff and a.ff = 43::bigint::int8alias1;
- QUERY PLAN
----------------------------------------------
- Nested Loop
- -> Index Scan using ec0_pkey on ec0 a
- Index Cond: (ff = '43'::int8alias1)
- -> Index Scan using ec1_pkey on ec1 b
- Index Cond: (ff = a.ff)
- Filter: (f1 < '5'::int8alias1)
-(6 rows)
+ QUERY PLAN
+---------------------------------------------------
+ Remote Fast Query Execution
+ Node/s: datanode_1, datanode_2
+ -> Nested Loop
+ -> Index Scan using ec0_pkey on ec0 a
+ Index Cond: (ff = '43'::int8alias1)
+ -> Index Scan using ec1_pkey on ec1 b
+ Index Cond: (ff = a.ff)
+ Filter: (f1 < '5'::int8alias1)
+(8 rows)
reset session authorization;
revoke select on ec0 from regress_user_ectest;