Sort task list for multi-task explain outputs

This is purely for ensuring that regression tests do not randomly fail.
pull/2514/head
Onder Kalaci 2018-11-30 16:31:38 +03:00 committed by Jason Petersen
parent 89d32af3ad
commit b6ebd791a6
9 changed files with 101 additions and 97 deletions

View File

@ -23,6 +23,7 @@
#include "distributed/citus_nodefuncs.h" #include "distributed/citus_nodefuncs.h"
#include "distributed/connection_management.h" #include "distributed/connection_management.h"
#include "distributed/insert_select_planner.h" #include "distributed/insert_select_planner.h"
#include "distributed/listutils.h"
#include "distributed/multi_client_executor.h" #include "distributed/multi_client_executor.h"
#include "distributed/multi_executor.h" #include "distributed/multi_executor.h"
#include "distributed/multi_explain.h" #include "distributed/multi_explain.h"
@ -358,6 +359,9 @@ ExplainTaskList(List *taskList, ExplainState *es)
ListCell *remoteExplainCell = NULL; ListCell *remoteExplainCell = NULL;
List *remoteExplainList = NIL; List *remoteExplainList = NIL;
/* make sure that the output is consistent */
taskList = SortList(taskList, CompareTasksByTaskId);
foreach(taskCell, taskList) foreach(taskCell, taskList)
{ {
Task *task = (Task *) lfirst(taskCell); Task *task = (Task *) lfirst(taskCell);

View File

@ -180,7 +180,6 @@ static List * ActivePlacementList(List *placementList);
static List * LeftRotateList(List *list, uint32 rotateCount); static List * LeftRotateList(List *list, uint32 rotateCount);
static List * FindDependedMergeTaskList(Task *sqlTask); static List * FindDependedMergeTaskList(Task *sqlTask);
static List * AssignDualHashTaskList(List *taskList); static List * AssignDualHashTaskList(List *taskList);
static int CompareTasksByTaskId(const void *leftElement, const void *rightElement);
static void AssignDataFetchDependencies(List *taskList); static void AssignDataFetchDependencies(List *taskList);
static uint32 TaskListHighestTaskId(List *taskList); static uint32 TaskListHighestTaskId(List *taskList);
static List * MapTaskList(MapMergeJob *mapMergeJob, List *filterTaskList); static List * MapTaskList(MapMergeJob *mapMergeJob, List *filterTaskList);
@ -5417,7 +5416,7 @@ AssignDualHashTaskList(List *taskList)
/* Helper function to compare two tasks by their taskId. */ /* Helper function to compare two tasks by their taskId. */
static int int
CompareTasksByTaskId(const void *leftElement, const void *rightElement) CompareTasksByTaskId(const void *leftElement, const void *rightElement)
{ {
const Task *leftTask = *((const Task **) leftElement); const Task *leftTask = *((const Task **) leftElement);

View File

@ -351,6 +351,7 @@ extern List * TaskListDifference(const List *list1, const List *list2);
extern List * AssignAnchorShardTaskList(List *taskList); extern List * AssignAnchorShardTaskList(List *taskList);
extern List * FirstReplicaAssignTaskList(List *taskList); extern List * FirstReplicaAssignTaskList(List *taskList);
extern List * RoundRobinAssignTaskList(List *taskList); extern List * RoundRobinAssignTaskList(List *taskList);
extern int CompareTasksByTaskId(const void *leftElement, const void *rightElement);
/* function declaration for creating Task */ /* function declaration for creating Task */
extern List * QueryPushdownSqlTaskList(Query *query, uint64 jobId, extern List * QueryPushdownSqlTaskList(Query *query, uint64 jobId,

View File

@ -50,10 +50,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test disable hash aggregate -- Test disable hash aggregate
SET enable_hashagg TO off; SET enable_hashagg TO off;
EXPLAIN (COSTS FALSE, FORMAT TEXT) EXPLAIN (COSTS FALSE, FORMAT TEXT)
@ -69,10 +69,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
SET enable_hashagg TO on; SET enable_hashagg TO on;
-- Test JSON format -- Test JSON format
EXPLAIN (COSTS FALSE, FORMAT JSON) EXPLAIN (COSTS FALSE, FORMAT JSON)
@ -104,7 +104,7 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
"Tasks Shown": "One of 2", "Tasks Shown": "One of 2",
"Tasks": [ "Tasks": [
{ {
"Node": "host=localhost port=57637 dbname=regression", "Node": "host=localhost port=57638 dbname=regression",
"Remote Plan": [ "Remote Plan": [
[ [
{ {
@ -119,7 +119,7 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
"Node Type": "Seq Scan", "Node Type": "Seq Scan",
"Parent Relationship": "Outer", "Parent Relationship": "Outer",
"Parallel Aware": false, "Parallel Aware": false,
"Relation Name": "lineitem_290001", "Relation Name": "lineitem_290000",
"Alias": "lineitem" "Alias": "lineitem"
} }
] ]
@ -179,7 +179,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
<Tasks-Shown>One of 2</Tasks-Shown> <Tasks-Shown>One of 2</Tasks-Shown>
<Tasks> <Tasks>
<Task> <Task>
<Node>host=localhost port=57637 dbname=regression</Node> <Node>host=localhost port=57638 dbname=regression</Node>
<Remote-Plan> <Remote-Plan>
<explain xmlns="http://www.postgresql.org/2009/explain"> <explain xmlns="http://www.postgresql.org/2009/explain">
<Query> <Query>
@ -196,7 +196,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
<Node-Type>Seq Scan</Node-Type> <Node-Type>Seq Scan</Node-Type>
<Parent-Relationship>Outer</Parent-Relationship> <Parent-Relationship>Outer</Parent-Relationship>
<Parallel-Aware>false</Parallel-Aware> <Parallel-Aware>false</Parallel-Aware>
<Relation-Name>lineitem_290001</Relation-Name> <Relation-Name>lineitem_290000</Relation-Name>
<Alias>lineitem</Alias> <Alias>lineitem</Alias>
</Plan> </Plan>
</Plans> </Plans>
@ -248,7 +248,7 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
Task Count: 2 Task Count: 2
Tasks Shown: "One of 2" Tasks Shown: "One of 2"
Tasks: Tasks:
- Node: "host=localhost port=57637 dbname=regression" - Node: "host=localhost port=57638 dbname=regression"
Remote Plan: Remote Plan:
- Plan: - Plan:
Node Type: "Aggregate" Node Type: "Aggregate"
@ -261,7 +261,7 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
- Node Type: "Seq Scan" - Node Type: "Seq Scan"
Parent Relationship: "Outer" Parent Relationship: "Outer"
Parallel Aware: false Parallel Aware: false
Relation Name: "lineitem_290001" Relation Name: "lineitem_290000"
Alias: "lineitem" Alias: "lineitem"
-- Test Text format -- Test Text format
@ -276,10 +276,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test verbose -- Test verbose
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem; SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
@ -290,10 +290,10 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
Output: sum(l_quantity), sum(l_quantity), count(l_quantity) Output: sum(l_quantity), sum(l_quantity), count(l_quantity)
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Test join -- Test join
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
@ -307,16 +307,16 @@ Limit
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Limit -> Limit
-> Sort -> Sort
Sort Key: lineitem.l_quantity Sort Key: lineitem.l_quantity
-> Hash Join -> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey) Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
Filter: (l_quantity < 5.0) Filter: (l_quantity < 5.0)
-> Hash -> Hash
-> Seq Scan on orders_290003 orders -> Seq Scan on orders_290002 orders
-- Test insert -- Test insert
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
INSERT INTO lineitem VALUES (1,0), (2, 0), (3, 0), (4, 0); INSERT INTO lineitem VALUES (1,0), (2, 0), (3, 0), (4, 0);
@ -393,8 +393,8 @@ Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test having -- Test having
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem
@ -407,10 +407,10 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
Output: sum(l_quantity), sum(l_quantity), count(l_quantity), sum(l_quantity) Output: sum(l_quantity), sum(l_quantity), count(l_quantity), sum(l_quantity)
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Test having without aggregate -- Test having without aggregate
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
@ -426,11 +426,11 @@ HashAggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Output: l_quantity, l_quantity Output: l_quantity, l_quantity
Group Key: lineitem.l_quantity Group Key: lineitem.l_quantity
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Subquery pushdown tests with explain -- Subquery pushdown tests with explain
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
@ -1036,9 +1036,9 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- ensure EXPLAIN EXECUTE doesn't crash -- ensure EXPLAIN EXECUTE doesn't crash
PREPARE task_tracker_query AS PREPARE task_tracker_query AS
SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030; SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030;
@ -1102,9 +1102,9 @@ Custom Scan (Citus INSERT ... SELECT via coordinator)
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=57638 dbname=regression
-> Limit -> Limit
-> Seq Scan on orders_hash_part_360046 orders_hash_part -> Seq Scan on orders_hash_part_360045 orders_hash_part
SELECT true AS valid FROM explain_json($$ SELECT true AS valid FROM explain_json($$
INSERT INTO lineitem_hash_part (l_orderkey) INSERT INTO lineitem_hash_part (l_orderkey)
SELECT o_orderkey FROM orders_hash_part LIMIT 3; SELECT o_orderkey FROM orders_hash_part LIMIT 3;
@ -1119,9 +1119,9 @@ Custom Scan (Citus INSERT ... SELECT via coordinator)
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=57638 dbname=regression
-> Limit -> Limit
-> Seq Scan on orders_hash_part_360046 orders_hash_part -> Seq Scan on orders_hash_part_360045 orders_hash_part
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
INSERT INTO lineitem_hash_part (l_orderkey) INSERT INTO lineitem_hash_part (l_orderkey)
SELECT s FROM generate_series(1,5) s; SELECT s FROM generate_series(1,5) s;

View File

@ -50,10 +50,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test disable hash aggregate -- Test disable hash aggregate
SET enable_hashagg TO off; SET enable_hashagg TO off;
EXPLAIN (COSTS FALSE, FORMAT TEXT) EXPLAIN (COSTS FALSE, FORMAT TEXT)
@ -69,10 +69,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
SET enable_hashagg TO on; SET enable_hashagg TO on;
-- Test JSON format -- Test JSON format
EXPLAIN (COSTS FALSE, FORMAT JSON) EXPLAIN (COSTS FALSE, FORMAT JSON)
@ -104,7 +104,7 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
"Tasks Shown": "One of 2", "Tasks Shown": "One of 2",
"Tasks": [ "Tasks": [
{ {
"Node": "host=localhost port=57637 dbname=regression", "Node": "host=localhost port=57638 dbname=regression",
"Remote Plan": [ "Remote Plan": [
[ [
{ {
@ -119,7 +119,7 @@ EXPLAIN (COSTS FALSE, FORMAT JSON)
"Node Type": "Seq Scan", "Node Type": "Seq Scan",
"Parent Relationship": "Outer", "Parent Relationship": "Outer",
"Parallel Aware": false, "Parallel Aware": false,
"Relation Name": "lineitem_290001", "Relation Name": "lineitem_290000",
"Alias": "lineitem" "Alias": "lineitem"
} }
] ]
@ -179,7 +179,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
<Tasks-Shown>One of 2</Tasks-Shown> <Tasks-Shown>One of 2</Tasks-Shown>
<Tasks> <Tasks>
<Task> <Task>
<Node>host=localhost port=57637 dbname=regression</Node> <Node>host=localhost port=57638 dbname=regression</Node>
<Remote-Plan> <Remote-Plan>
<explain xmlns="http://www.postgresql.org/2009/explain"> <explain xmlns="http://www.postgresql.org/2009/explain">
<Query> <Query>
@ -196,7 +196,7 @@ EXPLAIN (COSTS FALSE, FORMAT XML)
<Node-Type>Seq Scan</Node-Type> <Node-Type>Seq Scan</Node-Type>
<Parent-Relationship>Outer</Parent-Relationship> <Parent-Relationship>Outer</Parent-Relationship>
<Parallel-Aware>false</Parallel-Aware> <Parallel-Aware>false</Parallel-Aware>
<Relation-Name>lineitem_290001</Relation-Name> <Relation-Name>lineitem_290000</Relation-Name>
<Alias>lineitem</Alias> <Alias>lineitem</Alias>
</Plan> </Plan>
</Plans> </Plans>
@ -248,7 +248,7 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
Task Count: 2 Task Count: 2
Tasks Shown: "One of 2" Tasks Shown: "One of 2"
Tasks: Tasks:
- Node: "host=localhost port=57637 dbname=regression" - Node: "host=localhost port=57638 dbname=regression"
Remote Plan: Remote Plan:
- Plan: - Plan:
Node Type: "Aggregate" Node Type: "Aggregate"
@ -261,7 +261,7 @@ EXPLAIN (COSTS FALSE, FORMAT YAML)
- Node Type: "Seq Scan" - Node Type: "Seq Scan"
Parent Relationship: "Outer" Parent Relationship: "Outer"
Parallel Aware: false Parallel Aware: false
Relation Name: "lineitem_290001" Relation Name: "lineitem_290000"
Alias: "lineitem" Alias: "lineitem"
-- Test Text format -- Test Text format
@ -276,10 +276,10 @@ Sort
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_quantity Group Key: l_quantity
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test verbose -- Test verbose
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem; SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
@ -290,10 +290,10 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
Output: sum(l_quantity), sum(l_quantity), count(l_quantity) Output: sum(l_quantity), sum(l_quantity), count(l_quantity)
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Test join -- Test join
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
@ -307,16 +307,16 @@ Limit
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Limit -> Limit
-> Sort -> Sort
Sort Key: lineitem.l_quantity Sort Key: lineitem.l_quantity
-> Hash Join -> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey) Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
Filter: (l_quantity < 5.0) Filter: (l_quantity < 5.0)
-> Hash -> Hash
-> Seq Scan on orders_290003 orders -> Seq Scan on orders_290002 orders
-- Test insert -- Test insert
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
INSERT INTO lineitem VALUES (1,0), (2, 0), (3, 0), (4, 0); INSERT INTO lineitem VALUES (1,0), (2, 0), (3, 0), (4, 0);
@ -393,8 +393,8 @@ Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- Test having -- Test having
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem
@ -407,10 +407,10 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
Output: sum(l_quantity), sum(l_quantity), count(l_quantity), sum(l_quantity) Output: sum(l_quantity), sum(l_quantity), count(l_quantity), sum(l_quantity)
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Test having without aggregate -- Test having without aggregate
EXPLAIN (COSTS FALSE, VERBOSE TRUE) EXPLAIN (COSTS FALSE, VERBOSE TRUE)
@ -426,11 +426,11 @@ HashAggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Output: l_quantity, l_quantity Output: l_quantity, l_quantity
Group Key: lineitem.l_quantity Group Key: lineitem.l_quantity
-> Seq Scan on public.lineitem_290001 lineitem -> Seq Scan on public.lineitem_290000 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 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
-- Subquery pushdown tests with explain -- Subquery pushdown tests with explain
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
@ -1036,9 +1036,9 @@ Aggregate
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
-- ensure EXPLAIN EXECUTE doesn't crash -- ensure EXPLAIN EXECUTE doesn't crash
PREPARE task_tracker_query AS PREPARE task_tracker_query AS
SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030; SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030;
@ -1102,9 +1102,9 @@ Custom Scan (Citus INSERT ... SELECT via coordinator)
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=57638 dbname=regression
-> Limit -> Limit
-> Seq Scan on orders_hash_part_360046 orders_hash_part -> Seq Scan on orders_hash_part_360045 orders_hash_part
SELECT true AS valid FROM explain_json($$ SELECT true AS valid FROM explain_json($$
INSERT INTO lineitem_hash_part (l_orderkey) INSERT INTO lineitem_hash_part (l_orderkey)
SELECT o_orderkey FROM orders_hash_part LIMIT 3; SELECT o_orderkey FROM orders_hash_part LIMIT 3;
@ -1119,9 +1119,9 @@ Custom Scan (Citus INSERT ... SELECT via coordinator)
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=57638 dbname=regression
-> Limit -> Limit
-> Seq Scan on orders_hash_part_360046 orders_hash_part -> Seq Scan on orders_hash_part_360045 orders_hash_part
EXPLAIN (COSTS OFF) EXPLAIN (COSTS OFF)
INSERT INTO lineitem_hash_part (l_orderkey) INSERT INTO lineitem_hash_part (l_orderkey)
SELECT s FROM generate_series(1,5) s; SELECT s FROM generate_series(1,5) s;

View File

@ -62,10 +62,10 @@ EXPLAIN (COSTS FALSE)
Task Count: 2 Task Count: 2
Tasks Shown: One of 2 Tasks Shown: One of 2
-> Task -> Task
Node: host=localhost port=57637 dbname=regression Node: host=localhost port=57638 dbname=regression
-> HashAggregate -> HashAggregate
Group Key: l_orderkey Group Key: l_orderkey
-> Seq Scan on lineitem_290001 lineitem -> Seq Scan on lineitem_290000 lineitem
(14 rows) (14 rows)
-- and don't push down when not grouped by partition column -- and don't push down when not grouped by partition column

View File

@ -74,14 +74,6 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
-> Custom Scan (Citus Real-Time) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem
-> Hash
-> Seq Scan on orders_290003 orders
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
@ -90,6 +82,14 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
-> Seq Scan on lineitem_290000 lineitem -> Seq Scan on lineitem_290000 lineitem
-> Hash -> Hash
-> Seq Scan on orders_290002 orders -> Seq Scan on orders_290002 orders
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem
-> Hash
-> Seq Scan on orders_290003 orders
(20 rows) (20 rows)
-- Now set the minimum value for a shard to null. Then check that we don't apply -- Now set the minimum value for a shard to null. Then check that we don't apply
@ -174,14 +174,14 @@ LOG: join order: [ "lineitem" ]
Custom Scan (Citus Real-Time) Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem -> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem
Index Cond: (l_orderkey = 9030) Index Cond: (l_orderkey = 9030)
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
(11 rows) (11 rows)
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)

View File

@ -74,14 +74,6 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
-> Custom Scan (Citus Real-Time) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem
-> Hash
-> Seq Scan on orders_290003 orders
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
@ -90,6 +82,14 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
-> Seq Scan on lineitem_290000 lineitem -> Seq Scan on lineitem_290000 lineitem
-> Hash -> Hash
-> Seq Scan on orders_290002 orders -> Seq Scan on orders_290002 orders
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Hash Join
Hash Cond: (lineitem.l_orderkey = orders.o_orderkey)
-> Seq Scan on lineitem_290001 lineitem
-> Hash
-> Seq Scan on orders_290003 orders
(20 rows) (20 rows)
-- Now set the minimum value for a shard to null. Then check that we don't apply -- Now set the minimum value for a shard to null. Then check that we don't apply
@ -174,14 +174,14 @@ LOG: join order: [ "lineitem" ]
Custom Scan (Citus Real-Time) Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem -> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem
Index Cond: (l_orderkey = 9030) Index Cond: (l_orderkey = 9030)
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
(11 rows) (11 rows)
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)

View File

@ -74,13 +74,6 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
-> Custom Scan (Citus Real-Time) -> Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Merge Join
Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)
-> Index Only Scan using orders_pkey_290003 on orders_290003 orders
-> Index Only Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Aggregate -> Aggregate
@ -88,6 +81,13 @@ DEBUG: join prunable for intervals [8997,14947] and [1,5986]
Merge Cond: (orders.o_orderkey = lineitem.l_orderkey) Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)
-> Index Only Scan using orders_pkey_290002 on orders_290002 orders -> Index Only Scan using orders_pkey_290002 on orders_290002 orders
-> Index Only Scan using lineitem_pkey_290000 on lineitem_290000 lineitem -> Index Only Scan using lineitem_pkey_290000 on lineitem_290000 lineitem
-> Task
Node: host=localhost port=57637 dbname=regression
-> Aggregate
-> Merge Join
Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)
-> Index Only Scan using orders_pkey_290003 on orders_290003 orders
-> Index Only Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
(18 rows) (18 rows)
-- Now set the minimum value for a shard to null. Then check that we don't apply -- Now set the minimum value for a shard to null. Then check that we don't apply
@ -172,14 +172,14 @@ LOG: join order: [ "lineitem" ]
Custom Scan (Citus Real-Time) Custom Scan (Citus Real-Time)
Task Count: 2 Task Count: 2
Tasks Shown: All Tasks Shown: All
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
-> Task -> Task
Node: host=localhost port=57638 dbname=regression Node: host=localhost port=57638 dbname=regression
-> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem -> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem
Index Cond: (l_orderkey = 9030) Index Cond: (l_orderkey = 9030)
-> Task
Node: host=localhost port=57637 dbname=regression
-> Index Scan using lineitem_pkey_290001 on lineitem_290001 lineitem
Index Cond: (l_orderkey = 9030)
(11 rows) (11 rows)
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)