Merge pull request #1377 from citusdata/pg10_prep

Make minor tweaks to prepare for PostgreSQL 10

cr: @anarazel
pull/1418/head
Jason Petersen 2017-05-16 11:44:39 -06:00 committed by GitHub
commit 209e2c48ec
118 changed files with 247 additions and 409 deletions

View File

@ -1320,7 +1320,7 @@ MasterAggregateMutator(Node *originalNode, MasterAggregateWalkerContext *walkerC
else if (IsA(originalNode, Var))
{
uint32 masterTableId = 1; /* one table on the master node */
Var *newColumn = copyObject(originalNode);
Var *newColumn = copyObject((Var *) originalNode);
newColumn->varno = masterTableId;
newColumn->varattno = walkerContext->columnId;
walkerContext->columnId++;

View File

@ -9,6 +9,7 @@
#include "postgres.h"
#include <float.h>
#include <limits.h>
#include "catalog/pg_type.h"

View File

@ -62,7 +62,6 @@ static volatile sig_atomic_t got_SIGHUP = false;
static volatile sig_atomic_t got_SIGTERM = false;
/* initialization forward declarations */
static void TaskTrackerMain(Datum main_arg);
static Size TaskTrackerShmemSize(void);
static void TaskTrackerShmemInit(void);
@ -108,7 +107,8 @@ TaskTrackerRegister(void)
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
worker.bgw_start_time = BgWorkerStart_ConsistentState;
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;
snprintf(worker.bgw_name, BGW_MAXLEN, "task tracker");
@ -117,7 +117,7 @@ TaskTrackerRegister(void)
/* Main entry point for task tracker process. */
static void
void
TaskTrackerMain(Datum main_arg)
{
MemoryContext TaskTrackerContext = NULL;

View File

@ -482,6 +482,7 @@ worker_apply_sequence_command(PG_FUNCTION_ARGS)
/* run the CREATE SEQUENCE command */
ProcessUtility(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL,
NULL, None_Receiver, NULL);
CommandCounterIncrement();
createSequenceStatement = (CreateSeqStmt *) commandNode;

View File

@ -20,6 +20,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/stat.h>
#include <math.h>
#include <unistd.h>
#include "access/hash.h"

View File

@ -112,6 +112,8 @@ extern int MaxRunningTasksPerNode;
/* State shared by the task tracker and task tracker protocol functions */
extern WorkerTasksSharedStateData *WorkerTasksSharedState;
/* Entry point */
extern void TaskTrackerMain(Datum main_arg);
/* Function declarations local to the worker module */
extern WorkerTask * WorkerTasksHashEnter(uint64 jobId, uint32 taskId);

View File

@ -1,7 +1,6 @@
--
-- MULTI_AGG_APPROXIMATE_DISTINCT
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
-- Create HLL extension if present, print false result otherwise
SELECT CASE WHEN COUNT(*) > 0 THEN
'CREATE EXTENSION HLL'

View File

@ -1,7 +1,6 @@
--
-- MULTI_AGG_APPROXIMATE_DISTINCT
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
-- Create HLL extension if present, print false result otherwise
SELECT CASE WHEN COUNT(*) > 0 THEN
'CREATE EXTENSION HLL'

View File

@ -4,7 +4,6 @@
-- 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
-- to a bug we had due to the average expression introducing new columns.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 450000;
SELECT
sum(l_quantity) as sum_qty,
sum(l_extendedprice) as sum_base_price,

View File

@ -1,7 +1,6 @@
--
-- 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
-- our partitioned table.
SELECT count(*) FROM lineitem;

View File

@ -1,7 +1,6 @@
--
-- MULTI_COMPLEX_EXPRESSIONS
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 420000;
-- Check that we can correctly handle complex expressions and aggregates.
SELECT sum(l_quantity) / avg(l_quantity) FROM lineitem;
?column?
@ -435,22 +434,21 @@ FROM
lineitem li JOIN orders o ON li.l_orderkey = o.o_orderkey
WHERE
li.l_quantity > 25
ORDER BY
li.l_quantity, li.l_partkey, o.o_custkey
ORDER BY 1, 2, 3
LIMIT 10 OFFSET 20;
DEBUG: push down of limit count: 30
l_partkey | o_custkey | l_quantity
-----------+-----------+------------
25221 | 656 | 26.00
25373 | 1369 | 26.00
27331 | 571 | 26.00
27699 | 1150 | 26.00
28226 | 913 | 26.00
28635 | 1207 | 26.00
29101 | 1283 | 26.00
31143 | 640 | 26.00
31239 | 685 | 26.00
33646 | 860 | 26.00
655 | 58 | 50.00
669 | 319 | 34.00
699 | 1255 | 50.00
716 | 61 | 45.00
723 | 14 | 36.00
802 | 754 | 50.00
831 | 589 | 32.00
835 | 67 | 33.00
864 | 439 | 32.00
875 | 13 | 43.00
(10 rows)
RESET client_min_messages;

View File

@ -1,7 +1,6 @@
--
-- 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
-- our count() operations execute in two steps: worker nodes report their
-- count() results, and the master node sums these counts up. During this sum(),

View File

@ -3,7 +3,7 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
-- 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
---------------
9.6

View File

@ -3,7 +3,7 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
-- 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
---------------
9.5

View File

@ -292,14 +292,15 @@ FROM (SELECT raw_events_second.user_id AS id,
FROM raw_events_first,
raw_events_second
WHERE raw_events_first.user_id = raw_events_second.user_id) AS foo
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
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_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_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
GROUP BY id
ORDER 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 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 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
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
-- subquery one more level depth
INSERT INTO agg_events
@ -315,11 +316,12 @@ FROM (SELECT SUM(raw_events_second.value_4) AS v4,
FROM raw_events_first,
raw_events_second
WHERE raw_events_first.user_id = raw_events_second.user_id
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))
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_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_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))
GROUP BY raw_events_second.user_id) AS foo
ORDER BY id;
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)) 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)) 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
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.

