Remove costs from explain plans in window_functions tests

release-7.4
Marco Slot 2018-06-14 23:39:03 +02:00 committed by velioglu
parent 79235c35fb
commit 8dc913ef04
2 changed files with 73 additions and 73 deletions

View File

@ -500,7 +500,7 @@ ORDER BY
1 | 3.2857142857142857 | 1.00000000000000000000 1 | 3.2857142857142857 | 1.00000000000000000000
(6 rows) (6 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
AVG(avg(value_1)) OVER (PARTITION BY user_id, max(user_id), MIN(value_2)), AVG(avg(value_1)) OVER (PARTITION BY user_id, max(user_id), MIN(value_2)),
@ -511,26 +511,26 @@ GROUP BY
1 1
ORDER BY ORDER BY
3 DESC, 2 DESC, 1 DESC; 3 DESC, 2 DESC, 1 DESC;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------
Sort (cost=0.00..0.00 rows=0 width=0) Sort
Sort Key: remote_scan.avg_1 DESC, remote_scan.avg DESC, remote_scan.user_id DESC Sort Key: remote_scan.avg_1 DESC, remote_scan.avg DESC, remote_scan.user_id DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id Group Key: remote_scan.user_id
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=5.06..5.80 rows=33 width=128) -> WindowAgg
-> Sort (cost=5.06..5.14 rows=33 width=128) -> Sort
Sort Key: users_table.user_id, (min(users_table.user_id)), (avg(users_table.value_1)) Sort Key: users_table.user_id, (min(users_table.user_id)), (avg(users_table.value_1))
-> WindowAgg (cost=3.48..4.22 rows=33 width=128) -> WindowAgg
-> Sort (cost=3.48..3.56 rows=33 width=96) -> Sort
Sort Key: users_table.user_id, (max(users_table.user_id)), (min(users_table.value_2)) Sort Key: users_table.user_id, (max(users_table.user_id)), (min(users_table.value_2))
-> HashAggregate (cost=2.07..2.65 rows=33 width=96) -> HashAggregate
Group Key: users_table.user_id Group Key: users_table.user_id
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(18 rows) (18 rows)
SELECT SELECT
@ -579,7 +579,7 @@ ORDER BY
6 | 5 | 3.0000000000000000 6 | 5 | 3.0000000000000000
(32 rows) (32 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
1 + sum(value_1), 1 + sum(value_1),
@ -590,23 +590,23 @@ GROUP BY
user_id, value_2 user_id, value_2
ORDER BY ORDER BY
user_id, value_2; user_id, value_2;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------
Sort (cost=0.00..0.00 rows=0 width=0) Sort
Sort Key: remote_scan.user_id, remote_scan.worker_column_4 Sort Key: remote_scan.user_id, remote_scan.worker_column_4
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_4 Group Key: remote_scan.user_id, remote_scan.worker_column_4
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=2.16..3.40 rows=33 width=48) -> WindowAgg
-> GroupAggregate (cost=2.16..2.82 rows=33 width=16) -> GroupAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Sort (cost=2.16..2.24 rows=33 width=12) -> Sort
Sort Key: users_table.user_id, users_table.value_2 Sort Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(15 rows) (15 rows)
SELECT SELECT
@ -719,7 +719,7 @@ ORDER BY user_id, avg(value_1) DESC;
6 | 1.00000000000000000000 | 5 6 | 1.00000000000000000000 | 5
(32 rows) (32 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -730,21 +730,21 @@ GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC; ORDER BY user_id, avg(value_1) DESC;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=0.00..0.00 rows=0 width=0) Sort
Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_5 Group Key: remote_scan.user_id, remote_scan.worker_column_5
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=3.32..4.14 rows=33 width=80) -> WindowAgg
-> Sort (cost=3.32..3.40 rows=33 width=56) -> Sort
Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1)))) Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1))))
-> HashAggregate (cost=1.91..2.49 rows=33 width=56) -> HashAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(15 rows) (15 rows)
-- order by in the window function is same as avg(value_1) DESC -- order by in the window function is same as avg(value_1) DESC
@ -793,7 +793,7 @@ ORDER BY user_id, avg(value_1) DESC;
(32 rows) (32 rows)
-- limit is not pushed down to worker !! -- limit is not pushed down to worker !!
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -805,25 +805,25 @@ ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_5 Group Key: remote_scan.user_id, remote_scan.worker_column_5
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=3.32..4.14 rows=33 width=80) -> WindowAgg
-> Sort (cost=3.32..3.40 rows=33 width=56) -> Sort
Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1)))) Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1))))
-> HashAggregate (cost=1.91..2.49 rows=33 width=56) -> HashAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(16 rows) (16 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -835,25 +835,25 @@ ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_5 Group Key: remote_scan.user_id, remote_scan.worker_column_5
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=3.32..4.14 rows=33 width=80) -> WindowAgg
-> Sort (cost=3.32..3.40 rows=33 width=56) -> Sort
Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1)))) Sort Key: users_table.user_id, (('1'::numeric / ('1'::numeric + avg(users_table.value_1))))
-> HashAggregate (cost=1.91..2.49 rows=33 width=56) -> HashAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(16 rows) (16 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -865,25 +865,25 @@ ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_5 Group Key: remote_scan.user_id, remote_scan.worker_column_5
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=3.15..3.98 rows=33 width=48) -> WindowAgg
-> Sort (cost=3.15..3.23 rows=33 width=40) -> Sort
Sort Key: users_table.user_id, ((1 / (1 + sum(users_table.value_2)))) Sort Key: users_table.user_id, ((1 / (1 + sum(users_table.value_2))))
-> HashAggregate (cost=1.83..2.32 rows=33 width=40) -> HashAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(16 rows) (16 rows)
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -895,21 +895,21 @@ ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.00 rows=0 width=0) Limit
-> Sort (cost=0.00..0.00 rows=0 width=0) -> Sort
Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC Sort Key: remote_scan.user_id, (pg_catalog.sum(((pg_catalog.sum(remote_scan.avg) / pg_catalog.sum(remote_scan.avg_1)))) / pg_catalog.sum(remote_scan.rank)) DESC
-> HashAggregate (cost=0.00..0.00 rows=0 width=0) -> HashAggregate
Group Key: remote_scan.user_id, remote_scan.worker_column_5 Group Key: remote_scan.user_id, remote_scan.worker_column_5
-> Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) -> Custom Scan (Citus Real-Time)
Task Count: 4 Task Count: 4
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57637 dbname=regression
-> WindowAgg (cost=2.90..3.56 rows=33 width=40) -> WindowAgg
-> Sort (cost=2.90..2.99 rows=33 width=32) -> Sort
Sort Key: users_table.user_id, (sum(users_table.value_2)) Sort Key: users_table.user_id, (sum(users_table.value_2))
-> HashAggregate (cost=1.74..2.07 rows=33 width=32) -> HashAggregate
Group Key: users_table.user_id, users_table.value_2 Group Key: users_table.user_id, users_table.value_2
-> Seq Scan on users_table_1400256 users_table (cost=0.00..1.33 rows=33 width=12) -> Seq Scan on users_table_1400256 users_table
(16 rows) (16 rows)

