mirror of https://github.com/citusdata/citus.git
135 lines
4.2 KiB
Plaintext
135 lines
4.2 KiB
Plaintext
--
|
|
-- MULTI_LARGE_TABLE_PRUNING
|
|
--
|
|
-- Tests covering partition and join-pruning for large table joins. Note that we
|
|
-- set executor type to task tracker executor here, as we cannot run repartition
|
|
-- jobs with real time executor.
|
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 700000;
|
|
ALTER SEQUENCE pg_catalog.pg_dist_jobid_seq RESTART 700000;
|
|
SET citus.large_table_shard_count TO 2;
|
|
SET client_min_messages TO DEBUG2;
|
|
SET citus.task_executor_type TO 'task-tracker';
|
|
-- Single range-repartition join to test join-pruning behaviour.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
orders, customer
|
|
WHERE
|
|
o_custkey = c_custkey;
|
|
DEBUG: join prunable for intervals [1,1000] and [1001,2000]
|
|
DEBUG: join prunable for intervals [1,1000] and [6001,7000]
|
|
DEBUG: join prunable for intervals [1001,2000] and [1,1000]
|
|
DEBUG: join prunable for intervals [1001,2000] and [6001,7000]
|
|
DEBUG: join prunable for intervals [6001,7000] and [1,1000]
|
|
DEBUG: join prunable for intervals [6001,7000] and [1001,2000]
|
|
DEBUG: pruning merge fetch taskId 1
|
|
DETAIL: Creating dependency on merge taskId 5
|
|
DEBUG: pruning merge fetch taskId 4
|
|
DETAIL: Creating dependency on merge taskId 8
|
|
DEBUG: pruning merge fetch taskId 7
|
|
DETAIL: Creating dependency on merge taskId 11
|
|
count
|
|
-------
|
|
2984
|
|
(1 row)
|
|
|
|
-- Single range-repartition join with a selection clause on the partitioned
|
|
-- table to test the case when all map tasks are pruned away.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
orders, customer
|
|
WHERE
|
|
o_custkey = c_custkey AND
|
|
o_orderkey < 0;
|
|
DEBUG: predicate pruning for shardId 290008
|
|
DEBUG: predicate pruning for shardId 290009
|
|
count
|
|
-------
|
|
|
|
(1 row)
|
|
|
|
-- Single range-repartition join with a selection clause on the base table to
|
|
-- test the case when all sql tasks are pruned away.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
orders, customer
|
|
WHERE
|
|
o_custkey = c_custkey AND
|
|
c_custkey < 0;
|
|
DEBUG: predicate pruning for shardId 290010
|
|
DEBUG: predicate pruning for shardId 280001
|
|
DEBUG: predicate pruning for shardId 280000
|
|
count
|
|
-------
|
|
|
|
(1 row)
|
|
|
|
-- Dual hash-repartition join test case. Note that this query doesn't produce
|
|
-- meaningful results and is only to test hash-partitioning of two large tables
|
|
-- on non-partition columns.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
lineitem, customer
|
|
WHERE
|
|
l_partkey = c_nationkey;
|
|
DEBUG: join prunable for task partitionId 0 and 1
|
|
DEBUG: join prunable for task partitionId 0 and 2
|
|
DEBUG: join prunable for task partitionId 0 and 3
|
|
DEBUG: join prunable for task partitionId 1 and 0
|
|
DEBUG: join prunable for task partitionId 1 and 2
|
|
DEBUG: join prunable for task partitionId 1 and 3
|
|
DEBUG: join prunable for task partitionId 2 and 0
|
|
DEBUG: join prunable for task partitionId 2 and 1
|
|
DEBUG: join prunable for task partitionId 2 and 3
|
|
DEBUG: join prunable for task partitionId 3 and 0
|
|
DEBUG: join prunable for task partitionId 3 and 1
|
|
DEBUG: join prunable for task partitionId 3 and 2
|
|
DEBUG: pruning merge fetch taskId 1
|
|
DETAIL: Creating dependency on merge taskId 17
|
|
DEBUG: pruning merge fetch taskId 2
|
|
DETAIL: Creating dependency on merge taskId 7
|
|
DEBUG: pruning merge fetch taskId 4
|
|
DETAIL: Creating dependency on merge taskId 26
|
|
DEBUG: pruning merge fetch taskId 5
|
|
DETAIL: Creating dependency on merge taskId 11
|
|
DEBUG: pruning merge fetch taskId 7
|
|
DETAIL: Creating dependency on merge taskId 35
|
|
DEBUG: pruning merge fetch taskId 8
|
|
DETAIL: Creating dependency on merge taskId 15
|
|
DEBUG: pruning merge fetch taskId 10
|
|
DETAIL: Creating dependency on merge taskId 44
|
|
DEBUG: pruning merge fetch taskId 11
|
|
DETAIL: Creating dependency on merge taskId 19
|
|
count
|
|
-------
|
|
125
|
|
(1 row)
|
|
|
|
-- Dual hash-repartition join with a selection clause on one of the tables to
|
|
-- test the case when all map tasks are pruned away.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
lineitem, customer
|
|
WHERE
|
|
l_partkey = c_nationkey AND
|
|
l_orderkey < 0;
|
|
DEBUG: predicate pruning for shardId 290000
|
|
DEBUG: predicate pruning for shardId 290001
|
|
DEBUG: predicate pruning for shardId 290002
|
|
DEBUG: predicate pruning for shardId 290003
|
|
DEBUG: predicate pruning for shardId 290004
|
|
DEBUG: predicate pruning for shardId 290005
|
|
DEBUG: predicate pruning for shardId 290006
|
|
DEBUG: predicate pruning for shardId 290007
|
|
count
|
|
-------
|
|
|
|
(1 row)
|
|
|
|
-- Reset client logging level to its previous value
|
|
SET client_min_messages TO NOTICE;
|