View File

@ -1,7 +1,6 @@
--
-- MULTI_LIMIT_CLAUSE
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 730000;
-- Display debug messages on limit clause push down.
SET client_min_messages TO DEBUG1;
-- Check that we can correctly handle the Limit clause in distributed queries.

View File

@ -1,7 +1,6 @@
--
-- MULTI_LIMIT_CLAUSE_APPROXIMATE
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 720000;
-- Display debug messages on limit clause push down.
SET client_min_messages TO DEBUG1;
-- We first look at results with limit optimization disabled. This first query

View File

@ -661,8 +661,8 @@ SELECT * FROM pg_dist_shard_placement ORDER BY shardid, nodename, nodeport;
-- Check that CREATE INDEX statement is propagated
\c - - - :master_port
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);
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);
\c - - - :worker_1_port
\d mx_test_schema_2.mx_table_2

View File

@ -1,5 +1,4 @@
-- 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;
key | value
-----+-------
@ -207,10 +206,10 @@ SELECT groupid FROM pg_dist_local_group;
12
(1 row)
SELECT * 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
-----------------------+------------------+------------------+--------------+------------------+------------------+-------------+---------+-----------+-----------
mx_sequence_value_seq | 3377699720527873 | 3377699720527873 | 1 | 3659174697238529 | 3377699720527873 | 1 | 0 | f | f
SELECT last_value FROM mx_sequence_value_seq;
last_value
------------------
3377699720527873
(1 row)
\c - - - :worker_2_port
@ -220,10 +219,10 @@ SELECT groupid FROM pg_dist_local_group;
14
(1 row)
SELECT * 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
-----------------------+------------------+------------------+--------------+------------------+------------------+-------------+---------+-----------+-----------
mx_sequence_value_seq | 3940649673949185 | 3940649673949185 | 1 | 4222124650659841 | 3940649673949185 | 1 | 0 | f | f
SELECT last_value FROM mx_sequence_value_seq;
last_value
------------------
3940649673949185
(1 row)
\c - - - :master_port