View File

@ -288,7 +288,7 @@ GROUP BY
ORDER BY ORDER BY
3 DESC, 2 DESC, 1 DESC; 3 DESC, 2 DESC, 1 DESC;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
AVG(avg(value_1)) OVER (PARTITION BY user_id, max(user_id), MIN(value_2)), AVG(avg(value_1)) OVER (PARTITION BY user_id, max(user_id), MIN(value_2)),
@ -311,7 +311,7 @@ GROUP BY
ORDER BY ORDER BY
user_id, value_2; user_id, value_2;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
1 + sum(value_1), 1 + sum(value_1),
@ -355,7 +355,7 @@ FROM
GROUP BY user_id, value_2 GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC; ORDER BY user_id, avg(value_1) DESC;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -376,7 +376,7 @@ GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC; ORDER BY user_id, avg(value_1) DESC;
-- limit is not pushed down to worker !! -- limit is not pushed down to worker !!
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -387,7 +387,7 @@ GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -398,7 +398,7 @@ GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),
@ -409,7 +409,7 @@ GROUP BY user_id, value_2
ORDER BY user_id, avg(value_1) DESC ORDER BY user_id, avg(value_1) DESC
LIMIT 5; LIMIT 5;
EXPLAIN EXPLAIN (COSTS FALSE)
SELECT SELECT
user_id, user_id,
avg(value_1), avg(value_1),