-- sum(int8) covers int8_avg_combine
EXPLAIN (COSTS OFF)
SELECT variance(unique1::int4), sum(unique1::int8) FROM tenk1;
- QUERY PLAN
-----------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------
Finalize Aggregate
- -> Gather
- Workers Planned: 4
- -> Partial Aggregate
- -> Parallel Seq Scan on tenk1
-(5 rows)
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Gather
+ Workers Planned: 4
+ -> Partial Aggregate
+ -> Parallel Seq Scan on tenk1
+(6 rows)
SELECT variance(unique1::int4), sum(unique1::int8) FROM tenk1;
variance | sum
create index on tidv (idv);
explain (costs off)
select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
- QUERY PLAN
-----------------------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------------
Merge Join
Merge Cond: (a.idv = b.idv)
- -> Index Only Scan using tidv_idv_idx on tidv a
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Index Only Scan using tidv_idv_idx on tidv a
-> Materialize
- -> Index Only Scan using tidv_idv_idx on tidv b
-(5 rows)
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Index Only Scan using tidv_idv_idx on tidv b
+(7 rows)
set enable_mergejoin = 0;
explain (costs off)
select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
- QUERY PLAN
-----------------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------------
Nested Loop
- -> Seq Scan on tidv a
- -> Index Only Scan using tidv_idv_idx on tidv b
- Index Cond: (idv = a.idv)
-(4 rows)
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Seq Scan on tidv a
+ -> Materialize
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Index Only Scan using tidv_idv_idx on tidv b
+ Index Cond: (idv = a.idv)
+(7 rows)
rollback;
--
-- test handling of SRFs in targetlist (bug in 10.0)
explain (costs off)
select count(*), generate_series(1,2) from tenk1 group by twenty;
- QUERY PLAN
-----------------------------------------------------------
+ QUERY PLAN
+-----------------------------------------------------------------
ProjectSet
-> Finalize GroupAggregate
Group Key: twenty
- -> Gather Merge
- Workers Planned: 4
- -> Partial GroupAggregate
- Group Key: twenty
- -> Sort
- Sort Key: twenty
- -> Parallel Seq Scan on tenk1
-(10 rows)
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Gather Merge
+ Workers Planned: 4
+ -> Partial GroupAggregate
+ Group Key: twenty
+ -> Sort
+ Sort Key: twenty
+ -> Parallel Seq Scan on tenk1
+(11 rows)
select count(*), generate_series(1,2) from tenk1 group by twenty;
count | generate_series
-- case with degenerate ORDER BY
explain (verbose, costs off)
select 'foo' as f, generate_series(1,2) as g from few order by 1;
- QUERY PLAN
-----------------------------------------------
- ProjectSet
+ QUERY PLAN
+-----------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
Output: 'foo'::text, generate_series(1, 2)
- -> Seq Scan on public.few
- Output: id, dataa, datab
-(4 rows)
+ -> ProjectSet
+ Output: 'foo'::text, generate_series(1, 2)
+ -> Seq Scan on public.few
+ Output: id, dataa, datab
+(6 rows)
select 'foo' as f, generate_series(1,2) as g from few order by 1;
f | g
explain (costs off)
insert into uv_iocu_view (a, b) values ('xyxyxy', 3)
on conflict (a) do update set b = excluded.b where excluded.c > 0;
- QUERY PLAN
------------------------------------------------------------------------------------
- Insert on uv_iocu_tab
- Conflict Resolution: UPDATE
- Conflict Arbiter Indexes: uv_iocu_tab_a_key
- Conflict Filter: ((excluded.b + '1'::double precision) > '0'::double precision)
- -> Result
-(5 rows)
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_2)
+ -> Insert on uv_iocu_tab
+ Conflict Resolution: UPDATE
+ Conflict Arbiter Indexes: uv_iocu_tab_a_key
+ Conflict Filter: ((excluded.b + '1'::double precision) > '0'::double precision)
+ -> Result
+(6 rows)
insert into uv_iocu_view (a, b) values ('xyxyxy', 3)
on conflict (a) do update set b = excluded.b where excluded.c > 0;
where excluded.aa > 0
and excluded.bb != ''
and excluded.cc is not null;
- QUERY PLAN
----------------------------------------------------------------------------------------------------------
- Insert on uv_iocu_tab
- Conflict Resolution: UPDATE
- Conflict Arbiter Indexes: uv_iocu_tab_a_key
- Conflict Filter: ((excluded.a > 0) AND (excluded.b <> ''::text) AND ((excluded.*)::text IS NOT NULL))
- -> Result
-(5 rows)
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1)
+ -> Insert on uv_iocu_tab
+ Conflict Resolution: UPDATE
+ Conflict Arbiter Indexes: uv_iocu_tab_a_key
+ Conflict Filter: ((excluded.a > 0) AND (excluded.b <> ''::text) AND ((excluded.*)::text IS NOT NULL))
+ -> Result
+(6 rows)
insert into uv_iocu_view (aa,bb) values (1,'y')
on conflict (aa) do update set bb = 'Rejected: '||excluded.*