View File

@ -312,26 +312,35 @@ WHERE
(2 rows)
-- set operations are supported
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
UNION
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+--------------------------
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
(2 rows)
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
EXCEPT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+--------------------------
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
(1 row)
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
INTERSECT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+---------
(0 rows)

View File

@ -1,4 +1,3 @@
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 840000;
-- ===================================================================
-- test router planner functionality for single shard select queries
-- ===================================================================
@ -355,7 +354,8 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash_mx
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: Plan is router executable
id | subtitle | count
@ -385,7 +385,8 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash_mx
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
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.
@ -708,43 +709,26 @@ DEBUG: Plan is router executable
-- 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 articles_hash_mx WHERE author_id = 1)
SELECT * FROM articles_hash_mx WHERE author_id = 1
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: 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
3 | 3 | asternal | 10480
11 | 1 | alamo | 1347
13 | 3 | aseyev | 2255
21 | 1 | arcading | 5890
23 | 3 | abhorring | 6799
31 | 1 | athwartships | 7271
33 | 3 | autochrome | 8180
41 | 1 | aznavour | 11814
43 | 3 | affixal | 12723
(10 rows)
(SELECT LEFT(title, 1) FROM articles_hash_mx WHERE author_id = 1)
@ -767,17 +751,20 @@ DEBUG: Plan is router executable
a
(1 row)
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1)
SELECT * FROM (
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1
EXCEPT
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3);
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3
) AS combination
ORDER BY 1;
DEBUG: Creating router plan
DEBUG: Plan is router executable
left
------
al
ar
at
az
ar
al
(4 rows)
-- union queries are not supported if not router plannable

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_SCHEMA_SUPPORT
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1210000;
-- connect to a worker node and run some queries
\c - - - :worker_1_port
-- test very basic queries

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY1
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem and orders tables as large
@ -38,7 +37,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #1 from the TPC-H decision support benchmark
@ -73,7 +71,6 @@ ORDER BY
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #1 from the TPC-H decision support benchmark

View File

@ -4,7 +4,6 @@
-- 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
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
-- connect to master
\c - - - :master_port
SELECT
@ -65,7 +64,6 @@ LIMIT 20;
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
SELECT
c_custkey,
c_name,
@ -124,7 +122,6 @@ LIMIT 20;
-- connect to the other worker
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
SELECT
c_custkey,
c_name,

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY12
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem and orders tables as large
@ -43,7 +42,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #12 from the TPC-H decision support benchmark
@ -83,7 +81,6 @@ ORDER BY
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #12 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY14
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem and orders tables as large
@ -27,7 +26,6 @@ WHERE
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #14 from the TPC-H decision support benchmark
@ -51,7 +49,6 @@ WHERE
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #14 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY19
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem and orders tables as large
@ -44,7 +43,6 @@ WHERE
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
@ -85,7 +83,6 @@ WHERE
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #19 from the TPC-H decision support benchmark. Note that we modified

View File

@ -4,7 +4,6 @@
-- 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
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
-- connect to the coordinator
\c - - - :master_port
SELECT
@ -51,7 +50,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
SELECT
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,
@ -96,7 +94,6 @@ ORDER BY
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
SELECT
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY6
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem and orders tables as large
@ -23,7 +22,6 @@ WHERE
-- connect to one of the worker nodes
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #6 from the TPC-H decision support benchmark
@ -43,7 +41,6 @@ WHERE
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #6 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY7
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem AND orders tables as large
@ -53,7 +52,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- Change configuration to treat lineitem AND orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H decision support benchmark
@ -103,7 +101,6 @@ ORDER BY
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- Change configuration to treat lineitem AND orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_MX_TPCH_QUERY7_NESTED
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- connect to the coordinator
\c - - - :master_port
-- Change configuration to treat lineitem AND orders tables AS large
@ -62,7 +61,6 @@ ORDER BY
-- connect to one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- Change configuration to treat lineitem AND orders tables AS large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
@ -121,7 +119,6 @@ ORDER BY
-- connect to the coordinator
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- Change configuration to treat lineitem AND orders tables AS large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H benchmark; modified to include sub-selects

View File

@ -4,7 +4,6 @@
-- Many of the queries are taken from other regression test files
-- and converted into both plain SQL and PL/pgsql functions, which
-- use prepared statements internally.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 780000;
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
DECLARE
BEGIN

View File

@ -4,7 +4,6 @@
-- Tests covering PREPARE statements. Many of the queries are
-- taken from other regression test files and converted into
-- prepared statements.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 790000;
PREPARE prepared_test_1 AS
SELECT
count(*)

View File

@ -360,26 +360,35 @@ WHERE
(2 rows)
-- set operations are supported
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
UNION
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+--------------------------
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
3 | 3 | 3 | Sat Dec 03 00:00:00 2016
(2 rows)
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
EXCEPT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+--------------------------
1 | 1 | 1 | Thu Dec 01 00:00:00 2016
(1 row)
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
INTERSECT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
SELECT * FROM reference_table_test WHERE value_1 = 3
) AS combination
ORDER BY value_1;
value_1 | value_2 | value_3 | value_4
---------+---------+---------+---------
(0 rows)

View File

@ -453,7 +453,8 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash
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: Plan is router executable
id | subtitle | count
@ -483,7 +484,8 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash
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
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.
@ -820,45 +822,27 @@ DEBUG: Plan is router executable
11814
(1 row)
-- 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 articles_hash WHERE author_id = 1)
SELECT * FROM articles_hash WHERE author_id = 1
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: 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
3 | 3 | asternal | 10480
11 | 1 | alamo | 1347
13 | 3 | aseyev | 2255
21 | 1 | arcading | 5890
23 | 3 | abhorring | 6799
31 | 1 | athwartships | 7271
33 | 3 | autochrome | 8180
41 | 1 | aznavour | 11814
43 | 3 | affixal | 12723
(10 rows)
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 1)
@ -881,17 +865,20 @@ DEBUG: Plan is router executable
a
(1 row)
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1
EXCEPT
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3);
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3
) AS combination
ORDER BY 1;
DEBUG: Creating router plan
DEBUG: Plan is router executable
left
------
al
ar
at
az
ar
al
(4 rows)
-- union queries are not supported if not router plannable
@ -1379,31 +1366,37 @@ DEBUG: Plan is router executable
-- union/difference /intersection with where false
-- this query was not originally router plannable, addition of 1=0
-- makes it router plannable
(SELECT * FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
SELECT * FROM articles_hash WHERE author_id = 1
UNION
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
) AS combination
ORDER BY id;
DEBUG: Creating router plan
DEBUG: Plan is router executable
id | author_id | title | word_count
----+-----------+--------------+------------
11 | 1 | alamo | 1347
41 | 1 | aznavour | 11814
1 | 1 | arsenous | 9572
11 | 1 | alamo | 1347
21 | 1 | arcading | 5890
31 | 1 | athwartships | 7271
41 | 1 | aznavour | 11814
(5 rows)
(SELECT * FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
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 = 2 and 1=0
) AS combination
ORDER BY id;
DEBUG: Creating router plan
DEBUG: Plan is router executable
id | author_id | title | word_count
----+-----------+--------------+------------
1 | 1 | arsenous | 9572
11 | 1 | alamo | 1347
21 | 1 | arcading | 5890
31 | 1 | athwartships | 7271
11 | 1 | alamo | 1347
41 | 1 | aznavour | 11814
(5 rows)

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY1
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 890000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #1 from the TPC-H decision support benchmark

View File

