mirror of https://github.com/citusdata/citus.git
Merge pull request #1377 from citusdata/pg10_prep
Make minor tweaks to prepare for PostgreSQL 10 cr: @anarazelpull/1418/head
commit
209e2c48ec
|
@ -1320,7 +1320,7 @@ MasterAggregateMutator(Node *originalNode, MasterAggregateWalkerContext *walkerC
|
||||||
else if (IsA(originalNode, Var))
|
else if (IsA(originalNode, Var))
|
||||||
{
|
{
|
||||||
uint32 masterTableId = 1; /* one table on the master node */
|
uint32 masterTableId = 1; /* one table on the master node */
|
||||||
Var *newColumn = copyObject(originalNode);
|
Var *newColumn = copyObject((Var *) originalNode);
|
||||||
newColumn->varno = masterTableId;
|
newColumn->varno = masterTableId;
|
||||||
newColumn->varattno = walkerContext->columnId;
|
newColumn->varattno = walkerContext->columnId;
|
||||||
walkerContext->columnId++;
|
walkerContext->columnId++;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
|
|
|
@ -62,7 +62,6 @@ static volatile sig_atomic_t got_SIGHUP = false;
|
||||||
static volatile sig_atomic_t got_SIGTERM = false;
|
static volatile sig_atomic_t got_SIGTERM = false;
|
||||||
|
|
||||||
/* initialization forward declarations */
|
/* initialization forward declarations */
|
||||||
static void TaskTrackerMain(Datum main_arg);
|
|
||||||
static Size TaskTrackerShmemSize(void);
|
static Size TaskTrackerShmemSize(void);
|
||||||
static void TaskTrackerShmemInit(void);
|
static void TaskTrackerShmemInit(void);
|
||||||
|
|
||||||
|
@ -108,7 +107,8 @@ TaskTrackerRegister(void)
|
||||||
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
|
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
|
||||||
worker.bgw_start_time = BgWorkerStart_ConsistentState;
|
worker.bgw_start_time = BgWorkerStart_ConsistentState;
|
||||||
worker.bgw_restart_time = 1;
|
worker.bgw_restart_time = 1;
|
||||||
worker.bgw_main = TaskTrackerMain;
|
snprintf(worker.bgw_library_name, BGW_MAXLEN, "citus");
|
||||||
|
snprintf(worker.bgw_function_name, BGW_MAXLEN, "TaskTrackerMain");
|
||||||
worker.bgw_notify_pid = 0;
|
worker.bgw_notify_pid = 0;
|
||||||
snprintf(worker.bgw_name, BGW_MAXLEN, "task tracker");
|
snprintf(worker.bgw_name, BGW_MAXLEN, "task tracker");
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ TaskTrackerRegister(void)
|
||||||
|
|
||||||
|
|
||||||
/* Main entry point for task tracker process. */
|
/* Main entry point for task tracker process. */
|
||||||
static void
|
void
|
||||||
TaskTrackerMain(Datum main_arg)
|
TaskTrackerMain(Datum main_arg)
|
||||||
{
|
{
|
||||||
MemoryContext TaskTrackerContext = NULL;
|
MemoryContext TaskTrackerContext = NULL;
|
||||||
|
|
|
@ -482,6 +482,7 @@ worker_apply_sequence_command(PG_FUNCTION_ARGS)
|
||||||
/* run the CREATE SEQUENCE command */
|
/* run the CREATE SEQUENCE command */
|
||||||
ProcessUtility(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL,
|
ProcessUtility(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL,
|
||||||
NULL, None_Receiver, NULL);
|
NULL, None_Receiver, NULL);
|
||||||
|
CommandCounterIncrement();
|
||||||
|
|
||||||
createSequenceStatement = (CreateSeqStmt *) commandNode;
|
createSequenceStatement = (CreateSeqStmt *) commandNode;
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <math.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "access/hash.h"
|
#include "access/hash.h"
|
||||||
|
|
|
@ -112,6 +112,8 @@ extern int MaxRunningTasksPerNode;
|
||||||
/* State shared by the task tracker and task tracker protocol functions */
|
/* State shared by the task tracker and task tracker protocol functions */
|
||||||
extern WorkerTasksSharedStateData *WorkerTasksSharedState;
|
extern WorkerTasksSharedStateData *WorkerTasksSharedState;
|
||||||
|
|
||||||
|
/* Entry point */
|
||||||
|
extern void TaskTrackerMain(Datum main_arg);
|
||||||
|
|
||||||
/* Function declarations local to the worker module */
|
/* Function declarations local to the worker module */
|
||||||
extern WorkerTask * WorkerTasksHashEnter(uint64 jobId, uint32 taskId);
|
extern WorkerTask * WorkerTasksHashEnter(uint64 jobId, uint32 taskId);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_AGG_APPROXIMATE_DISTINCT
|
-- MULTI_AGG_APPROXIMATE_DISTINCT
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
|
|
||||||
-- Create HLL extension if present, print false result otherwise
|
-- Create HLL extension if present, print false result otherwise
|
||||||
SELECT CASE WHEN COUNT(*) > 0 THEN
|
SELECT CASE WHEN COUNT(*) > 0 THEN
|
||||||
'CREATE EXTENSION HLL'
|
'CREATE EXTENSION HLL'
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_AGG_APPROXIMATE_DISTINCT
|
-- MULTI_AGG_APPROXIMATE_DISTINCT
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
|
|
||||||
-- Create HLL extension if present, print false result otherwise
|
-- Create HLL extension if present, print false result otherwise
|
||||||
SELECT CASE WHEN COUNT(*) > 0 THEN
|
SELECT CASE WHEN COUNT(*) > 0 THEN
|
||||||
'CREATE EXTENSION HLL'
|
'CREATE EXTENSION HLL'
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- This test checks that the group-by columns don't need to be above an average
|
-- This test checks that the group-by columns don't need to be above an average
|
||||||
-- expression, and can be anywhere in the projection order. This is in response
|
-- expression, and can be anywhere in the projection order. This is in response
|
||||||
-- to a bug we had due to the average expression introducing new columns.
|
-- to a bug we had due to the average expression introducing new columns.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 450000;
|
|
||||||
SELECT
|
SELECT
|
||||||
sum(l_quantity) as sum_qty,
|
sum(l_quantity) as sum_qty,
|
||||||
sum(l_extendedprice) as sum_base_price,
|
sum(l_extendedprice) as sum_base_price,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_BASIC_QUERIES
|
-- MULTI_BASIC_QUERIES
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 440000;
|
|
||||||
-- Execute simple sum, average, and count queries on data recently uploaded to
|
-- Execute simple sum, average, and count queries on data recently uploaded to
|
||||||
-- our partitioned table.
|
-- our partitioned table.
|
||||||
SELECT count(*) FROM lineitem;
|
SELECT count(*) FROM lineitem;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_COMPLEX_EXPRESSIONS
|
-- MULTI_COMPLEX_EXPRESSIONS
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 420000;
|
|
||||||
-- Check that we can correctly handle complex expressions and aggregates.
|
-- Check that we can correctly handle complex expressions and aggregates.
|
||||||
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
|
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
|
||||||
?column?
|
?column?
|
||||||
|
@ -435,22 +434,21 @@ FROM
|
||||||
lineitem li JOIN orders o ON li.l_orderkey = o.o_orderkey
|
lineitem li JOIN orders o ON li.l_orderkey = o.o_orderkey
|
||||||
WHERE
|
WHERE
|
||||||
li.l_quantity > 25
|
li.l_quantity > 25
|
||||||
ORDER BY
|
ORDER BY 1, 2, 3
|
||||||
li.l_quantity, li.l_partkey, o.o_custkey
|
|
||||||
LIMIT 10 OFFSET 20;
|
LIMIT 10 OFFSET 20;
|
||||||
DEBUG: push down of limit count: 30
|
DEBUG: push down of limit count: 30
|
||||||
l_partkey | o_custkey | l_quantity
|
l_partkey | o_custkey | l_quantity
|
||||||
-----------+-----------+------------
|
-----------+-----------+------------
|
||||||
25221 | 656 | 26.00
|
655 | 58 | 50.00
|
||||||
25373 | 1369 | 26.00
|
669 | 319 | 34.00
|
||||||
27331 | 571 | 26.00
|
699 | 1255 | 50.00
|
||||||
27699 | 1150 | 26.00
|
716 | 61 | 45.00
|
||||||
28226 | 913 | 26.00
|
723 | 14 | 36.00
|
||||||
28635 | 1207 | 26.00
|
802 | 754 | 50.00
|
||||||
29101 | 1283 | 26.00
|
831 | 589 | 32.00
|
||||||
31143 | 640 | 26.00
|
835 | 67 | 33.00
|
||||||
31239 | 685 | 26.00
|
864 | 439 | 32.00
|
||||||
33646 | 860 | 26.00
|
875 | 13 | 43.00
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_COUNT_TYPE_CONVERSION
|
-- MULTI_COUNT_TYPE_CONVERSION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 400000;
|
|
||||||
-- Verify that we can sort count(*) results correctly. We perform this check as
|
-- Verify that we can sort count(*) results correctly. We perform this check as
|
||||||
-- our count() operations execute in two steps: worker nodes report their
|
-- our count() operations execute in two steps: worker nodes report their
|
||||||
-- count() results, and the master node sums these counts up. During this sum(),
|
-- count() results, and the master node sums these counts up. During this sum(),
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SELECT substring(version(), '\d+\.\d+') AS major_version;
|
SELECT substring(version(), '\d+(?:\.\d+)?') AS major_version;
|
||||||
major_version
|
major_version
|
||||||
---------------
|
---------------
|
||||||
9.6
|
9.6
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SELECT substring(version(), '\d+\.\d+') AS major_version;
|
SELECT substring(version(), '\d+(?:\.\d+)?') AS major_version;
|
||||||
major_version
|
major_version
|
||||||
---------------
|
---------------
|
||||||
9.5
|
9.5
|
||||||
|
|
|
@ -292,14 +292,15 @@ FROM (SELECT raw_events_second.user_id AS id,
|
||||||
FROM raw_events_first,
|
FROM raw_events_first,
|
||||||
raw_events_second
|
raw_events_second
|
||||||
WHERE raw_events_first.user_id = raw_events_second.user_id) AS foo
|
WHERE raw_events_first.user_id = raw_events_second.user_id) AS foo
|
||||||
GROUP BY id;
|
GROUP BY id
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300008 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300000 raw_events_first, public.raw_events_second_13300004 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= '-2147483648'::integer) AND (worker_hash(id) <= '-1073741825'::integer)) GROUP BY id
|
ORDER BY id;
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300009 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300001 raw_events_first, public.raw_events_second_13300005 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= '-1073741824'::integer) AND (worker_hash(id) <= '-1'::integer)) GROUP BY id
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300008 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300000 raw_events_first, public.raw_events_second_13300004 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= '-2147483648'::integer) AND (worker_hash(id) <= '-1073741825'::integer)) GROUP BY id ORDER BY id
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300010 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300002 raw_events_first, public.raw_events_second_13300006 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= 0) AND (worker_hash(id) <= 1073741823)) GROUP BY id
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300009 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300001 raw_events_first, public.raw_events_second_13300005 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= '-1073741824'::integer) AND (worker_hash(id) <= '-1'::integer)) GROUP BY id ORDER BY id
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300011 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300003 raw_events_first, public.raw_events_second_13300007 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= 1073741824) AND (worker_hash(id) <= 2147483647)) GROUP BY id
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300010 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300002 raw_events_first, public.raw_events_second_13300006 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= 0) AND (worker_hash(id) <= 1073741823)) GROUP BY id ORDER BY id
|
||||||
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300011 AS citus_table_alias (user_id, value_1_agg) SELECT id, sum(value_1) AS sum FROM (SELECT raw_events_second.user_id AS id, raw_events_second.value_1 FROM public.raw_events_first_13300003 raw_events_first, public.raw_events_second_13300007 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id)) foo WHERE ((worker_hash(id) >= 1073741824) AND (worker_hash(id) <= 2147483647)) GROUP BY id ORDER BY id
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
ERROR: duplicate key value violates unique constraint "agg_events_user_id_value_1_agg_key_13300008"
|
ERROR: duplicate key value violates unique constraint "agg_events_user_id_value_1_agg_key_13300008"
|
||||||
DETAIL: Key (user_id, value_1_agg)=(5, 50) already exists.
|
DETAIL: Key (user_id, value_1_agg)=(1, 10) already exists.
|
||||||
CONTEXT: while executing command on localhost:57638
|
CONTEXT: while executing command on localhost:57638
|
||||||
-- subquery one more level depth
|
-- subquery one more level depth
|
||||||
INSERT INTO agg_events
|
INSERT INTO agg_events
|
||||||
|
@ -315,11 +316,12 @@ FROM (SELECT SUM(raw_events_second.value_4) AS v4,
|
||||||
FROM raw_events_first,
|
FROM raw_events_first,
|
||||||
raw_events_second
|
raw_events_second
|
||||||
WHERE raw_events_first.user_id = raw_events_second.user_id
|
WHERE raw_events_first.user_id = raw_events_second.user_id
|
||||||
GROUP BY raw_events_second.user_id) AS foo;
|
GROUP BY raw_events_second.user_id) AS foo
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300008 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300000 raw_events_first, public.raw_events_second_13300004 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= '-2147483648'::integer) AND (worker_hash(id) <= '-1073741825'::integer))
|
ORDER BY id;
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300009 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300001 raw_events_first, public.raw_events_second_13300005 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= '-1073741824'::integer) AND (worker_hash(id) <= '-1'::integer))
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300008 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300000 raw_events_first, public.raw_events_second_13300004 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= '-2147483648'::integer) AND (worker_hash(id) <= '-1073741825'::integer)) ORDER BY id
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300010 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300002 raw_events_first, public.raw_events_second_13300006 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= 0) AND (worker_hash(id) <= 1073741823))
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300009 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300001 raw_events_first, public.raw_events_second_13300005 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= '-1073741824'::integer) AND (worker_hash(id) <= '-1'::integer)) ORDER BY id
|
||||||
DEBUG: distributed statement: INSERT INTO public.agg_events_13300011 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300003 raw_events_first, public.raw_events_second_13300007 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= 1073741824) AND (worker_hash(id) <= 2147483647))
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300010 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300002 raw_events_first, public.raw_events_second_13300006 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= 0) AND (worker_hash(id) <= 1073741823)) ORDER BY id
|
||||||
|
DEBUG: distributed statement: INSERT INTO public.agg_events_13300011 AS citus_table_alias (user_id, value_1_agg, value_4_agg) SELECT id, v1, v4 FROM (SELECT sum(raw_events_second.value_4) AS v4, sum(raw_events_first.value_1) AS v1, raw_events_second.user_id AS id FROM public.raw_events_first_13300003 raw_events_first, public.raw_events_second_13300007 raw_events_second WHERE (raw_events_first.user_id = raw_events_second.user_id) GROUP BY raw_events_second.user_id) foo WHERE ((worker_hash(id) >= 1073741824) AND (worker_hash(id) <= 2147483647)) ORDER BY id
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
ERROR: duplicate key value violates unique constraint "agg_events_user_id_value_1_agg_key_13300008"
|
ERROR: duplicate key value violates unique constraint "agg_events_user_id_value_1_agg_key_13300008"
|
||||||
DETAIL: Key (user_id, value_1_agg)=(1, 10) already exists.
|
DETAIL: Key (user_id, value_1_agg)=(1, 10) already exists.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_LIMIT_CLAUSE
|
-- MULTI_LIMIT_CLAUSE
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 730000;
|
|
||||||
-- Display debug messages on limit clause push down.
|
-- Display debug messages on limit clause push down.
|
||||||
SET client_min_messages TO DEBUG1;
|
SET client_min_messages TO DEBUG1;
|
||||||
-- Check that we can correctly handle the Limit clause in distributed queries.
|
-- Check that we can correctly handle the Limit clause in distributed queries.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_LIMIT_CLAUSE_APPROXIMATE
|
-- MULTI_LIMIT_CLAUSE_APPROXIMATE
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 720000;
|
|
||||||
-- Display debug messages on limit clause push down.
|
-- Display debug messages on limit clause push down.
|
||||||
SET client_min_messages TO DEBUG1;
|
SET client_min_messages TO DEBUG1;
|
||||||
-- We first look at results with limit optimization disabled. This first query
|
-- We first look at results with limit optimization disabled. This first query
|
||||||
|
|
|
@ -661,8 +661,8 @@ SELECT * FROM pg_dist_shard_placement ORDER BY shardid, nodename, nodeport;
|
||||||
-- Check that CREATE INDEX statement is propagated
|
-- Check that CREATE INDEX statement is propagated
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SET citus.multi_shard_commit_protocol TO '2pc';
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
SET client_min_messages TO 'ERROR';
|
||||||
CREATE INDEX mx_index_3 ON mx_test_schema_2.mx_table_2 USING hash (col1);
|
CREATE INDEX mx_index_3 ON mx_test_schema_2.mx_table_2 USING hash (col1);
|
||||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
|
||||||
CREATE UNIQUE INDEX mx_index_4 ON mx_test_schema_2.mx_table_2(col1);
|
CREATE UNIQUE INDEX mx_index_4 ON mx_test_schema_2.mx_table_2(col1);
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
\d mx_test_schema_2.mx_table_2
|
\d mx_test_schema_2.mx_table_2
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
-- Tests related to distributed DDL commands on mx cluster
|
-- Tests related to distributed DDL commands on mx cluster
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1600000;
|
|
||||||
SELECT * FROM mx_ddl_table ORDER BY key;
|
SELECT * FROM mx_ddl_table ORDER BY key;
|
||||||
key | value
|
key | value
|
||||||
-----+-------
|
-----+-------
|
||||||
|
@ -207,10 +206,10 @@ SELECT groupid FROM pg_dist_local_group;
|
||||||
12
|
12
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT * FROM mx_sequence_value_seq;
|
SELECT last_value FROM mx_sequence_value_seq;
|
||||||
sequence_name | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
|
last_value
|
||||||
-----------------------+------------------+------------------+--------------+------------------+------------------+-------------+---------+-----------+-----------
|
------------------
|
||||||
mx_sequence_value_seq | 3377699720527873 | 3377699720527873 | 1 | 3659174697238529 | 3377699720527873 | 1 | 0 | f | f
|
3377699720527873
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
@ -220,10 +219,10 @@ SELECT groupid FROM pg_dist_local_group;
|
||||||
14
|
14
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT * FROM mx_sequence_value_seq;
|
SELECT last_value FROM mx_sequence_value_seq;
|
||||||
sequence_name | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
|
last_value
|
||||||
-----------------------+------------------+------------------+--------------+------------------+------------------+-------------+---------+-----------+-----------
|
------------------
|
||||||
mx_sequence_value_seq | 3940649673949185 | 3940649673949185 | 1 | 4222124650659841 | 3940649673949185 | 1 | 0 | f | f
|
3940649673949185
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
|
@ -312,26 +312,35 @@ WHERE
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- set operations are supported
|
-- set operations are supported
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
UNION
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+--------------------------
|
---------+---------+---------+--------------------------
|
||||||
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
||||||
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
|
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
EXCEPT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+--------------------------
|
---------+---------+---------+--------------------------
|
||||||
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
INTERSECT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
INTERSECT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+---------
|
---------+---------+---------+---------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 840000;
|
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test router planner functionality for single shard select queries
|
-- test router planner functionality for single shard select queries
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
|
@ -355,7 +354,8 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1 or author_id = 3
|
WHERE author_id = 1 or author_id = 3
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | subtitle | count
|
id | subtitle | count
|
||||||
|
@ -385,7 +385,8 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1 or author_id = 2
|
WHERE author_id = 1 or author_id = 2
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
||||||
HINT: Consider using an equality filter on the distributed table's partition column.
|
HINT: Consider using an equality filter on the distributed table's partition column.
|
||||||
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
||||||
|
@ -708,43 +709,26 @@ DEBUG: Plan is router executable
|
||||||
|
|
||||||
|
|
||||||
-- router plannable union queries are supported
|
-- router plannable union queries are supported
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
|
|
||||||
UNION
|
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 3);
|
|
||||||
DEBUG: Creating router plan
|
|
||||||
DEBUG: Plan is router executable
|
|
||||||
id | author_id | title | word_count
|
|
||||||
----+-----------+--------------+------------
|
|
||||||
3 | 3 | asternal | 10480
|
|
||||||
43 | 3 | affixal | 12723
|
|
||||||
23 | 3 | abhorring | 6799
|
|
||||||
13 | 3 | aseyev | 2255
|
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
|
||||||
1 | 1 | arsenous | 9572
|
|
||||||
21 | 1 | arcading | 5890
|
|
||||||
31 | 1 | athwartships | 7271
|
|
||||||
33 | 3 | autochrome | 8180
|
|
||||||
(10 rows)
|
|
||||||
|
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
|
SELECT * FROM articles_hash_mx WHERE author_id = 1
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 3)) uu;
|
SELECT * FROM articles_hash_mx WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | author_id | title | word_count
|
id | author_id | title | word_count
|
||||||
----+-----------+--------------+------------
|
----+-----------+--------------+------------
|
||||||
3 | 3 | asternal | 10480
|
|
||||||
43 | 3 | affixal | 12723
|
|
||||||
23 | 3 | abhorring | 6799
|
|
||||||
13 | 3 | aseyev | 2255
|
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
|
||||||
1 | 1 | arsenous | 9572
|
1 | 1 | arsenous | 9572
|
||||||
|
3 | 3 | asternal | 10480
|
||||||
|
11 | 1 | alamo | 1347
|
||||||
|
13 | 3 | aseyev | 2255
|
||||||
21 | 1 | arcading | 5890
|
21 | 1 | arcading | 5890
|
||||||
|
23 | 3 | abhorring | 6799
|
||||||
31 | 1 | athwartships | 7271
|
31 | 1 | athwartships | 7271
|
||||||
33 | 3 | autochrome | 8180
|
33 | 3 | autochrome | 8180
|
||||||
|
41 | 1 | aznavour | 11814
|
||||||
|
43 | 3 | affixal | 12723
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 1)
|
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 1)
|
||||||
|
@ -767,17 +751,20 @@ DEBUG: Plan is router executable
|
||||||
a
|
a
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3);
|
EXCEPT
|
||||||
|
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY 1;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
left
|
left
|
||||||
------
|
------
|
||||||
|
al
|
||||||
|
ar
|
||||||
at
|
at
|
||||||
az
|
az
|
||||||
ar
|
|
||||||
al
|
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- union queries are not supported if not router plannable
|
-- union queries are not supported if not router plannable
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_SCHEMA_SUPPORT
|
-- MULTI_MX_SCHEMA_SUPPORT
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1210000;
|
|
||||||
-- connect to a worker node and run some queries
|
-- connect to a worker node and run some queries
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
-- test very basic queries
|
-- test very basic queries
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY1
|
-- MULTI_MX_TPCH_QUERY1
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
@ -38,7 +37,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #1 from the TPC-H decision support benchmark
|
-- Query #1 from the TPC-H decision support benchmark
|
||||||
|
@ -73,7 +71,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #1 from the TPC-H decision support benchmark
|
-- Query #1 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
-- connect to master
|
-- connect to master
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -65,7 +64,6 @@ LIMIT 20;
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
@ -124,7 +122,6 @@ LIMIT 20;
|
||||||
|
|
||||||
-- connect to the other worker
|
-- connect to the other worker
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY12
|
-- MULTI_MX_TPCH_QUERY12
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
@ -43,7 +42,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #12 from the TPC-H decision support benchmark
|
-- Query #12 from the TPC-H decision support benchmark
|
||||||
|
@ -83,7 +81,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #12 from the TPC-H decision support benchmark
|
-- Query #12 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY14
|
-- MULTI_MX_TPCH_QUERY14
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
@ -27,7 +26,6 @@ WHERE
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #14 from the TPC-H decision support benchmark
|
-- Query #14 from the TPC-H decision support benchmark
|
||||||
|
@ -51,7 +49,6 @@ WHERE
|
||||||
|
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #14 from the TPC-H decision support benchmark
|
-- Query #14 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY19
|
-- MULTI_MX_TPCH_QUERY19
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
@ -44,7 +43,6 @@ WHERE
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
||||||
|
@ -85,7 +83,6 @@ WHERE
|
||||||
|
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -51,7 +50,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
||||||
|
@ -96,7 +94,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY6
|
-- MULTI_MX_TPCH_QUERY6
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
@ -23,7 +22,6 @@ WHERE
|
||||||
|
|
||||||
-- connect to one of the worker nodes
|
-- connect to one of the worker nodes
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
|
@ -43,7 +41,6 @@ WHERE
|
||||||
|
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY7
|
-- MULTI_MX_TPCH_QUERY7
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
|
@ -53,7 +52,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H decision support benchmark
|
-- Query #7 from the TPC-H decision support benchmark
|
||||||
|
@ -103,7 +101,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H decision support benchmark
|
-- Query #7 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_TPCH_QUERY7_NESTED
|
-- MULTI_MX_TPCH_QUERY7_NESTED
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
|
@ -62,7 +61,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to one of the workers
|
-- connect to one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
||||||
|
@ -121,7 +119,6 @@ ORDER BY
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Many of the queries are taken from other regression test files
|
-- Many of the queries are taken from other regression test files
|
||||||
-- and converted into both plain SQL and PL/pgsql functions, which
|
-- and converted into both plain SQL and PL/pgsql functions, which
|
||||||
-- use prepared statements internally.
|
-- use prepared statements internally.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 780000;
|
|
||||||
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
|
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Tests covering PREPARE statements. Many of the queries are
|
-- Tests covering PREPARE statements. Many of the queries are
|
||||||
-- taken from other regression test files and converted into
|
-- taken from other regression test files and converted into
|
||||||
-- prepared statements.
|
-- prepared statements.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 790000;
|
|
||||||
PREPARE prepared_test_1 AS
|
PREPARE prepared_test_1 AS
|
||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
|
|
|
@ -360,26 +360,35 @@ WHERE
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- set operations are supported
|
-- set operations are supported
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
UNION
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+--------------------------
|
---------+---------+---------+--------------------------
|
||||||
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
||||||
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
|
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
EXCEPT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+--------------------------
|
---------+---------+---------+--------------------------
|
||||||
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
INTERSECT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
INTERSECT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
value_1 | value_2 | value_3 | value_4
|
value_1 | value_2 | value_3 | value_4
|
||||||
---------+---------+---------+---------
|
---------+---------+---------+---------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
|
@ -453,7 +453,8 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1 or author_id = 3
|
WHERE author_id = 1 or author_id = 3
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | subtitle | count
|
id | subtitle | count
|
||||||
|
@ -483,7 +484,8 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1 or author_id = 2
|
WHERE author_id = 1 or author_id = 2
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
||||||
HINT: Consider using an equality filter on the distributed table's partition column.
|
HINT: Consider using an equality filter on the distributed table's partition column.
|
||||||
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
||||||
|
@ -820,45 +822,27 @@ DEBUG: Plan is router executable
|
||||||
11814
|
11814
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
|
||||||
-- router plannable union queries are supported
|
-- router plannable union queries are supported
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
|
||||||
UNION
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 3);
|
|
||||||
DEBUG: Creating router plan
|
|
||||||
DEBUG: Plan is router executable
|
|
||||||
id | author_id | title | word_count
|
|
||||||
----+-----------+--------------+------------
|
|
||||||
3 | 3 | asternal | 10480
|
|
||||||
43 | 3 | affixal | 12723
|
|
||||||
23 | 3 | abhorring | 6799
|
|
||||||
13 | 3 | aseyev | 2255
|
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
|
||||||
1 | 1 | arsenous | 9572
|
|
||||||
21 | 1 | arcading | 5890
|
|
||||||
31 | 1 | athwartships | 7271
|
|
||||||
33 | 3 | autochrome | 8180
|
|
||||||
(10 rows)
|
|
||||||
|
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 3)) uu;
|
SELECT * FROM articles_hash WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | author_id | title | word_count
|
id | author_id | title | word_count
|
||||||
----+-----------+--------------+------------
|
----+-----------+--------------+------------
|
||||||
3 | 3 | asternal | 10480
|
|
||||||
43 | 3 | affixal | 12723
|
|
||||||
23 | 3 | abhorring | 6799
|
|
||||||
13 | 3 | aseyev | 2255
|
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
|
||||||
1 | 1 | arsenous | 9572
|
1 | 1 | arsenous | 9572
|
||||||
|
3 | 3 | asternal | 10480
|
||||||
|
11 | 1 | alamo | 1347
|
||||||
|
13 | 3 | aseyev | 2255
|
||||||
21 | 1 | arcading | 5890
|
21 | 1 | arcading | 5890
|
||||||
|
23 | 3 | abhorring | 6799
|
||||||
31 | 1 | athwartships | 7271
|
31 | 1 | athwartships | 7271
|
||||||
33 | 3 | autochrome | 8180
|
33 | 3 | autochrome | 8180
|
||||||
|
41 | 1 | aznavour | 11814
|
||||||
|
43 | 3 | affixal | 12723
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 1)
|
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 1)
|
||||||
|
@ -881,17 +865,20 @@ DEBUG: Plan is router executable
|
||||||
a
|
a
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3);
|
EXCEPT
|
||||||
|
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY 1;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
left
|
left
|
||||||
------
|
------
|
||||||
|
al
|
||||||
|
ar
|
||||||
at
|
at
|
||||||
az
|
az
|
||||||
ar
|
|
||||||
al
|
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- union queries are not supported if not router plannable
|
-- union queries are not supported if not router plannable
|
||||||
|
@ -1379,31 +1366,37 @@ DEBUG: Plan is router executable
|
||||||
-- union/difference /intersection with where false
|
-- union/difference /intersection with where false
|
||||||
-- this query was not originally router plannable, addition of 1=0
|
-- this query was not originally router plannable, addition of 1=0
|
||||||
-- makes it router plannable
|
-- makes it router plannable
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
|
UNION
|
||||||
|
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | author_id | title | word_count
|
id | author_id | title | word_count
|
||||||
----+-----------+--------------+------------
|
----+-----------+--------------+------------
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
|
||||||
1 | 1 | arsenous | 9572
|
1 | 1 | arsenous | 9572
|
||||||
|
11 | 1 | alamo | 1347
|
||||||
21 | 1 | arcading | 5890
|
21 | 1 | arcading | 5890
|
||||||
31 | 1 | athwartships | 7271
|
31 | 1 | athwartships | 7271
|
||||||
|
41 | 1 | aznavour | 11814
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
|
EXCEPT
|
||||||
|
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
id | author_id | title | word_count
|
id | author_id | title | word_count
|
||||||
----+-----------+--------------+------------
|
----+-----------+--------------+------------
|
||||||
1 | 1 | arsenous | 9572
|
1 | 1 | arsenous | 9572
|
||||||
|
11 | 1 | alamo | 1347
|
||||||
21 | 1 | arcading | 5890
|
21 | 1 | arcading | 5890
|
||||||
31 | 1 | athwartships | 7271
|
31 | 1 | athwartships | 7271
|
||||||
11 | 1 | alamo | 1347
|
|
||||||
41 | 1 | aznavour | 11814
|
41 | 1 | aznavour | 11814
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY1
|
-- MULTI_TPCH_QUERY1
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 890000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #1 from the TPC-H decision support benchmark
|
-- Query #1 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 900000;
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY12
|
-- MULTI_TPCH_QUERY12
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 910000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #12 from the TPC-H decision support benchmark
|
-- Query #12 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY14
|
-- MULTI_TPCH_QUERY14
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 920000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #14 from the TPC-H decision support benchmark
|
-- Query #14 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY19
|
-- MULTI_TPCH_QUERY19
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 930000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 940000;
|
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY6
|
-- MULTI_TPCH_QUERY6
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 950000;
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY7
|
-- MULTI_TPCH_QUERY7
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 970000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H decision support benchmark
|
-- Query #7 from the TPC-H decision support benchmark
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_TPCH_QUERY7_NESTED
|
-- MULTI_TPCH_QUERY7_NESTED
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 960000;
|
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
-- projection order are called working (resjunk) columns. We check in here that
|
-- projection order are called working (resjunk) columns. We check in here that
|
||||||
-- these columns are pulled to the master, and are correctly used in sorting and
|
-- these columns are pulled to the master, and are correctly used in sorting and
|
||||||
-- grouping.
|
-- grouping.
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1040000;
|
|
||||||
SELECT l_quantity FROM lineitem ORDER BY l_shipdate, l_quantity LIMIT 20;
|
SELECT l_quantity FROM lineitem ORDER BY l_shipdate, l_quantity LIMIT 20;
|
||||||
l_quantity
|
l_quantity
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- TASK_TRACKER_ASSIGN_TASK
|
-- TASK_TRACKER_ASSIGN_TASK
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1050000;
|
|
||||||
\set JobId 401010
|
\set JobId 401010
|
||||||
\set SimpleTaskId 101101
|
\set SimpleTaskId 101101
|
||||||
\set RecoverableTaskId 801102
|
\set RecoverableTaskId 801102
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- TASK_TRACKER_PARTITION_TASK
|
-- TASK_TRACKER_PARTITION_TASK
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1080000;
|
|
||||||
\set JobId 401010
|
\set JobId 401010
|
||||||
\set PartitionTaskId 801106
|
\set PartitionTaskId 801106
|
||||||
\set PartitionColumn l_orderkey
|
\set PartitionColumn l_orderkey
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_BINARY_DATA_PARTITION
|
-- WORKER_BINARY_DATA_PARTITION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1090000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101105
|
\set TaskId 101105
|
||||||
\set Partition_Column textcolumn
|
\set Partition_Column textcolumn
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_HASH_PARTITION
|
-- WORKER_HASH_PARTITION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1130000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101103
|
\set TaskId 101103
|
||||||
\set Partition_Column l_orderkey
|
\set Partition_Column l_orderkey
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_HASH_PARTITION_COMPLEX
|
-- WORKER_HASH_PARTITION_COMPLEX
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1120000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101104
|
\set TaskId 101104
|
||||||
\set Partition_Column l_partkey
|
\set Partition_Column l_partkey
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_MERGE_HASH_FILES
|
-- WORKER_MERGE_HASH_FILES
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1140000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101103
|
\set TaskId 101103
|
||||||
\set Task_Table_Name public.task_101103
|
\set Task_Table_Name public.task_101103
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_MERGE_RANGE_FILES
|
-- WORKER_MERGE_RANGE_FILES
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1150000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101101
|
\set TaskId 101101
|
||||||
\set Task_Table_Name public.task_101101
|
\set Task_Table_Name public.task_101101
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_NULL_DATA_PARTITION
|
-- WORKER_NULL_DATA_PARTITION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1180000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set Range_TaskId 101106
|
\set Range_TaskId 101106
|
||||||
\set Partition_Column s_nationkey
|
\set Partition_Column s_nationkey
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_RANGE_PARTITION
|
-- WORKER_RANGE_PARTITION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1160000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101101
|
\set TaskId 101101
|
||||||
\set Partition_Column l_orderkey
|
\set Partition_Column l_orderkey
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- WORKER_RANGE_PARTITION_COMPLEX
|
-- WORKER_RANGE_PARTITION_COMPLEX
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1170000;
|
|
||||||
\set JobId 201010
|
\set JobId 201010
|
||||||
\set TaskId 101102
|
\set TaskId 101102
|
||||||
\set Partition_Column l_partkey
|
\set Partition_Column l_partkey
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 200000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Create a new range partitioned lineitem table and load data into it
|
-- Create a new range partitioned lineitem table and load data into it
|
||||||
CREATE TABLE lineitem_range (
|
CREATE TABLE lineitem_range (
|
||||||
l_orderkey bigint not null,
|
l_orderkey bigint not null,
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 210000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Test aggregate type conversions using sums of integers and division operator
|
-- Test aggregate type conversions using sums of integers and division operator
|
||||||
SELECT sum(l_suppkey) FROM lineitem;
|
SELECT sum(l_suppkey) FROM lineitem;
|
||||||
SELECT sum(l_suppkey) / 2 FROM lineitem;
|
SELECT sum(l_suppkey) / 2 FROM lineitem;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- multi insert select behavioral analytics
|
-- multi behavioral analytics
|
||||||
-- this file is intended to create the table requires for the tests
|
-- this file is intended to create the table requires for the tests
|
||||||
--
|
--
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
-- MULTI_MX_COPY_DATA
|
-- MULTI_MX_COPY_DATA
|
||||||
--
|
--
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 290000;
|
|
||||||
|
|
||||||
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
||||||
|
|
||||||
SET search_path TO citus_mx_test_schema;
|
SET search_path TO citus_mx_test_schema;
|
||||||
|
|
|
@ -7,7 +7,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||||
|
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SHOW server_version \gset
|
SHOW server_version \gset
|
||||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
|
||||||
|
|
||||||
|
|
||||||
-- Create tables for subquery tests
|
-- Create tables for subquery tests
|
||||||
|
@ -1060,7 +1060,9 @@ FROM
|
||||||
subquery_1.user_id,
|
subquery_1.user_id,
|
||||||
hasdone) AS subquery_top
|
hasdone) AS subquery_top
|
||||||
GROUP BY
|
GROUP BY
|
||||||
hasdone;
|
hasdone
|
||||||
|
ORDER BY
|
||||||
|
event_average;
|
||||||
|
|
||||||
-- Union, left join and having subquery pushdown
|
-- Union, left join and having subquery pushdown
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -30,8 +30,8 @@ test: multi_create_table_constraints
|
||||||
test: multi_master_protocol
|
test: multi_master_protocol
|
||||||
test: multi_load_data
|
test: multi_load_data
|
||||||
|
|
||||||
test: multi_insert_select_behavioral_analytics_create_table
|
test: multi_behavioral_analytics_create_table
|
||||||
test: multi_insert_select_behavioral_analytics_basics multi_insert_select_behavioral_analytics_single_shard_queries multi_insert_select_non_pushable_queries
|
test: multi_behavioral_analytics_basics multi_behavioral_analytics_single_shard_queries multi_insert_select_non_pushable_queries
|
||||||
test: multi_insert_select
|
test: multi_insert_select
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_AGG_DISTINCT
|
-- MULTI_AGG_DISTINCT
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 200000;
|
|
||||||
-- Create a new range partitioned lineitem table and load data into it
|
-- Create a new range partitioned lineitem table and load data into it
|
||||||
CREATE TABLE lineitem_range (
|
CREATE TABLE lineitem_range (
|
||||||
l_orderkey bigint not null,
|
l_orderkey bigint not null,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_AGG_TYPE_CONVERSION
|
-- MULTI_AGG_TYPE_CONVERSION
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 210000;
|
|
||||||
-- Test aggregate type conversions using sums of integers and division operator
|
-- Test aggregate type conversions using sums of integers and division operator
|
||||||
SELECT sum(l_suppkey) FROM lineitem;
|
SELECT sum(l_suppkey) FROM lineitem;
|
||||||
sum
|
sum
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- multi insert select behavioral analytics
|
-- multi behavioral analytics
|
||||||
-- this file is intended to create the table requires for the tests
|
-- this file is intended to create the table requires for the tests
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1400000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1400000;
|
|
@ -1,7 +1,6 @@
|
||||||
--
|
--
|
||||||
-- MULTI_MX_COPY_DATA
|
-- MULTI_MX_COPY_DATA
|
||||||
--
|
--
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 290000;
|
|
||||||
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
||||||
SET search_path TO citus_mx_test_schema;
|
SET search_path TO citus_mx_test_schema;
|
||||||
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SHOW server_version \gset
|
SHOW server_version \gset
|
||||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
|
||||||
major_version
|
major_version
|
||||||
---------------
|
---------------
|
||||||
9.6
|
9.6
|
||||||
|
@ -1021,11 +1021,13 @@ FROM
|
||||||
subquery_1.user_id,
|
subquery_1.user_id,
|
||||||
hasdone) AS subquery_top
|
hasdone) AS subquery_top
|
||||||
GROUP BY
|
GROUP BY
|
||||||
hasdone;
|
hasdone
|
||||||
|
ORDER BY
|
||||||
|
event_average;
|
||||||
event_average | hasdone
|
event_average | hasdone
|
||||||
--------------------+---------------------
|
--------------------+---------------------
|
||||||
4.0000000000000000 | Has not done paying
|
|
||||||
2.5000000000000000 | Has done paying
|
2.5000000000000000 | Has done paying
|
||||||
|
4.0000000000000000 | Has not done paying
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- Union, left join and having subquery pushdown
|
-- Union, left join and having subquery pushdown
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SHOW server_version \gset
|
SHOW server_version \gset
|
||||||
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
|
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
|
||||||
major_version
|
major_version
|
||||||
---------------
|
---------------
|
||||||
9.5
|
9.5
|
||||||
|
@ -1021,11 +1021,13 @@ FROM
|
||||||
subquery_1.user_id,
|
subquery_1.user_id,
|
||||||
hasdone) AS subquery_top
|
hasdone) AS subquery_top
|
||||||
GROUP BY
|
GROUP BY
|
||||||
hasdone;
|
hasdone
|
||||||
|
ORDER BY
|
||||||
|
event_average;
|
||||||
event_average | hasdone
|
event_average | hasdone
|
||||||
--------------------+---------------------
|
--------------------+---------------------
|
||||||
4.0000000000000000 | Has not done paying
|
|
||||||
2.5000000000000000 | Has done paying
|
2.5000000000000000 | Has done paying
|
||||||
|
4.0000000000000000 | Has not done paying
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- Union, left join and having subquery pushdown
|
-- Union, left join and having subquery pushdown
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
|
|
||||||
|
|
||||||
-- Create HLL extension if present, print false result otherwise
|
-- Create HLL extension if present, print false result otherwise
|
||||||
SELECT CASE WHEN COUNT(*) > 0 THEN
|
SELECT CASE WHEN COUNT(*) > 0 THEN
|
||||||
'CREATE EXTENSION HLL'
|
'CREATE EXTENSION HLL'
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
-- to a bug we had due to the average expression introducing new columns.
|
-- to a bug we had due to the average expression introducing new columns.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 450000;
|
|
||||||
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
sum(l_quantity) as sum_qty,
|
sum(l_quantity) as sum_qty,
|
||||||
sum(l_extendedprice) as sum_base_price,
|
sum(l_extendedprice) as sum_base_price,
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
-- MULTI_BASIC_QUERIES
|
-- MULTI_BASIC_QUERIES
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 440000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Execute simple sum, average, and count queries on data recently uploaded to
|
-- Execute simple sum, average, and count queries on data recently uploaded to
|
||||||
-- our partitioned table.
|
-- our partitioned table.
|
||||||
|
|
||||||
|
|
||||||
SELECT count(*) FROM lineitem;
|
SELECT count(*) FROM lineitem;
|
||||||
|
|
||||||
SELECT sum(l_extendedprice) FROM lineitem;
|
SELECT sum(l_extendedprice) FROM lineitem;
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
-- MULTI_COMPLEX_EXPRESSIONS
|
-- MULTI_COMPLEX_EXPRESSIONS
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 420000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Check that we can correctly handle complex expressions and aggregates.
|
-- Check that we can correctly handle complex expressions and aggregates.
|
||||||
|
|
||||||
|
|
||||||
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
|
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
|
||||||
|
|
||||||
SELECT sum(l_quantity) / (10 * avg(l_quantity)) FROM lineitem;
|
SELECT sum(l_quantity) / (10 * avg(l_quantity)) FROM lineitem;
|
||||||
|
@ -217,8 +214,7 @@ FROM
|
||||||
lineitem li JOIN orders o ON li.l_orderkey = o.o_orderkey
|
lineitem li JOIN orders o ON li.l_orderkey = o.o_orderkey
|
||||||
WHERE
|
WHERE
|
||||||
li.l_quantity > 25
|
li.l_quantity > 25
|
||||||
ORDER BY
|
ORDER BY 1, 2, 3
|
||||||
li.l_quantity, li.l_partkey, o.o_custkey
|
|
||||||
LIMIT 10 OFFSET 20;
|
LIMIT 10 OFFSET 20;
|
||||||
|
|
||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 400000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Verify that we can sort count(*) results correctly. We perform this check as
|
-- Verify that we can sort count(*) results correctly. We perform this check as
|
||||||
-- our count() operations execute in two steps: worker nodes report their
|
-- our count() operations execute in two steps: worker nodes report their
|
||||||
-- count() results, and the master node sums these counts up. During this sum(),
|
-- count() results, and the master node sums these counts up. During this sum(),
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
|
||||||
|
|
||||||
-- print major version to make version-specific tests clear
|
-- print major version to make version-specific tests clear
|
||||||
SELECT substring(version(), '\d+\.\d+') AS major_version;
|
SELECT substring(version(), '\d+(?:\.\d+)?') AS major_version;
|
||||||
|
|
||||||
\a\t
|
\a\t
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,8 @@ FROM (SELECT raw_events_second.user_id AS id,
|
||||||
FROM raw_events_first,
|
FROM raw_events_first,
|
||||||
raw_events_second
|
raw_events_second
|
||||||
WHERE raw_events_first.user_id = raw_events_second.user_id) AS foo
|
WHERE raw_events_first.user_id = raw_events_second.user_id) AS foo
|
||||||
GROUP BY id;
|
GROUP BY id
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
|
|
||||||
-- subquery one more level depth
|
-- subquery one more level depth
|
||||||
|
@ -252,7 +253,8 @@ FROM (SELECT SUM(raw_events_second.value_4) AS v4,
|
||||||
FROM raw_events_first,
|
FROM raw_events_first,
|
||||||
raw_events_second
|
raw_events_second
|
||||||
WHERE raw_events_first.user_id = raw_events_second.user_id
|
WHERE raw_events_first.user_id = raw_events_second.user_id
|
||||||
GROUP BY raw_events_second.user_id) AS foo;
|
GROUP BY raw_events_second.user_id) AS foo
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
-- join between subqueries
|
-- join between subqueries
|
||||||
INSERT INTO agg_events
|
INSERT INTO agg_events
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 730000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Display debug messages on limit clause push down.
|
-- Display debug messages on limit clause push down.
|
||||||
|
|
||||||
SET client_min_messages TO DEBUG1;
|
SET client_min_messages TO DEBUG1;
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 720000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Display debug messages on limit clause push down.
|
-- Display debug messages on limit clause push down.
|
||||||
|
|
||||||
SET client_min_messages TO DEBUG1;
|
SET client_min_messages TO DEBUG1;
|
||||||
|
|
|
@ -258,6 +258,7 @@ SELECT * FROM pg_dist_shard_placement ORDER BY shardid, nodename, nodeport;
|
||||||
-- Check that CREATE INDEX statement is propagated
|
-- Check that CREATE INDEX statement is propagated
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SET citus.multi_shard_commit_protocol TO '2pc';
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
SET client_min_messages TO 'ERROR';
|
||||||
CREATE INDEX mx_index_3 ON mx_test_schema_2.mx_table_2 USING hash (col1);
|
CREATE INDEX mx_index_3 ON mx_test_schema_2.mx_table_2 USING hash (col1);
|
||||||
CREATE UNIQUE INDEX mx_index_4 ON mx_test_schema_2.mx_table_2(col1);
|
CREATE UNIQUE INDEX mx_index_4 ON mx_test_schema_2.mx_table_2(col1);
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
-- Tests related to distributed DDL commands on mx cluster
|
-- Tests related to distributed DDL commands on mx cluster
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1600000;
|
|
||||||
|
|
||||||
SELECT * FROM mx_ddl_table ORDER BY key;
|
SELECT * FROM mx_ddl_table ORDER BY key;
|
||||||
|
|
||||||
-- CREATE INDEX
|
-- CREATE INDEX
|
||||||
|
@ -105,12 +103,12 @@ SELECT create_distributed_table('mx_sequence', 'key');
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
SELECT groupid FROM pg_dist_local_group;
|
SELECT groupid FROM pg_dist_local_group;
|
||||||
SELECT * FROM mx_sequence_value_seq;
|
SELECT last_value FROM mx_sequence_value_seq;
|
||||||
|
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
SELECT groupid FROM pg_dist_local_group;
|
SELECT groupid FROM pg_dist_local_group;
|
||||||
SELECT * FROM mx_sequence_value_seq;
|
SELECT last_value FROM mx_sequence_value_seq;
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
|
|
@ -195,17 +195,26 @@ WHERE
|
||||||
value_1 = 1 OR value_1 = 2;
|
value_1 = 1 OR value_1 = 2;
|
||||||
|
|
||||||
-- set operations are supported
|
-- set operations are supported
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
UNION
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
EXCEPT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
INTERSECT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
INTERSECT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
-- to make the tests more interested for aggregation tests, ingest some more data
|
-- to make the tests more interested for aggregation tests, ingest some more data
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 840000;
|
|
||||||
|
|
||||||
|
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test router planner functionality for single shard select queries
|
-- test router planner functionality for single shard select queries
|
||||||
|
@ -202,14 +200,16 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1 or author_id = 3
|
WHERE author_id = 1 or author_id = 3
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
|
|
||||||
-- grouping sets are not supported on multiple shards
|
-- grouping sets are not supported on multiple shards
|
||||||
SELECT
|
SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash_mx
|
FROM articles_hash_mx
|
||||||
WHERE author_id = 1 or author_id = 2
|
WHERE author_id = 1 or author_id = 2
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
|
|
||||||
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
||||||
SELECT * FROM articles_hash_mx, position('om' in 'Thomas') WHERE author_id = 1;
|
SELECT * FROM articles_hash_mx, position('om' in 'Thomas') WHERE author_id = 1;
|
||||||
|
@ -331,14 +331,12 @@ SELECT max(word_count)
|
||||||
|
|
||||||
|
|
||||||
-- router plannable union queries are supported
|
-- router plannable union queries are supported
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
|
|
||||||
UNION
|
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 3);
|
|
||||||
|
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
|
SELECT * FROM articles_hash_mx WHERE author_id = 1
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM articles_hash_mx WHERE author_id = 3)) uu;
|
SELECT * FROM articles_hash_mx WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 1)
|
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 1)
|
||||||
UNION
|
UNION
|
||||||
|
@ -348,9 +346,12 @@ UNION
|
||||||
INTERSECT
|
INTERSECT
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 3);
|
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 3);
|
||||||
|
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3);
|
EXCEPT
|
||||||
|
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY 1;
|
||||||
|
|
||||||
-- union queries are not supported if not router plannable
|
-- union queries are not supported if not router plannable
|
||||||
-- there is an inconsistency on shard pruning between
|
-- there is an inconsistency on shard pruning between
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
-- MULTI_MX_SCHEMA_SUPPORT
|
-- MULTI_MX_SCHEMA_SUPPORT
|
||||||
--
|
--
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1210000;
|
|
||||||
|
|
||||||
-- connect to a worker node and run some queries
|
-- connect to a worker node and run some queries
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -39,8 +37,6 @@ ORDER BY
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -72,8 +68,6 @@ ORDER BY
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
|
|
||||||
-- connect to master
|
-- connect to master
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -49,8 +47,6 @@ LIMIT 20;
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
@ -87,8 +83,6 @@ LIMIT 20;
|
||||||
-- connect to the other worker
|
-- connect to the other worker
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -46,8 +44,6 @@ ORDER BY
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -86,8 +82,6 @@ ORDER BY
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -31,8 +29,6 @@ WHERE
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -56,8 +52,6 @@ WHERE
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -48,8 +46,6 @@ WHERE
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -90,8 +86,6 @@ WHERE
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -38,8 +36,6 @@ ORDER BY
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
||||||
|
@ -66,8 +62,6 @@ ORDER BY
|
||||||
-- connect to the other node
|
-- connect to the other node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
sum(l_extendedprice * (1 - l_discount)) as revenue,
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -27,8 +25,6 @@ WHERE
|
||||||
-- connect to one of the worker nodes
|
-- connect to one of the worker nodes
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -48,8 +44,6 @@ WHERE
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -57,8 +55,6 @@ ORDER BY
|
||||||
-- connect one of the workers
|
-- connect one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -108,8 +104,6 @@ ORDER BY
|
||||||
-- connect to the other worker node
|
-- connect to the other worker node
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
|
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
|
@ -66,8 +64,6 @@ ORDER BY
|
||||||
-- connect to one of the workers
|
-- connect to one of the workers
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
@ -126,8 +122,6 @@ ORDER BY
|
||||||
-- connect to the coordinator
|
-- connect to the coordinator
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_2_port
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
-- use prepared statements internally.
|
-- use prepared statements internally.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 780000;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
|
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
-- prepared statements.
|
-- prepared statements.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 790000;
|
|
||||||
|
|
||||||
|
|
||||||
PREPARE prepared_test_1 AS
|
PREPARE prepared_test_1 AS
|
||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
|
|
|
@ -228,17 +228,26 @@ WHERE
|
||||||
value_1 = 1 OR value_1 = 2;
|
value_1 = 1 OR value_1 = 2;
|
||||||
|
|
||||||
-- set operations are supported
|
-- set operations are supported
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
UNION
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
EXCEPT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 1)
|
SELECT * FROM (
|
||||||
INTERSECT
|
SELECT * FROM reference_table_test WHERE value_1 = 1
|
||||||
(SELECT * FROM reference_table_test WHERE value_1 = 3);
|
INTERSECT
|
||||||
|
SELECT * FROM reference_table_test WHERE value_1 = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY value_1;
|
||||||
|
|
||||||
-- to make the tests more interested for aggregation tests, ingest some more data
|
-- to make the tests more interested for aggregation tests, ingest some more data
|
||||||
INSERT INTO reference_table_test VALUES (1, 1.0, '1', '2016-12-01');
|
INSERT INTO reference_table_test VALUES (1, 1.0, '1', '2016-12-01');
|
||||||
|
|
|
@ -264,14 +264,16 @@ SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1 or author_id = 3
|
WHERE author_id = 1 or author_id = 3
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
|
|
||||||
-- grouping sets are not supported on multiple shards
|
-- grouping sets are not supported on multiple shards
|
||||||
SELECT
|
SELECT
|
||||||
id, substring(title, 2, 1) AS subtitle, count(*)
|
id, substring(title, 2, 1) AS subtitle, count(*)
|
||||||
FROM articles_hash
|
FROM articles_hash
|
||||||
WHERE author_id = 1 or author_id = 2
|
WHERE author_id = 1 or author_id = 2
|
||||||
GROUP BY GROUPING SETS ((id),(subtitle));
|
GROUP BY GROUPING SETS ((id),(subtitle))
|
||||||
|
ORDER BY id, subtitle;
|
||||||
|
|
||||||
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
-- queries which involve functions in FROM clause are supported if it goes to a single worker.
|
||||||
SELECT * FROM articles_hash, position('om' in 'Thomas') WHERE author_id = 1;
|
SELECT * FROM articles_hash, position('om' in 'Thomas') WHERE author_id = 1;
|
||||||
|
@ -396,16 +398,14 @@ SELECT max(word_count)
|
||||||
WHERE author_id = 1
|
WHERE author_id = 1
|
||||||
GROUP BY author_id;
|
GROUP BY author_id;
|
||||||
|
|
||||||
|
|
||||||
-- router plannable union queries are supported
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
|
||||||
UNION
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 3);
|
|
||||||
|
|
||||||
|
-- router plannable union queries are supported
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
UNION
|
UNION
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 3)) uu;
|
SELECT * FROM articles_hash WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 1)
|
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 1)
|
||||||
UNION
|
UNION
|
||||||
|
@ -415,9 +415,12 @@ UNION
|
||||||
INTERSECT
|
INTERSECT
|
||||||
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 3);
|
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 3);
|
||||||
|
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
EXCEPT
|
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1
|
||||||
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3);
|
EXCEPT
|
||||||
|
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3
|
||||||
|
) AS combination
|
||||||
|
ORDER BY 1;
|
||||||
|
|
||||||
-- union queries are not supported if not router plannable
|
-- union queries are not supported if not router plannable
|
||||||
-- there is an inconsistency on shard pruning between
|
-- there is an inconsistency on shard pruning between
|
||||||
|
@ -627,16 +630,24 @@ SELECT a.author_id as first_author, b.word_count as second_word_count
|
||||||
FROM articles_hash a, articles_single_shard_hash b
|
FROM articles_hash a, articles_single_shard_hash b
|
||||||
WHERE a.author_id = 10 and a.author_id = b.author_id and
|
WHERE a.author_id = 10 and a.author_id = b.author_id and
|
||||||
date_ne_timestamp('1954-04-11', '1954-04-11'::timestamp);
|
date_ne_timestamp('1954-04-11', '1954-04-11'::timestamp);
|
||||||
|
|
||||||
-- union/difference /intersection with where false
|
-- union/difference /intersection with where false
|
||||||
-- this query was not originally router plannable, addition of 1=0
|
-- this query was not originally router plannable, addition of 1=0
|
||||||
-- makes it router plannable
|
-- makes it router plannable
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
SELECT * FROM (
|
||||||
UNION
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
|
UNION
|
||||||
|
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
|
SELECT * FROM (
|
||||||
|
SELECT * FROM articles_hash WHERE author_id = 1
|
||||||
|
EXCEPT
|
||||||
|
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
|
||||||
|
) AS combination
|
||||||
|
ORDER BY id;
|
||||||
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
|
||||||
EXCEPT
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
|
|
||||||
|
|
||||||
(SELECT * FROM articles_hash WHERE author_id = 1)
|
(SELECT * FROM articles_hash WHERE author_id = 1)
|
||||||
INTERSECT
|
INTERSECT
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 890000;
|
|
||||||
|
|
||||||
|
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
|
|
||||||
SET citus.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
|
|
||||||
|
|
||||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 900000;
|
|
||||||
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
c_name,
|
c_name,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue