mirror of https://github.com/citusdata/citus.git
Differentiate 9.5 and 9.6 results
parent
7e476345d6
commit
fe781b38f8
|
@ -3,6 +3,14 @@
|
|||
--
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 570000;
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
major_version
|
||||
---------------
|
||||
9.6
|
||||
(1 row)
|
||||
|
||||
\a\t
|
||||
SET citus.task_executor_type TO 'real-time';
|
||||
SET citus.explain_distributed_queries TO on;
|
||||
|
@ -43,7 +51,7 @@ Distributed Query into pg_merge_job_570000
|
|||
-> Seq Scan on lineitem_290001 lineitem
|
||||
Master Query
|
||||
-> Sort
|
||||
Sort Key: COALESCE((sum((COALESCE((sum(intermediate_column_570000_1))::bigint, '0'::bigint))))::bigint, '0'::bigint), intermediate_column_570000_0
|
||||
Sort Key: COALESCE((pg_catalog.sum((COALESCE((pg_catalog.sum(intermediate_column_570000_1))::bigint, '0'::bigint))))::bigint, '0'::bigint), intermediate_column_570000_0
|
||||
-> HashAggregate
|
||||
Group Key: intermediate_column_570000_0
|
||||
-> Seq Scan on pg_merge_job_570000
|
||||
|
@ -66,11 +74,14 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
|
|||
"Plan": {
|
||||
"Node Type": "Aggregate",
|
||||
"Strategy": "Hashed",
|
||||
"Partial Mode": "Simple",
|
||||
"Parallel Aware": false,
|
||||
"Group Key": ["l_quantity"],
|
||||
"Plans": [
|
||||
{
|
||||
"Node Type": "Seq Scan",
|
||||
"Parent Relationship": "Outer",
|
||||
"Parallel Aware": false,
|
||||
"Relation Name": "lineitem_290001",
|
||||
"Alias": "lineitem"
|
||||
}
|
||||
|
@ -87,17 +98,21 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
|
|||
{
|
||||
"Plan": {
|
||||
"Node Type": "Sort",
|
||||
"Sort Key": ["COALESCE((sum((COALESCE((sum(intermediate_column_570001_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)", "intermediate_column_570001_0"],
|
||||
"Parallel Aware": false,
|
||||
"Sort Key": ["COALESCE((pg_catalog.sum((COALESCE((pg_catalog.sum(intermediate_column_570001_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)", "intermediate_column_570001_0"],
|
||||
"Plans": [
|
||||
{
|
||||
"Node Type": "Aggregate",
|
||||
"Strategy": "Hashed",
|
||||
"Partial Mode": "Simple",
|
||||
"Parent Relationship": "Outer",
|
||||
"Parallel Aware": false,
|
||||
"Group Key": ["intermediate_column_570001_0"],
|
||||
"Plans": [
|
||||
{
|
||||
"Node Type": "Seq Scan",
|
||||
"Parent Relationship": "Outer",
|
||||
"Parallel Aware": false,
|
||||
"Relation Name": "pg_merge_job_570001",
|
||||
"Alias": "pg_merge_job_570001"
|
||||
}
|
||||
|
@ -133,6 +148,8 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Plan>
|
||||
<Node-Type>Aggregate</Node-Type>
|
||||
<Strategy>Hashed</Strategy>
|
||||
<Partial-Mode>Simple</Partial-Mode>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Group-Key>
|
||||
<Item>l_quantity</Item>
|
||||
</Group-Key>
|
||||
|
@ -140,6 +157,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Plan>
|
||||
<Node-Type>Seq Scan</Node-Type>
|
||||
<Parent-Relationship>Outer</Parent-Relationship>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Relation-Name>lineitem_290001</Relation-Name>
|
||||
<Alias>lineitem</Alias>
|
||||
</Plan>
|
||||
|
@ -155,15 +173,18 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Query>
|
||||
<Plan>
|
||||
<Node-Type>Sort</Node-Type>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Sort-Key>
|
||||
<Item>COALESCE((sum((COALESCE((sum(intermediate_column_570003_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)</Item>
|
||||
<Item>COALESCE((pg_catalog.sum((COALESCE((pg_catalog.sum(intermediate_column_570003_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)</Item>
|
||||
<Item>intermediate_column_570003_0</Item>
|
||||
</Sort-Key>
|
||||
<Plans>
|
||||
<Plan>
|
||||
<Node-Type>Aggregate</Node-Type>
|
||||
<Strategy>Hashed</Strategy>
|
||||
<Partial-Mode>Simple</Partial-Mode>
|
||||
<Parent-Relationship>Outer</Parent-Relationship>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Group-Key>
|
||||
<Item>intermediate_column_570003_0</Item>
|
||||
</Group-Key>
|
||||
|
@ -171,6 +192,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Plan>
|
||||
<Node-Type>Seq Scan</Node-Type>
|
||||
<Parent-Relationship>Outer</Parent-Relationship>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Relation-Name>pg_merge_job_570003</Relation-Name>
|
||||
<Alias>pg_merge_job_570003</Alias>
|
||||
</Plan>
|
||||
|
@ -201,29 +223,36 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
|
|||
- Plan:
|
||||
Node Type: "Aggregate"
|
||||
Strategy: "Hashed"
|
||||
Partial Mode: "Simple"
|
||||
Parallel Aware: false
|
||||
Group Key:
|
||||
- "l_quantity"
|
||||
Plans:
|
||||
- Node Type: "Seq Scan"
|
||||
Parent Relationship: "Outer"
|
||||
Parallel Aware: false
|
||||
Relation Name: "lineitem_290001"
|
||||
Alias: "lineitem"
|
||||
|
||||
Master Query:
|
||||
- Plan:
|
||||
Node Type: "Sort"
|
||||
Parallel Aware: false
|
||||
Sort Key:
|
||||
- "COALESCE((sum((COALESCE((sum(intermediate_column_570005_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)"
|
||||
- "COALESCE((pg_catalog.sum((COALESCE((pg_catalog.sum(intermediate_column_570005_1))::bigint, '0'::bigint))))::bigint, '0'::bigint)"
|
||||
- "intermediate_column_570005_0"
|
||||
Plans:
|
||||
- Node Type: "Aggregate"
|
||||
Strategy: "Hashed"
|
||||
Partial Mode: "Simple"
|
||||
Parent Relationship: "Outer"
|
||||
Parallel Aware: false
|
||||
Group Key:
|
||||
- "intermediate_column_570005_0"
|
||||
Plans:
|
||||
- Node Type: "Seq Scan"
|
||||
Parent Relationship: "Outer"
|
||||
Parallel Aware: false
|
||||
Relation Name: "pg_merge_job_570005"
|
||||
Alias: "pg_merge_job_570005"
|
||||
-- Test Text format
|
||||
|
@ -241,7 +270,7 @@ Distributed Query into pg_merge_job_570006
|
|||
-> Seq Scan on lineitem_290001 lineitem
|
||||
Master Query
|
||||
-> Sort
|
||||
Sort Key: COALESCE((sum((COALESCE((sum(intermediate_column_570006_1))::bigint, '0'::bigint))))::bigint, '0'::bigint), intermediate_column_570006_0
|
||||
Sort Key: COALESCE((pg_catalog.sum((COALESCE((pg_catalog.sum(intermediate_column_570006_1))::bigint, '0'::bigint))))::bigint, '0'::bigint), intermediate_column_570006_0
|
||||
-> HashAggregate
|
||||
Group Key: intermediate_column_570006_0
|
||||
-> Seq Scan on pg_merge_job_570006
|
||||
|
@ -260,7 +289,7 @@ Distributed Query into pg_merge_job_570007
|
|||
Output: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment
|
||||
Master Query
|
||||
-> Aggregate
|
||||
Output: (sum(intermediate_column_570007_0) / (sum(intermediate_column_570007_1) / sum(intermediate_column_570007_2)))
|
||||
Output: (sum(intermediate_column_570007_0) / (sum(intermediate_column_570007_1) / pg_catalog.sum(intermediate_column_570007_2)))
|
||||
-> Seq Scan on pg_temp_2.pg_merge_job_570007
|
||||
Output: intermediate_column_570007_0, intermediate_column_570007_1, intermediate_column_570007_2
|
||||
-- Test join
|
||||
|
@ -380,7 +409,7 @@ Distributed Query into pg_merge_job_570013
|
|||
Output: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment
|
||||
Master Query
|
||||
-> Aggregate
|
||||
Output: (sum(intermediate_column_570013_0) / (sum(intermediate_column_570013_1) / sum(intermediate_column_570013_2)))
|
||||
Output: (sum(intermediate_column_570013_0) / (sum(intermediate_column_570013_1) / pg_catalog.sum(intermediate_column_570013_2)))
|
||||
Filter: (sum(pg_merge_job_570013.intermediate_column_570013_3) > '100'::numeric)
|
||||
-> Seq Scan on pg_temp_2.pg_merge_job_570013
|
||||
Output: intermediate_column_570013_0, intermediate_column_570013_1, intermediate_column_570013_2, intermediate_column_570013_3
|
||||
|
@ -512,10 +541,13 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
|
|||
"Plan": {
|
||||
"Node Type": "Aggregate",
|
||||
"Strategy": "Plain",
|
||||
"Partial Mode": "Simple",
|
||||
"Parallel Aware": false,
|
||||
"Plans": [
|
||||
{
|
||||
"Node Type": "Seq Scan",
|
||||
"Parent Relationship": "Outer",
|
||||
"Parallel Aware": false,
|
||||
"Relation Name": "pg_merge_job_570024",
|
||||
"Alias": "pg_merge_job_570024"
|
||||
}
|
||||
|
@ -562,10 +594,13 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Plan>
|
||||
<Node-Type>Aggregate</Node-Type>
|
||||
<Strategy>Plain</Strategy>
|
||||
<Partial-Mode>Simple</Partial-Mode>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Plans>
|
||||
<Plan>
|
||||
<Node-Type>Seq Scan</Node-Type>
|
||||
<Parent-Relationship>Outer</Parent-Relationship>
|
||||
<Parallel-Aware>false</Parallel-Aware>
|
||||
<Relation-Name>pg_merge_job_570030</Relation-Name>
|
||||
<Alias>pg_merge_job_570030</Alias>
|
||||
</Plan>
|
||||
|
@ -602,8 +637,11 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
|
|||
- Plan:
|
||||
Node Type: "Aggregate"
|
||||
Strategy: "Plain"
|
||||
Partial Mode: "Simple"
|
||||
Parallel Aware: false
|
||||
Plans:
|
||||
- Node Type: "Seq Scan"
|
||||
Parent Relationship: "Outer"
|
||||
Parallel Aware: false
|
||||
Relation Name: "pg_merge_job_570036"
|
||||
Alias: "pg_merge_job_570036"
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
--
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 570000;
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
major_version
|
||||
---------------
|
||||
9.5
|
||||
(1 row)
|
||||
|
||||
\a\t
|
||||
SET citus.task_executor_type TO 'real-time';
|
||||
SET citus.explain_distributed_queries TO on;
|
||||
|
@ -364,11 +372,54 @@ Distributed Query into pg_merge_job_570012
|
|||
-> Seq Scan on lineitem_290001 lineitem
|
||||
Master Query
|
||||
-> Seq Scan on pg_merge_job_570012
|
||||
-- Test having
|
||||
EXPLAIN (COSTS FALSE, VERBOSE TRUE)
|
||||
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem
|
||||
HAVING sum(l_quantity) > 100;
|
||||
Distributed Query into pg_merge_job_570013
|
||||
Executor: Real-Time
|
||||
Task Count: 8
|
||||
Tasks Shown: One of 8
|
||||
-> Task
|
||||
Node: host=localhost port=57637 dbname=regression
|
||||
-> Aggregate
|
||||
Output: sum(l_quantity), sum(l_quantity), count(l_quantity), sum(l_quantity)
|
||||
-> Seq Scan on public.lineitem_290001 lineitem
|
||||
Output: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment
|
||||
Master Query
|
||||
-> Aggregate
|
||||
Output: (sum(intermediate_column_570013_0) / (sum(intermediate_column_570013_1) / sum(intermediate_column_570013_2)))
|
||||
Filter: (sum(pg_merge_job_570013.intermediate_column_570013_3) > '100'::numeric)
|
||||
-> Seq Scan on pg_temp_2.pg_merge_job_570013
|
||||
Output: intermediate_column_570013_0, intermediate_column_570013_1, intermediate_column_570013_2, intermediate_column_570013_3
|
||||
-- Test having without aggregate
|
||||
EXPLAIN (COSTS FALSE, VERBOSE TRUE)
|
||||
SELECT l_quantity FROM lineitem
|
||||
GROUP BY l_quantity
|
||||
HAVING l_quantity > (100 * random());
|
||||
Distributed Query into pg_merge_job_570014
|
||||
Executor: Real-Time
|
||||
Task Count: 8
|
||||
Tasks Shown: One of 8
|
||||
-> Task
|
||||
Node: host=localhost port=57637 dbname=regression
|
||||
-> HashAggregate
|
||||
Output: l_quantity, l_quantity
|
||||
Group Key: lineitem.l_quantity
|
||||
-> Seq Scan on public.lineitem_290001 lineitem
|
||||
Output: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment
|
||||
Master Query
|
||||
-> HashAggregate
|
||||
Output: intermediate_column_570014_0
|
||||
Group Key: pg_merge_job_570014.intermediate_column_570014_0
|
||||
Filter: ((pg_merge_job_570014.intermediate_column_570014_1)::double precision > ('100'::double precision * random()))
|
||||
-> Seq Scan on pg_temp_2.pg_merge_job_570014
|
||||
Output: intermediate_column_570014_0, intermediate_column_570014_1
|
||||
-- Test all tasks output
|
||||
SET citus.explain_all_tasks TO on;
|
||||
EXPLAIN (COSTS FALSE)
|
||||
SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030;
|
||||
Distributed Query into pg_merge_job_570013
|
||||
Distributed Query into pg_merge_job_570015
|
||||
Executor: Real-Time
|
||||
Task Count: 4
|
||||
Tasks Shown: All
|
||||
|
@ -394,7 +445,7 @@ Distributed Query into pg_merge_job_570013
|
|||
Filter: (l_orderkey > 9030)
|
||||
Master Query
|
||||
-> Aggregate
|
||||
-> Seq Scan on pg_merge_job_570013
|
||||
-> Seq Scan on pg_merge_job_570015
|
||||
SELECT true AS valid FROM explain_xml($$
|
||||
SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030$$);
|
||||
t
|
||||
|
@ -406,7 +457,7 @@ SET citus.task_executor_type TO 'task-tracker';
|
|||
SET citus.explain_all_tasks TO off;
|
||||
EXPLAIN (COSTS FALSE)
|
||||
SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030;
|
||||
Distributed Query into pg_merge_job_570016
|
||||
Distributed Query into pg_merge_job_570018
|
||||
Executor: Task-Tracker
|
||||
Task Count: 4
|
||||
Tasks Shown: One of 4
|
||||
|
@ -417,7 +468,7 @@ Distributed Query into pg_merge_job_570016
|
|||
Filter: (l_orderkey > 9030)
|
||||
Master Query
|
||||
-> Aggregate
|
||||
-> Seq Scan on pg_merge_job_570016
|
||||
-> Seq Scan on pg_merge_job_570018
|
||||
-- Test re-partition join
|
||||
SET citus.large_table_shard_count TO 1;
|
||||
EXPLAIN (COSTS FALSE)
|
||||
|
@ -426,7 +477,7 @@ EXPLAIN (COSTS FALSE)
|
|||
WHERE l_orderkey = o_orderkey
|
||||
AND o_custkey = c_custkey
|
||||
AND l_suppkey = s_suppkey;
|
||||
Distributed Query into pg_merge_job_570019
|
||||
Distributed Query into pg_merge_job_570021
|
||||
Executor: Task-Tracker
|
||||
Task Count: 1
|
||||
Tasks Shown: None, not supported for re-partition queries
|
||||
|
@ -438,7 +489,7 @@ Distributed Query into pg_merge_job_570019
|
|||
Merge Task Count: 1
|
||||
Master Query
|
||||
-> Aggregate
|
||||
-> Seq Scan on pg_merge_job_570019
|
||||
-> Seq Scan on pg_merge_job_570021
|
||||
EXPLAIN (COSTS FALSE, FORMAT JSON)
|
||||
SELECT count(*)
|
||||
FROM lineitem, orders, customer, supplier
|
||||
|
@ -473,8 +524,8 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
|
|||
{
|
||||
"Node Type": "Seq Scan",
|
||||
"Parent Relationship": "Outer",
|
||||
"Relation Name": "pg_merge_job_570022",
|
||||
"Alias": "pg_merge_job_570022"
|
||||
"Relation Name": "pg_merge_job_570024",
|
||||
"Alias": "pg_merge_job_570024"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -523,8 +574,8 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
|
|||
<Plan>
|
||||
<Node-Type>Seq Scan</Node-Type>
|
||||
<Parent-Relationship>Outer</Parent-Relationship>
|
||||
<Relation-Name>pg_merge_job_570028</Relation-Name>
|
||||
<Alias>pg_merge_job_570028</Alias>
|
||||
<Relation-Name>pg_merge_job_570030</Relation-Name>
|
||||
<Alias>pg_merge_job_570030</Alias>
|
||||
</Plan>
|
||||
</Plans>
|
||||
</Plan>
|
||||
|
@ -562,5 +613,5 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
|
|||
Plans:
|
||||
- Node Type: "Seq Scan"
|
||||
Parent Relationship: "Outer"
|
||||
Relation Name: "pg_merge_job_570034"
|
||||
Alias: "pg_merge_job_570034"
|
||||
Relation Name: "pg_merge_job_570036"
|
||||
Alias: "pg_merge_job_570036"
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 270000;
|
||||
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
|
||||
|
||||
-- Create tables for subquery tests
|
||||
CREATE TABLE lineitem_subquery (
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
--
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 270000;
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
major_version
|
||||
---------------
|
||||
9.6
|
||||
(1 row)
|
||||
|
||||
-- Create tables for subquery tests
|
||||
CREATE TABLE lineitem_subquery (
|
||||
l_orderkey bigint not null,
|
||||
|
@ -765,10 +773,10 @@ FROM
|
|||
Tasks Shown: One of 2
|
||||
-> Task
|
||||
Node: host=localhost port=57637 dbname=regression
|
||||
-> Aggregate (cost=40.01..40.02 rows=1 width=32)
|
||||
-> GroupAggregate (cost=39.89..39.99 rows=1 width=556)
|
||||
-> Aggregate (cost=40.01..40.02 rows=1 width=16)
|
||||
-> GroupAggregate (cost=39.89..39.99 rows=1 width=48)
|
||||
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
|
||||
-> Merge Join (cost=39.89..39.97 rows=1 width=556)
|
||||
-> Merge Join (cost=39.89..39.97 rows=1 width=540)
|
||||
Merge Cond: ((((users.composite_id).tenant_id) = ((events.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events.composite_id).user_id)))
|
||||
-> Sort (cost=28.08..28.09 rows=6 width=32)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
|
||||
|
@ -779,7 +787,7 @@ FROM
|
|||
-> Seq Scan on events_270009 events (cost=0.00..11.79 rows=3 width=556)
|
||||
Filter: ((event_type)::text = ANY ('{click,submit,pay}'::text[]))
|
||||
Master Query
|
||||
-> Aggregate (cost=0.01..0.02 rows=1 width=0)
|
||||
-> Aggregate (cost=0.00..0.00 rows=0 width=0)
|
||||
-> Seq Scan on pg_merge_job_270014 (cost=0.00..0.00 rows=0 width=0)
|
||||
(22 rows)
|
||||
|
||||
|
@ -846,49 +854,52 @@ FROM
|
|||
hasdone) AS subquery_top
|
||||
GROUP BY
|
||||
hasdone;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Distributed Query into pg_merge_job_270015
|
||||
Executor: Real-Time
|
||||
Task Count: 2
|
||||
Tasks Shown: One of 2
|
||||
-> Task
|
||||
Node: host=localhost port=57637 dbname=regression
|
||||
-> HashAggregate (cost=91.94..91.96 rows=2 width=64)
|
||||
Group Key: COALESCE(('Has done paying'::text), 'Has not done paying'::text)
|
||||
-> GroupAggregate (cost=91.85..91.90 rows=2 width=88)
|
||||
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
|
||||
-> Sort (cost=91.85..91.85 rows=2 width=88)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
|
||||
-> Merge Left Join (cost=91.75..91.84 rows=2 width=88)
|
||||
Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id)))
|
||||
-> Unique (cost=79.46..79.48 rows=2 width=40)
|
||||
-> Sort (cost=79.46..79.47 rows=2 width=40)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time
|
||||
-> Append (cost=0.00..79.45 rows=2 width=40)
|
||||
-> Nested Loop (cost=0.00..39.72 rows=1 width=40)
|
||||
Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id))
|
||||
-> Seq Scan on events_270009 events (cost=0.00..11.62 rows=1 width=40)
|
||||
Filter: ((event_type)::text = 'click'::text)
|
||||
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
|
||||
-> Nested Loop (cost=0.00..39.72 rows=1 width=40)
|
||||
Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id))
|
||||
-> Seq Scan on events_270009 events_1 (cost=0.00..11.62 rows=1 width=40)
|
||||
Filter: ((event_type)::text = 'submit'::text)
|
||||
-> Seq Scan on users_270013 users_1 (cost=0.00..28.00 rows=6 width=32)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
|
||||
-> Materialize (cost=12.29..12.31 rows=1 width=48)
|
||||
-> Unique (cost=12.29..12.30 rows=1 width=32)
|
||||
-> Sort (cost=12.29..12.29 rows=1 width=32)
|
||||
Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id)
|
||||
-> Seq Scan on events_270009 events_2 (cost=0.00..12.28 rows=1 width=32)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text))
|
||||
-> GroupAggregate (cost=91.93..91.98 rows=2 width=48)
|
||||
Group Key: subquery_top.hasdone
|
||||
-> Sort (cost=91.93..91.93 rows=2 width=64)
|
||||
Sort Key: subquery_top.hasdone
|
||||
-> Subquery Scan on subquery_top (cost=91.85..91.92 rows=2 width=64)
|
||||
-> GroupAggregate (cost=91.85..91.90 rows=2 width=112)
|
||||
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
|
||||
-> Sort (cost=91.85..91.85 rows=2 width=88)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('Has done paying'::text)
|
||||
-> Merge Left Join (cost=91.75..91.84 rows=2 width=88)
|
||||
Merge Cond: ((((users.composite_id).tenant_id) = ((events_2.composite_id).tenant_id)) AND (((users.composite_id).user_id) = ((events_2.composite_id).user_id)))
|
||||
-> Unique (cost=79.46..79.48 rows=2 width=56)
|
||||
-> Sort (cost=79.46..79.47 rows=2 width=56)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id), ('action=>1'::text), events.event_time
|
||||
-> Append (cost=0.00..79.45 rows=2 width=56)
|
||||
-> Nested Loop (cost=0.00..39.72 rows=1 width=56)
|
||||
Join Filter: (((users.composite_id).tenant_id = (events.composite_id).tenant_id) AND ((users.composite_id).user_id = (events.composite_id).user_id))
|
||||
-> Seq Scan on events_270009 events (cost=0.00..11.62 rows=1 width=40)
|
||||
Filter: ((event_type)::text = 'click'::text)
|
||||
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=32)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
|
||||
-> Nested Loop (cost=0.00..39.72 rows=1 width=56)
|
||||
Join Filter: (((users_1.composite_id).tenant_id = (events_1.composite_id).tenant_id) AND ((users_1.composite_id).user_id = (events_1.composite_id).user_id))
|
||||
-> Seq Scan on events_270009 events_1 (cost=0.00..11.62 rows=1 width=40)
|
||||
Filter: ((event_type)::text = 'submit'::text)
|
||||
-> Seq Scan on users_270013 users_1 (cost=0.00..28.00 rows=6 width=32)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
|
||||
-> Materialize (cost=12.29..12.31 rows=1 width=48)
|
||||
-> Unique (cost=12.29..12.30 rows=1 width=80)
|
||||
-> Sort (cost=12.29..12.29 rows=1 width=80)
|
||||
Sort Key: ((events_2.composite_id).tenant_id), ((events_2.composite_id).user_id)
|
||||
-> Seq Scan on events_270009 events_2 (cost=0.00..12.28 rows=1 width=80)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type) AND ((event_type)::text = 'pay'::text))
|
||||
Master Query
|
||||
-> HashAggregate (cost=0.00..0.18 rows=10 width=0)
|
||||
-> HashAggregate (cost=0.00..0.00 rows=0 width=0)
|
||||
Group Key: intermediate_column_270015_2
|
||||
-> Seq Scan on pg_merge_job_270015 (cost=0.00..0.00 rows=0 width=0)
|
||||
(40 rows)
|
||||
(43 rows)
|
||||
|
||||
-- Union, left join and having subquery pushdown
|
||||
EXPLAIN SELECT
|
||||
|
@ -1023,15 +1034,15 @@ LIMIT
|
|||
-> Limit (cost=100.43..100.44 rows=6 width=56)
|
||||
-> Sort (cost=100.43..100.44 rows=6 width=56)
|
||||
Sort Key: (max(users.lastseen)) DESC
|
||||
-> GroupAggregate (cost=100.14..100.29 rows=6 width=548)
|
||||
-> GroupAggregate (cost=100.14..100.29 rows=6 width=56)
|
||||
Group Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
|
||||
-> Sort (cost=100.14..100.16 rows=6 width=548)
|
||||
Sort Key: ((users.composite_id).tenant_id), ((users.composite_id).user_id)
|
||||
-> Nested Loop Left Join (cost=40.04..100.06 rows=6 width=548)
|
||||
-> Limit (cost=28.08..28.09 rows=6 width=40)
|
||||
-> Sort (cost=28.08..28.09 rows=6 width=40)
|
||||
-> Limit (cost=28.08..28.09 rows=6 width=24)
|
||||
-> Sort (cost=28.08..28.09 rows=6 width=24)
|
||||
Sort Key: users.lastseen DESC
|
||||
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=40)
|
||||
-> Seq Scan on users_270013 users (cost=0.00..28.00 rows=6 width=24)
|
||||
Filter: ((composite_id >= '(1,-9223372036854775808)'::user_composite_type) AND (composite_id <= '(1,9223372036854775807)'::user_composite_type))
|
||||
-> Limit (cost=11.96..11.96 rows=1 width=524)
|
||||
-> Sort (cost=11.96..11.96 rows=1 width=524)
|
||||
|
@ -1039,8 +1050,8 @@ LIMIT
|
|||
-> Seq Scan on events_270009 events (cost=0.00..11.95 rows=1 width=524)
|
||||
Filter: (((composite_id).tenant_id = ((users.composite_id).tenant_id)) AND ((composite_id).user_id = ((users.composite_id).user_id)))
|
||||
Master Query
|
||||
-> Limit (cost=0.01..0.02 rows=0 width=0)
|
||||
-> Sort (cost=0.01..0.02 rows=0 width=0)
|
||||
-> Limit (cost=0.00..0.00 rows=0 width=0)
|
||||
-> Sort (cost=0.00..0.00 rows=0 width=0)
|
||||
Sort Key: intermediate_column_270017_2 DESC
|
||||
-> Seq Scan on pg_merge_job_270017 (cost=0.00..0.00 rows=0 width=0)
|
||||
(29 rows)
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
--
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 270000;
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
major_version
|
||||
---------------
|
||||
9.5
|
||||
(1 row)
|
||||
|
||||
-- Create tables for subquery tests
|
||||
CREATE TABLE lineitem_subquery (
|
||||
l_orderkey bigint not null,
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 570000;
|
||||
|
||||
-- print major version to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
||||
|
||||
\a\t
|
||||
|
||||
|
|
Loading…
Reference in New Issue