@ -4,7 +4,6 @@
-- 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
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 900000;
SELECT
c_custkey,
c_name,

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY12
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 910000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #12 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY14
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 920000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #14 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY19
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 930000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #19 from the TPC-H decision support benchmark. Note that we modified

View File

@ -4,7 +4,6 @@
-- 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
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 940000;
SELECT
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY6
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 950000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #6 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY7
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 970000;
-- Change configuration to treat lineitem AND orders tables as large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H decision support benchmark

View File

@ -1,7 +1,6 @@
--
-- MULTI_TPCH_QUERY7_NESTED
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 960000;
-- Change configuration to treat lineitem AND orders tables AS large
SET citus.large_table_shard_count TO 2;
-- Query #7 from the TPC-H benchmark; modified to include sub-selects

View File

@ -5,7 +5,6 @@
-- 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
-- grouping.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1040000;
SELECT l_quantity FROM lineitem ORDER BY l_shipdate, l_quantity LIMIT 20;
l_quantity
------------

View File

@ -1,7 +1,6 @@
--
-- TASK_TRACKER_ASSIGN_TASK
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1050000;
\set JobId 401010
\set SimpleTaskId 101101
\set RecoverableTaskId 801102

View File

@ -1,7 +1,6 @@
--
-- TASK_TRACKER_PARTITION_TASK
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1080000;
\set JobId 401010
\set PartitionTaskId 801106
\set PartitionColumn l_orderkey

View File

@ -1,7 +1,6 @@
--
-- WORKER_BINARY_DATA_PARTITION
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1090000;
\set JobId 201010
\set TaskId 101105
\set Partition_Column textcolumn

View File

@ -1,7 +1,6 @@
--
-- WORKER_HASH_PARTITION
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1130000;
\set JobId 201010
\set TaskId 101103
\set Partition_Column l_orderkey

View File

@ -1,7 +1,6 @@
--
-- WORKER_HASH_PARTITION_COMPLEX
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1120000;
\set JobId 201010
\set TaskId 101104
\set Partition_Column l_partkey

View File

@ -1,7 +1,6 @@
--
-- WORKER_MERGE_HASH_FILES
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1140000;
\set JobId 201010
\set TaskId 101103
\set Task_Table_Name public.task_101103

View File

@ -1,7 +1,6 @@
--
-- WORKER_MERGE_RANGE_FILES
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1150000;
\set JobId 201010
\set TaskId 101101
\set Task_Table_Name public.task_101101

View File

@ -1,7 +1,6 @@
--
-- WORKER_NULL_DATA_PARTITION
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1180000;
\set JobId 201010
\set Range_TaskId 101106
\set Partition_Column s_nationkey

View File

@ -1,7 +1,6 @@
--
-- WORKER_RANGE_PARTITION
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1160000;
\set JobId 201010
\set TaskId 101101
\set Partition_Column l_orderkey

View File

@ -1,7 +1,6 @@
--
-- WORKER_RANGE_PARTITION_COMPLEX
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1170000;
\set JobId 201010
\set TaskId 101102
\set Partition_Column l_partkey

View File

@ -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 TABLE lineitem_range (
l_orderkey bigint not null,

View File

@ -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
SELECT sum(l_suppkey) FROM lineitem;
SELECT sum(l_suppkey) / 2 FROM lineitem;

View File

@ -1,5 +1,5 @@
--
-- multi insert select behavioral analytics
-- multi behavioral analytics
-- this file is intended to create the table requires for the tests
--

View File

@ -2,8 +2,6 @@
-- 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 '|';
SET search_path TO citus_mx_test_schema;

View File

@ -7,7 +7,7 @@ ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
-- print major version to make version-specific tests clear
SHOW server_version \gset
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
-- Create tables for subquery tests
@ -1060,7 +1060,9 @@ FROM
subquery_1.user_id,
hasdone) AS subquery_top
GROUP BY
hasdone;
hasdone
ORDER BY
event_average;
-- Union, left join and having subquery pushdown
SELECT

View File

@ -30,8 +30,8 @@ test: multi_create_table_constraints
test: multi_master_protocol
test: multi_load_data
test: multi_insert_select_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_create_table
test: multi_behavioral_analytics_basics multi_behavioral_analytics_single_shard_queries multi_insert_select_non_pushable_queries
test: multi_insert_select
# ----------

View File

@ -1,7 +1,6 @@
--
-- 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 TABLE lineitem_range (
l_orderkey bigint not null,

View File

@ -1,7 +1,6 @@
--
-- 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
SELECT sum(l_suppkey) FROM lineitem;
sum

View File

@ -1,5 +1,5 @@
--
-- multi insert select behavioral analytics
-- multi behavioral analytics
-- this file is intended to create the table requires for the tests
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1400000;

View File

@ -1,7 +1,6 @@
--
-- 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 '|';
SET search_path TO citus_mx_test_schema;
\COPY nation_hash FROM '@abs_srcdir@/data/nation.data' with delimiter '|';

View File

@ -4,7 +4,7 @@
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
-- print major version to make version-specific tests clear
SHOW server_version \gset
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
major_version
---------------
9.6
@ -1021,11 +1021,13 @@ FROM
subquery_1.user_id,
hasdone) AS subquery_top
GROUP BY
hasdone;
hasdone
ORDER BY
event_average;
event_average | hasdone
--------------------+---------------------
4.0000000000000000 | Has not done paying
2.5000000000000000 | Has done paying
4.0000000000000000 | Has not done paying
(2 rows)
-- Union, left join and having subquery pushdown

View File

@ -4,7 +4,7 @@
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 270000;
-- print major version to make version-specific tests clear
SHOW server_version \gset
SELECT substring(:'server_version', '\d+\.\d+') AS major_version;
SELECT substring(:'server_version', '\d+(?:\.\d+)?') AS major_version;
major_version
---------------
9.5
@ -1021,11 +1021,13 @@ FROM
subquery_1.user_id,
hasdone) AS subquery_top
GROUP BY
hasdone;
hasdone
ORDER BY
event_average;
event_average | hasdone
--------------------+---------------------
4.0000000000000000 | Has not done paying
2.5000000000000000 | Has done paying
4.0000000000000000 | Has not done paying
(2 rows)
-- Union, left join and having subquery pushdown

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 340000;
-- Create HLL extension if present, print false result otherwise
SELECT CASE WHEN COUNT(*) > 0 THEN
'CREATE EXTENSION HLL'

View File

@ -6,9 +6,6 @@
-- to a bug we had due to the average expression introducing new columns.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 450000;
SELECT
sum(l_quantity) as sum_qty,
sum(l_extendedprice) as sum_base_price,

View File

@ -2,13 +2,10 @@
-- 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
-- our partitioned table.
SELECT count(*) FROM lineitem;
SELECT sum(l_extendedprice) FROM lineitem;

View File

@ -2,12 +2,9 @@
-- MULTI_COMPLEX_EXPRESSIONS
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 420000;
-- Check that we can correctly handle complex expressions and aggregates.
SELECT sum(l_quantity) / 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
WHERE
li.l_quantity > 25
ORDER BY
li.l_quantity, li.l_partkey, o.o_custkey
ORDER BY 1, 2, 3
LIMIT 10 OFFSET 20;
RESET client_min_messages;

View File

@ -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
-- our count() operations execute in two steps: worker nodes report their
-- count() results, and the master node sums these counts up. During this sum(),

View File

@ -5,7 +5,7 @@
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 570000;
-- 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

View File

@ -235,7 +235,8 @@ FROM (SELECT raw_events_second.user_id AS id,
FROM raw_events_first,
raw_events_second
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
@ -252,7 +253,8 @@ FROM (SELECT SUM(raw_events_second.value_4) AS v4,
FROM raw_events_first,
raw_events_second
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
INSERT INTO agg_events

View File

@ -3,9 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 730000;
-- Display debug messages on limit clause push down.
SET client_min_messages TO DEBUG1;

View File

@ -3,9 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 720000;
-- Display debug messages on limit clause push down.
SET client_min_messages TO DEBUG1;

View File

@ -258,6 +258,7 @@ SELECT * FROM pg_dist_shard_placement ORDER BY shardid, nodename, nodeport;
-- Check that CREATE INDEX statement is propagated
\c - - - :master_port
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 UNIQUE INDEX mx_index_4 ON mx_test_schema_2.mx_table_2(col1);
\c - - - :worker_1_port

View File

@ -1,7 +1,5 @@
-- 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;
-- CREATE INDEX
@ -105,12 +103,12 @@ SELECT create_distributed_table('mx_sequence', 'key');
\c - - - :worker_1_port
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
SELECT groupid FROM pg_dist_local_group;
SELECT * FROM mx_sequence_value_seq;
SELECT last_value FROM mx_sequence_value_seq;
\c - - - :master_port

View File

@ -195,17 +195,26 @@ WHERE
value_1 = 1 OR value_1 = 2;
-- set operations are supported
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
UNION
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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 (
SELECT * FROM reference_table_test WHERE value_1 = 1
EXCEPT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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 (
SELECT * FROM reference_table_test WHERE value_1 = 1
INTERSECT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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
\c - - - :master_port

View File

@ -1,6 +1,4 @@
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 840000;
-- ===================================================================
-- test router planner functionality for single shard select queries
@ -202,14 +200,16 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash_mx
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
SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash_mx
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.
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
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
UNION
(SELECT * FROM articles_hash_mx WHERE author_id = 3);
SELECT * FROM (
(SELECT * FROM articles_hash_mx WHERE author_id = 1)
SELECT * FROM articles_hash_mx WHERE author_id = 1
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)
UNION
@ -348,9 +346,12 @@ UNION
INTERSECT
(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 (
SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 1
EXCEPT
(SELECT LEFT(title, 2) FROM articles_hash_mx WHERE author_id = 3);
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
-- there is an inconsistency on shard pruning between

View File

@ -2,8 +2,6 @@
-- MULTI_MX_SCHEMA_SUPPORT
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1210000;
-- connect to a worker node and run some queries
\c - - - :worker_1_port

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- connect to the coordinator
\c - - - :master_port
@ -39,8 +37,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
@ -72,8 +68,6 @@ ORDER BY
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1310000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -7,8 +7,6 @@
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
-- connect to master
\c - - - :master_port
@ -49,8 +47,6 @@ LIMIT 20;
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
SELECT
c_custkey,
c_name,
@ -87,8 +83,6 @@ LIMIT 20;
-- connect to the other worker
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1300000;
SELECT
c_custkey,
c_name,

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- connect to the coordinator
\c - - - :master_port
@ -46,8 +44,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
@ -86,8 +82,6 @@ ORDER BY
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1290000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- connect to the coordinator
\c - - - :master_port
@ -31,8 +29,6 @@ WHERE
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
@ -56,8 +52,6 @@ WHERE
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1280000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- connect to the coordinator
\c - - - :master_port
@ -48,8 +46,6 @@ WHERE
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
@ -90,8 +86,6 @@ WHERE
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1270000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -7,8 +7,6 @@
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
-- connect to the coordinator
\c - - - :master_port
@ -38,8 +36,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
SELECT
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,
@ -66,8 +62,6 @@ ORDER BY
-- connect to the other node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1260000;
SELECT
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- connect to the coordinator
\c - - - :master_port
@ -27,8 +25,6 @@ WHERE
-- connect to one of the worker nodes
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;
@ -48,8 +44,6 @@ WHERE
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1250000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- connect to the coordinator
\c - - - :master_port
@ -57,8 +55,6 @@ ORDER BY
-- connect one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- Change configuration to treat lineitem AND orders tables as large
SET citus.large_table_shard_count TO 2;
@ -108,8 +104,6 @@ ORDER BY
-- connect to the other worker node
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1230000;
-- Change configuration to treat lineitem AND orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -3,8 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- connect to the coordinator
\c - - - :master_port
@ -66,8 +64,6 @@ ORDER BY
-- connect to one of the workers
\c - - - :worker_1_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- Change configuration to treat lineitem AND orders tables AS large
SET citus.large_table_shard_count TO 2;
@ -126,8 +122,6 @@ ORDER BY
-- connect to the coordinator
\c - - - :worker_2_port
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 1240000;
-- Change configuration to treat lineitem AND orders tables AS large
SET citus.large_table_shard_count TO 2;

View File

@ -7,9 +7,6 @@
-- use prepared statements internally.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 780000;
CREATE FUNCTION plpgsql_test_1() RETURNS TABLE(count bigint) AS $$
DECLARE
BEGIN

View File

@ -7,9 +7,6 @@
-- prepared statements.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 790000;
PREPARE prepared_test_1 AS
SELECT
count(*)

View File

@ -228,17 +228,26 @@ WHERE
value_1 = 1 OR value_1 = 2;
-- set operations are supported
(SELECT * FROM reference_table_test WHERE value_1 = 1)
SELECT * FROM (
SELECT * FROM reference_table_test WHERE value_1 = 1
UNION
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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 (
SELECT * FROM reference_table_test WHERE value_1 = 1
EXCEPT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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 (
SELECT * FROM reference_table_test WHERE value_1 = 1
INTERSECT
(SELECT * FROM reference_table_test WHERE value_1 = 3);
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
INSERT INTO reference_table_test VALUES (1, 1.0, '1', '2016-12-01');

View File

@ -264,14 +264,16 @@ SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash
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
SELECT
id, substring(title, 2, 1) AS subtitle, count(*)
FROM articles_hash
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.
SELECT * FROM articles_hash, position('om' in 'Thomas') WHERE author_id = 1;
@ -398,14 +400,12 @@ SELECT max(word_count)
-- router plannable union queries are supported
(SELECT * FROM articles_hash WHERE author_id = 1)
UNION
(SELECT * FROM articles_hash WHERE author_id = 3);
SELECT * FROM (
(SELECT * FROM articles_hash WHERE author_id = 1)
SELECT * FROM articles_hash WHERE author_id = 1
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)
UNION
@ -415,9 +415,12 @@ UNION
INTERSECT
(SELECT LEFT(title, 1) FROM articles_hash WHERE author_id = 3);
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 1
EXCEPT
(SELECT LEFT(title, 2) FROM articles_hash WHERE author_id = 3);
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
-- 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
WHERE a.author_id = 10 and a.author_id = b.author_id and
date_ne_timestamp('1954-04-11', '1954-04-11'::timestamp);
-- union/difference /intersection with where false
-- this query was not originally router plannable, addition of 1=0
-- makes it router plannable
(SELECT * FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
SELECT * FROM articles_hash WHERE author_id = 1
UNION
(SELECT * FROM articles_hash WHERE author_id = 2 and 1=0);
SELECT * FROM articles_hash WHERE author_id = 2 and 1=0
) AS combination
ORDER BY id;
(SELECT * FROM articles_hash WHERE author_id = 1)
SELECT * FROM (
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 = 2 and 1=0
) AS combination
ORDER BY id;
(SELECT * FROM articles_hash WHERE author_id = 1)
INTERSECT

View File

@ -3,9 +3,6 @@
--
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 890000;
-- Change configuration to treat lineitem and orders tables as large
SET citus.large_table_shard_count TO 2;

View File

@ -7,9 +7,6 @@
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 900000;
SELECT
c_custkey,
c_name,

Some files were not shown because too many files have changed in this diff Show More