|
|
|
@ -14,20 +14,19 @@ SELECT 1 FROM master_add_node('localhost', :master_port, groupId => 0);
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
RESET client_min_messages;
|
|
|
|
|
CREATE TABLE dummy_reference_table(a int unique, b int);
|
|
|
|
|
SELECT create_reference_table('dummy_reference_table');
|
|
|
|
|
create_reference_table
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
CREATE TABLE citus_local_table(a int, b int);
|
|
|
|
|
SELECT create_citus_local_table('citus_local_table');
|
|
|
|
|
create_citus_local_table
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ALTER TABLE citus_local_table ADD CONSTRAINT fkey_to_dummy_1 FOREIGN KEY (a) REFERENCES dummy_reference_table(a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509001, 'citus_local_table_queries', 1509000, 'citus_local_table_queries', 'ALTER TABLE citus_local_table ADD CONSTRAINT fkey_to_dummy_1 FOREIGN KEY (a) REFERENCES dummy_reference_table(a);')
|
|
|
|
|
CREATE TABLE citus_local_table_2(a int, b int);
|
|
|
|
|
SELECT create_citus_local_table('citus_local_table_2');
|
|
|
|
|
create_citus_local_table
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ALTER TABLE citus_local_table_2 ADD CONSTRAINT fkey_to_dummy_2 FOREIGN KEY (a) REFERENCES dummy_reference_table(a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509002, 'citus_local_table_queries', 1509000, 'citus_local_table_queries', 'ALTER TABLE citus_local_table_2 ADD CONSTRAINT fkey_to_dummy_2 FOREIGN KEY (a) REFERENCES dummy_reference_table(a);')
|
|
|
|
|
CREATE TABLE reference_table(a int, b int);
|
|
|
|
|
SELECT create_reference_table('reference_table');
|
|
|
|
|
create_reference_table
|
|
|
|
@ -53,8 +52,9 @@ CREATE FUNCTION clear_and_init_test_tables() RETURNS void AS $$
|
|
|
|
|
BEGIN
|
|
|
|
|
SET client_min_messages to ERROR;
|
|
|
|
|
|
|
|
|
|
TRUNCATE postgres_local_table, citus_local_table, reference_table, distributed_table;
|
|
|
|
|
TRUNCATE postgres_local_table, citus_local_table, reference_table, distributed_table, dummy_reference_table, citus_local_table_2;
|
|
|
|
|
|
|
|
|
|
INSERT INTO dummy_reference_table SELECT i, i FROM generate_series(0, 5) i;
|
|
|
|
|
INSERT INTO citus_local_table SELECT i, i FROM generate_series(0, 5) i;
|
|
|
|
|
INSERT INTO citus_local_table_2 SELECT i, i FROM generate_series(0, 5) i;
|
|
|
|
|
INSERT INTO postgres_local_table SELECT i, i FROM generate_series(0, 5) i;
|
|
|
|
@ -75,14 +75,14 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
|
|
|
|
|
-- join between citus local tables and reference tables would succeed
|
|
|
|
|
SELECT count(*) FROM citus_local_table, reference_table WHERE citus_local_table.a = reference_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.reference_table_1509002 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.reference_table_1509003 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT * FROM citus_local_table, reference_table WHERE citus_local_table.a = reference_table.a ORDER BY 1,2,3,4 FOR UPDATE;
|
|
|
|
|
NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.reference_table_1509002 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a) ORDER BY citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FOR UPDATE OF citus_local_table FOR UPDATE OF reference_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.reference_table_1509003 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a) ORDER BY citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FOR UPDATE OF citus_local_table FOR UPDATE OF reference_table
|
|
|
|
|
a | b | a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0 | 0 | 0
|
|
|
|
@ -97,7 +97,7 @@ NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_
|
|
|
|
|
WITH cte_1 AS
|
|
|
|
|
(SELECT * FROM citus_local_table, reference_table WHERE citus_local_table.a = reference_table.a ORDER BY 1,2,3,4 FOR UPDATE)
|
|
|
|
|
SELECT count(*) FROM cte_1;
|
|
|
|
|
NOTICE: executing the command locally: WITH cte_1 AS (SELECT citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.reference_table_1509002 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a) ORDER BY citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FOR UPDATE OF citus_local_table FOR UPDATE OF reference_table) SELECT count(*) AS count FROM cte_1 cte_1(a, b, a_1, b_1)
|
|
|
|
|
NOTICE: executing the command locally: WITH cte_1 AS (SELECT citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.reference_table_1509003 reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a) ORDER BY citus_local_table.a, citus_local_table.b, reference_table.a, reference_table.b FOR UPDATE OF citus_local_table FOR UPDATE OF reference_table) SELECT count(*) AS count FROM cte_1 cte_1(a, b, a_1, b_1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -112,7 +112,7 @@ cte_distributed_table AS
|
|
|
|
|
(SELECT * FROM distributed_table)
|
|
|
|
|
SELECT count(*) FROM cte_distributed_table, cte_citus_local_table, cte_postgres_local_table
|
|
|
|
|
WHERE cte_citus_local_table.a = 1 AND cte_distributed_table.a = 1;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -126,7 +126,7 @@ SELECT count(*) FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT * FROM (SELECT * FROM citus_local_table) as subquery_inner
|
|
|
|
|
) as subquery_top;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.a, subquery_inner.b FROM (SELECT citus_local_table.a, citus_local_table.b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table) subquery_inner) subquery_top
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.a, subquery_inner.b FROM (SELECT citus_local_table.a, citus_local_table.b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table) subquery_inner) subquery_top
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -143,7 +143,7 @@ SELECT count(*) FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT * FROM (SELECT count(*) FROM citus_local_table, postgres_local_table) as subquery_inner
|
|
|
|
|
) as subquery_top;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.count FROM (SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.postgres_local_table) subquery_inner) subquery_top
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.count FROM (SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.postgres_local_table) subquery_inner) subquery_top
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
@ -154,7 +154,7 @@ SELECT count(*) FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT *, random() FROM (SELECT *, random() FROM citus_local_table, distributed_table) as subquery_inner
|
|
|
|
|
) as subquery_top;
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
36
|
|
|
|
@ -167,7 +167,7 @@ SELECT count(*) FROM
|
|
|
|
|
FROM (
|
|
|
|
|
WITH cte_1 AS (SELECT *, random() FROM citus_local_table, distributed_table) SELECT * FROM cte_1) as subquery_inner
|
|
|
|
|
) as subquery_top;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.a, subquery_inner.b, subquery_inner.a_1 AS a, subquery_inner.b_1 AS b, subquery_inner.random, random() AS random FROM (SELECT cte_1.a, cte_1.b, cte_1.a_1 AS a, cte_1.b_1 AS b, cte_1.random FROM (SELECT intermediate_result.a, intermediate_result.b, intermediate_result.a_1 AS a, intermediate_result.b_1 AS b, intermediate_result.random FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer, a_1 integer, b_1 integer, random double precision)) cte_1(a, b, a_1, b_1, random)) subquery_inner(a, b, a_1, b_1, random)) subquery_top(a, b, a_1, b_1, random, random_1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -182,7 +182,7 @@ SELECT count(*) FROM
|
|
|
|
|
WITH cte_1 AS (SELECT *, random() FROM citus_local_table), cte_2 AS (SELECT * FROM distributed_table) SELECT count(*) FROM cte_1, cte_2
|
|
|
|
|
) as subquery_inner
|
|
|
|
|
) as subquery_top;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b, random() AS random FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b, random() AS random FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT subquery_inner.count, random() AS random FROM (SELECT intermediate_result.count FROM read_intermediate_result('XXX_2'::text, 'binary'::citus_copy_format) intermediate_result(count bigint)) subquery_inner) subquery_top
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -199,42 +199,42 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
PREPARE citus_local_only AS SELECT count(*) FROM citus_local_table;
|
|
|
|
|
-- execute 6 times, local tables without params
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -243,42 +243,42 @@ NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_loca
|
|
|
|
|
-- execute 6 times, with param
|
|
|
|
|
PREPARE citus_local_only_p(int) AS SELECT count(*) FROM citus_local_table WHERE a = $1;
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(1);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
@ -287,14 +287,14 @@ NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_loca
|
|
|
|
|
-- do not evalute the function
|
|
|
|
|
-- show the logs
|
|
|
|
|
EXECUTE citus_local_only_p(random());
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE citus_local_only_p(random());
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) $1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
@ -310,49 +310,49 @@ PREPARE mixed_query(int, int, int) AS
|
|
|
|
|
cte_mixes AS (SELECT * FROM cte_distributed_table, cte_citus_local_table, cte_postgres_local_table)
|
|
|
|
|
SELECT count(*) FROM cte_mixes;
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE mixed_query(1,2,3);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
@ -366,7 +366,7 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
|
|
|
|
|
-- anonymous columns
|
|
|
|
|
WITH a AS (SELECT a, '' FROM citus_local_table GROUP BY a) SELECT a.a FROM a ORDER BY 1 LIMIT 5;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM (SELECT citus_local_table.a, ''::text FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table GROUP BY citus_local_table.a) a(a, "?column?") ORDER BY a LIMIT 5
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM (SELECT citus_local_table.a, ''::text FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table GROUP BY citus_local_table.a) a(a, "?column?") ORDER BY a LIMIT 5
|
|
|
|
|
a
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0
|
|
|
|
@ -377,7 +377,7 @@ NOTICE: executing the command locally: SELECT a FROM (SELECT citus_local_table.
|
|
|
|
|
(5 rows)
|
|
|
|
|
|
|
|
|
|
WITH a AS (SELECT b, '' FROM citus_local_table WHERE a = 1) SELECT * FROM a, a b ORDER BY 1 LIMIT 5;
|
|
|
|
|
NOTICE: executing the command locally: WITH a AS (SELECT citus_local_table.b, ''::text FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) 1)) SELECT a.b, a."?column?", b.b, b."?column?" FROM a a(b, "?column?"), a b(b, "?column?") ORDER BY a.b LIMIT 5
|
|
|
|
|
NOTICE: executing the command locally: WITH a AS (SELECT citus_local_table.b, ''::text FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) 1)) SELECT a.b, a."?column?", b.b, b."?column?" FROM a a(b, "?column?"), a b(b, "?column?") ORDER BY a.b LIMIT 5
|
|
|
|
|
b | ?column? | b | ?column?
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 | | 1 |
|
|
|
|
@ -388,7 +388,7 @@ SELECT * FROM citus_local_table, postgres_local_table
|
|
|
|
|
WHERE citus_local_table.a - postgres_local_table.a = 0
|
|
|
|
|
ORDER BY 1,2,3,4
|
|
|
|
|
LIMIT 10;
|
|
|
|
|
NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_table.b, postgres_local_table.a, postgres_local_table.b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.postgres_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.-) postgres_local_table.a) OPERATOR(pg_catalog.=) 0) ORDER BY citus_local_table.a, citus_local_table.b, postgres_local_table.a, postgres_local_table.b LIMIT 10
|
|
|
|
|
NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_table.b, postgres_local_table.a, postgres_local_table.b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.postgres_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.-) postgres_local_table.a) OPERATOR(pg_catalog.=) 0) ORDER BY citus_local_table.a, citus_local_table.b, postgres_local_table.a, postgres_local_table.b LIMIT 10
|
|
|
|
|
a | b | a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0 | 0 | 0
|
|
|
|
@ -401,7 +401,7 @@ NOTICE: executing the command locally: SELECT citus_local_table.a, citus_local_
|
|
|
|
|
|
|
|
|
|
-- set operations should just work
|
|
|
|
|
SELECT * FROM citus_local_table UNION SELECT * FROM postgres_local_table UNION SELECT * FROM distributed_table ORDER BY 1,2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer) UNION SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_2'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer) UNION SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_3'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer) ORDER BY 1, 2
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -414,7 +414,7 @@ NOTICE: executing the command locally: SELECT intermediate_result.a, intermedia
|
|
|
|
|
(6 rows)
|
|
|
|
|
|
|
|
|
|
(SELECT * FROM citus_local_table ORDER BY 1,2 LIMIT 5) INTERSECT (SELECT i, i FROM generate_series(0, 100) i) ORDER BY 1, 2;
|
|
|
|
|
NOTICE: executing the command locally: (SELECT citus_local_table.a, citus_local_table.b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table ORDER BY citus_local_table.a, citus_local_table.b LIMIT 5) INTERSECT SELECT i.i, i.i FROM generate_series(0, 100) i(i) ORDER BY 1, 2
|
|
|
|
|
NOTICE: executing the command locally: (SELECT citus_local_table.a, citus_local_table.b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table ORDER BY citus_local_table.a, citus_local_table.b LIMIT 5) INTERSECT SELECT i.i, i.i FROM generate_series(0, 100) i(i) ORDER BY 1, 2
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0
|
|
|
|
@ -426,28 +426,28 @@ NOTICE: executing the command locally: (SELECT citus_local_table.a, citus_local
|
|
|
|
|
|
|
|
|
|
-- should just work as recursive planner kicks in
|
|
|
|
|
SELECT count(*) FROM distributed_table WHERE a IN (SELECT a FROM citus_local_table);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM citus_local_table WHERE a IN (SELECT a FROM distributed_table);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM reference_table WHERE a IN (SELECT a FROM citus_local_table);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.reference_table_1509002 reference_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT citus_local_table.a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.reference_table_1509003 reference_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT citus_local_table.a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM citus_local_table WHERE a IN (SELECT a FROM reference_table);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT reference_table.a FROM citus_local_table_queries.reference_table_1509002 reference_table))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT reference_table.a FROM citus_local_table_queries.reference_table_1509003 reference_table))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -458,8 +458,8 @@ SELECT count(*) FROM citus_local_table
|
|
|
|
|
WHERE a IN
|
|
|
|
|
(SELECT a FROM distributed_table WHERE a IN
|
|
|
|
|
(SELECT b FROM citus_local_table WHERE b IN (SELECT b FROM postgres_local_table)));
|
|
|
|
|
NOTICE: executing the command locally: SELECT b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (b OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(b integer)))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_3'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
NOTICE: executing the command locally: SELECT b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (b OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(b integer)))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_3'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -467,7 +467,7 @@ NOTICE: executing the command locally: SELECT count(*) AS count FROM citus_loca
|
|
|
|
|
|
|
|
|
|
-- local outer joins
|
|
|
|
|
SELECT count(*) FROM citus_local_table LEFT JOIN reference_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_1509000 citus_local_table LEFT JOIN citus_local_table_queries.reference_table_1509002 reference_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_1509001 citus_local_table LEFT JOIN citus_local_table_queries.reference_table_1509003 reference_table ON (true))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
36
|
|
|
|
@ -477,7 +477,7 @@ SELECT count(*) FROM reference_table
|
|
|
|
|
LEFT JOIN citus_local_table ON (true)
|
|
|
|
|
LEFT JOIN postgres_local_table ON (true)
|
|
|
|
|
LEFT JOIN reference_table r2 ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (((citus_local_table_queries.reference_table_1509002 reference_table LEFT JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true)) LEFT JOIN citus_local_table_queries.postgres_local_table ON (true)) LEFT JOIN citus_local_table_queries.reference_table_1509002 r2 ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (((citus_local_table_queries.reference_table_1509003 reference_table LEFT JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true)) LEFT JOIN citus_local_table_queries.postgres_local_table ON (true)) LEFT JOIN citus_local_table_queries.reference_table_1509003 r2 ON (true))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1296
|
|
|
|
@ -500,7 +500,7 @@ ORDER BY
|
|
|
|
|
1, 2
|
|
|
|
|
LIMIT
|
|
|
|
|
1;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (b OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (b OPERATOR(pg_catalog.=) 1)
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 | 1
|
|
|
|
@ -519,7 +519,7 @@ ORDER BY
|
|
|
|
|
1 ,2
|
|
|
|
|
LIMIT
|
|
|
|
|
1;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (b OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer))) ORDER BY a, b LIMIT 1
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (b OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer))) ORDER BY a, b LIMIT 1
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 | 1
|
|
|
|
@ -527,7 +527,7 @@ NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queri
|
|
|
|
|
|
|
|
|
|
-- join between citus local tables and distributed tables would fail
|
|
|
|
|
SELECT count(*) FROM citus_local_table, distributed_table;
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
36
|
|
|
|
@ -539,7 +539,7 @@ ERROR: could not run distributed query with FOR UPDATE/SHARE commands
|
|
|
|
|
SELECT count(citus_local_table.b), count(postgres_local_table.a)
|
|
|
|
|
FROM citus_local_table, postgres_local_table
|
|
|
|
|
WHERE citus_local_table.a = postgres_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(citus_local_table.b) AS count, count(postgres_local_table.a) AS count FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table, citus_local_table_queries.postgres_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(citus_local_table.b) AS count, count(postgres_local_table.a) AS count FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table, citus_local_table_queries.postgres_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
count | count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6 | 6
|
|
|
|
@ -547,7 +547,7 @@ NOTICE: executing the command locally: SELECT count(citus_local_table.b) AS cou
|
|
|
|
|
|
|
|
|
|
-- select for update is just OK
|
|
|
|
|
SELECT * FROM citus_local_table ORDER BY 1,2 FOR UPDATE;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table ORDER BY a, b FOR UPDATE OF citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table ORDER BY a, b FOR UPDATE OF citus_local_table
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0
|
|
|
|
@ -570,32 +570,32 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT * from reference_table;
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a, b) SELECT a, b FROM citus_local_table_queries.reference_table_1509002 reference_table
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a, b) SELECT a, b FROM citus_local_table_queries.reference_table_1509003 reference_table
|
|
|
|
|
INSERT INTO reference_table
|
|
|
|
|
SELECT * from citus_local_table;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT * from distributed_table;
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO distributed_table
|
|
|
|
|
SELECT * from citus_local_table;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT * from citus_local_table_2;
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a, b) SELECT a, b FROM citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a, b) SELECT a, b FROM citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT * from citus_local_table_2
|
|
|
|
|
ORDER BY 1,2
|
|
|
|
|
LIMIT 10;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2 ORDER BY a, b LIMIT 10
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2 ORDER BY a, b LIMIT 10
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT * from postgres_local_table;
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO postgres_local_table
|
|
|
|
|
SELECT * from citus_local_table;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
-- INSERT SELECT with local joins are OK
|
|
|
|
|
SELECT clear_and_init_test_tables();
|
|
|
|
|
clear_and_init_test_tables
|
|
|
|
@ -606,16 +606,16 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a, b) SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509002 reference_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a, b) SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509003 reference_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
INSERT INTO reference_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509002 reference_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509003 reference_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO reference_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table, postgres_local_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM citus_local_table_queries.reference_table_1509002 reference_table, (citus_local_table_queries.postgres_local_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM citus_local_table_queries.reference_table_1509003 reference_table, (citus_local_table_queries.postgres_local_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
SELECT clear_and_init_test_tables();
|
|
|
|
|
clear_and_init_test_tables
|
|
|
|
@ -626,15 +626,15 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
INSERT INTO distributed_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509002 reference_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509003 reference_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
INSERT INTO distributed_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table, postgres_local_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM citus_local_table_queries.reference_table_1509002 reference_table, (citus_local_table_queries.postgres_local_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM citus_local_table_queries.reference_table_1509003 reference_table, (citus_local_table_queries.postgres_local_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
INSERT INTO postgres_local_table
|
|
|
|
|
SELECT reference_table.* FROM reference_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509002 reference_table JOIN citus_local_table_queries.citus_local_table_1509000 citus_local_table ON (true))
|
|
|
|
|
NOTICE: executing the command locally: SELECT reference_table.a, reference_table.b FROM (citus_local_table_queries.reference_table_1509003 reference_table JOIN citus_local_table_queries.citus_local_table_1509001 citus_local_table ON (true))
|
|
|
|
|
-- INSERT SELECT that joins reference and distributed tables is also OK
|
|
|
|
|
SELECT clear_and_init_test_tables();
|
|
|
|
|
clear_and_init_test_tables
|
|
|
|
@ -654,17 +654,17 @@ NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT distributed_table.* FROM distributed_table
|
|
|
|
|
JOIN citus_local_table ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT NULL::integer AS "dummy-1" FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
-- .. but when wrapped into a CTE, join works fine
|
|
|
|
|
INSERT INTO citus_local_table
|
|
|
|
|
SELECT distributed_table.* FROM distributed_table
|
|
|
|
|
JOIN (WITH cte AS (SELECT * FROM citus_local_table) SELECT * FROM cte) as foo ON (true);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
NOTICE: executing the copy locally for shard xxxxx
|
|
|
|
|
-- multi row insert is OK
|
|
|
|
|
INSERT INTO citus_local_table VALUES (1, 2), (3, 4);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a, b) VALUES (1,2), (3,4)
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a, b) VALUES (1,2), (3,4)
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
----- DELETE / UPDATE -----
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -679,83 +679,83 @@ SELECT clear_and_init_test_tables();
|
|
|
|
|
DELETE FROM citus_local_table
|
|
|
|
|
USING postgres_local_table
|
|
|
|
|
WHERE citus_local_table.b = postgres_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table USING citus_local_table_queries.postgres_local_table WHERE (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table USING citus_local_table_queries.postgres_local_table WHERE (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
UPDATE citus_local_table
|
|
|
|
|
SET b = 5
|
|
|
|
|
FROM postgres_local_table
|
|
|
|
|
WHERE citus_local_table.a = 3 AND citus_local_table.b = postgres_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 citus_local_table SET b = 5 FROM citus_local_table_queries.postgres_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.=) 3) AND (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b))
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 citus_local_table SET b = 5 FROM citus_local_table_queries.postgres_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.=) 3) AND (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b))
|
|
|
|
|
DELETE FROM postgres_local_table
|
|
|
|
|
USING citus_local_table
|
|
|
|
|
WHERE citus_local_table.b = postgres_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.postgres_local_table USING citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.postgres_local_table USING citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b)
|
|
|
|
|
UPDATE postgres_local_table
|
|
|
|
|
SET b = 5
|
|
|
|
|
FROM citus_local_table
|
|
|
|
|
WHERE citus_local_table.a = 3 AND citus_local_table.b = postgres_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.postgres_local_table SET b = 5 FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.=) 3) AND (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b))
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.postgres_local_table SET b = 5 FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE ((citus_local_table.a OPERATOR(pg_catalog.=) 3) AND (citus_local_table.b OPERATOR(pg_catalog.=) postgres_local_table.b))
|
|
|
|
|
-- no direct joins supported
|
|
|
|
|
UPDATE distributed_table
|
|
|
|
|
SET b = 6
|
|
|
|
|
FROM citus_local_table
|
|
|
|
|
WHERE citus_local_table.a = distributed_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
UPDATE reference_table
|
|
|
|
|
SET b = 6
|
|
|
|
|
FROM citus_local_table
|
|
|
|
|
WHERE citus_local_table.a = reference_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.reference_table_1509002 reference_table SET b = 6 FROM (SELECT citus_local_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_1) citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.reference_table_1509003 reference_table SET b = 6 FROM (SELECT citus_local_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_1) citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
-- should not work, add HINT use CTEs
|
|
|
|
|
UPDATE citus_local_table
|
|
|
|
|
SET b = 6
|
|
|
|
|
FROM distributed_table
|
|
|
|
|
WHERE citus_local_table.a = distributed_table.a;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 citus_local_table SET b = 6 FROM (SELECT distributed_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) distributed_table_1) distributed_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table.a)
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 citus_local_table SET b = 6 FROM (SELECT distributed_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) distributed_table_1) distributed_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table.a)
|
|
|
|
|
-- should work, add HINT use CTEs
|
|
|
|
|
UPDATE citus_local_table
|
|
|
|
|
SET b = 6
|
|
|
|
|
FROM reference_table
|
|
|
|
|
WHERE citus_local_table.a = reference_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509002 reference_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 citus_local_table SET b = 6 FROM (SELECT reference_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) reference_table_1) reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509003 reference_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 citus_local_table SET b = 6 FROM (SELECT reference_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) reference_table_1) reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
-- should not work, add HINT use CTEs
|
|
|
|
|
DELETE FROM distributed_table
|
|
|
|
|
USING citus_local_table
|
|
|
|
|
WHERE citus_local_table.a = distributed_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
-- should not work, add HINT use CTEs
|
|
|
|
|
DELETE FROM citus_local_table
|
|
|
|
|
USING distributed_table
|
|
|
|
|
WHERE citus_local_table.a = distributed_table.a;
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table USING (SELECT distributed_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) distributed_table_1) distributed_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table.a)
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table USING (SELECT distributed_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) distributed_table_1) distributed_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table.a)
|
|
|
|
|
DELETE FROM reference_table
|
|
|
|
|
USING citus_local_table
|
|
|
|
|
WHERE citus_local_table.a = reference_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.reference_table_1509002 reference_table USING (SELECT citus_local_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_1) citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.reference_table_1509003 reference_table USING (SELECT citus_local_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_1) citus_local_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
-- should work, add HINT use CTEs
|
|
|
|
|
DELETE FROM citus_local_table
|
|
|
|
|
USING reference_table
|
|
|
|
|
WHERE citus_local_table.a = reference_table.a;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509002 reference_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table USING (SELECT reference_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) reference_table_1) reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509003 reference_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table USING (SELECT reference_table_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) reference_table_1) reference_table WHERE (citus_local_table.a OPERATOR(pg_catalog.=) reference_table.a)
|
|
|
|
|
-- just works
|
|
|
|
|
DELETE FROM citus_local_table
|
|
|
|
|
WHERE citus_local_table.a IN (SELECT a FROM distributed_table);
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
-- just works
|
|
|
|
|
DELETE FROM citus_local_table
|
|
|
|
|
WHERE citus_local_table.a IN (SELECT a FROM reference_table);
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509002 reference_table
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.reference_table_1509003 reference_table
|
|
|
|
|
NOTICE: executing the command locally: DELETE FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE (a OPERATOR(pg_catalog.=) ANY (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)))
|
|
|
|
|
-- just works
|
|
|
|
|
WITH distributed_table_cte AS (SELECT * FROM distributed_table)
|
|
|
|
|
UPDATE citus_local_table
|
|
|
|
|
SET b = 6
|
|
|
|
|
FROM distributed_table_cte
|
|
|
|
|
WHERE citus_local_table.a = distributed_table_cte.a;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 citus_local_table SET b = 6 FROM (SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer)) distributed_table_cte WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table_cte.a)
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 citus_local_table SET b = 6 FROM (SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer)) distributed_table_cte WHERE (citus_local_table.a OPERATOR(pg_catalog.=) distributed_table_cte.a)
|
|
|
|
|
SET citus.log_local_commands to off;
|
|
|
|
|
-- just works
|
|
|
|
|
WITH reference_table_cte AS (SELECT * FROM reference_table)
|
|
|
|
@ -772,7 +772,7 @@ SELECT count(*)
|
|
|
|
|
FROM citus_local_table
|
|
|
|
|
JOIN reference_table
|
|
|
|
|
USING (a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_1509000 citus_local_table(a, b) JOIN citus_local_table_queries.reference_table_1509002 reference_table(a, b) USING (a))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_1509001 citus_local_table(a, b) JOIN citus_local_table_queries.reference_table_1509003 reference_table(a, b) USING (a))
|
|
|
|
|
-- ok
|
|
|
|
|
SELECT count(*) FROM mat_view_4;
|
|
|
|
|
count
|
|
|
|
@ -795,8 +795,8 @@ JOIN citus_local_table_2 USING (a)
|
|
|
|
|
JOIN distributed_table USING (a);
|
|
|
|
|
-- should fail as view contains direct local dist join
|
|
|
|
|
SELECT count(*) FROM view_2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2 WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2 WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT intermediate_result.count FROM read_intermediate_result('XXX_3'::text, 'binary'::citus_copy_format) intermediate_result(count bigint)) view_2
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -810,7 +810,7 @@ JOIN reference_table
|
|
|
|
|
USING (a);
|
|
|
|
|
-- ok
|
|
|
|
|
SELECT count(*) FROM view_3;
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2(a, b) JOIN citus_local_table_queries.reference_table_1509002 reference_table(a, b) USING (a))) view_3
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT count(*) AS count FROM (citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2(a, b) JOIN citus_local_table_queries.reference_table_1509003 reference_table(a, b) USING (a))) view_3
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1
|
|
|
|
@ -818,8 +818,8 @@ NOTICE: executing the command locally: SELECT count(*) AS count FROM (SELECT co
|
|
|
|
|
|
|
|
|
|
-- view treated as subquery, so should work
|
|
|
|
|
SELECT count(*) FROM view_3, distributed_table;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2 WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM ((SELECT citus_local_table_2_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_2_1) citus_local_table_2 JOIN citus_local_table_queries.reference_table_1509002 reference_table(a, b) USING (a))
|
|
|
|
|
NOTICE: executing the command locally: SELECT a FROM citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2 WHERE true
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS count FROM ((SELECT citus_local_table_2_1.a, NULL::integer AS b FROM (SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) citus_local_table_2_1) citus_local_table_2 JOIN citus_local_table_queries.reference_table_1509003 reference_table(a, b) USING (a))
|
|
|
|
|
count
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
6
|
|
|
|
@ -845,10 +845,10 @@ JOIN (SELECT count(*) as a, count(*) as b
|
|
|
|
|
USING (a)) subquery7132
|
|
|
|
|
USING (b)) subquery7294
|
|
|
|
|
USING (a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.reference_table_1509002 reference_table(a, b) JOIN (SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.citus_local_table_2_1509001 citus_local_table_2(a, b) JOIN (SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.postgres_local_table JOIN (SELECT count(*) AS a, count(*) AS b FROM citus_local_table_queries.reference_table_1509002 table_4677) subquery5108 USING (a))) subquery7132 USING (b))) subquery7294 USING (a))
|
|
|
|
|
NOTICE: executing the command locally: SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.reference_table_1509003 reference_table(a, b) JOIN (SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.citus_local_table_2_1509002 citus_local_table_2(a, b) JOIN (SELECT count(*) AS a, count(*) AS b FROM (citus_local_table_queries.postgres_local_table JOIN (SELECT count(*) AS a, count(*) AS b FROM citus_local_table_queries.reference_table_1509003 table_4677) subquery5108 USING (a))) subquery7132 USING (b))) subquery7294 USING (a))
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0
|
|
|
|
|
1 | 1
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- direct join inside CTE not supported
|
|
|
|
@ -857,7 +857,7 @@ UPDATE citus_local_table lt SET a = mt.a
|
|
|
|
|
FROM distributed_table mt WHERE mt.b = lt.b
|
|
|
|
|
RETURNING lt.b, lt.a
|
|
|
|
|
) SELECT * FROM cte JOIN distributed_table mt ON mt.b = cte.b ORDER BY 1,2,3,4;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 lt SET a = mt.a FROM (SELECT mt_1.a, mt_1.b FROM (SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer)) mt_1) mt WHERE (mt.b OPERATOR(pg_catalog.=) lt.b) RETURNING lt.b, lt.a
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 lt SET a = mt.a FROM (SELECT mt_1.a, mt_1.b FROM (SELECT intermediate_result.a, intermediate_result.b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer, b integer)) mt_1) mt WHERE (mt.b OPERATOR(pg_catalog.=) lt.b) RETURNING lt.b, lt.a
|
|
|
|
|
b | a | a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
0 | 0 | 0 | 0
|
|
|
|
@ -875,14 +875,14 @@ FROM (SELECT avg(distributed_table.b) as avg_b
|
|
|
|
|
FROM distributed_table) as foo
|
|
|
|
|
WHERE
|
|
|
|
|
foo.avg_b = citus_local_table.b;
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509000 citus_local_table SET a = 5 FROM (SELECT intermediate_result.avg_b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(avg_b numeric)) foo WHERE (foo.avg_b OPERATOR(pg_catalog.=) (citus_local_table.b)::numeric)
|
|
|
|
|
NOTICE: executing the command locally: UPDATE citus_local_table_queries.citus_local_table_1509001 citus_local_table SET a = 5 FROM (SELECT intermediate_result.avg_b FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(avg_b numeric)) foo WHERE (foo.avg_b OPERATOR(pg_catalog.=) (citus_local_table.b)::numeric)
|
|
|
|
|
-- should work
|
|
|
|
|
UPDATE distributed_table
|
|
|
|
|
SET b = avg_a
|
|
|
|
|
FROM (SELECT avg(citus_local_table.a) as avg_a FROM citus_local_table) as foo
|
|
|
|
|
WHERE foo.avg_a = distributed_table.a
|
|
|
|
|
RETURNING distributed_table.*;
|
|
|
|
|
NOTICE: executing the command locally: SELECT avg(a) AS avg_a FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT avg(a) AS avg_a FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
(0 rows)
|
|
|
|
@ -918,7 +918,7 @@ LIMIT 10;
|
|
|
|
|
-> Limit
|
|
|
|
|
-> Sort
|
|
|
|
|
Sort Key: distributed_table.*
|
|
|
|
|
-> Seq Scan on distributed_table_1509003 distributed_table
|
|
|
|
|
-> Seq Scan on distributed_table_1509004 distributed_table
|
|
|
|
|
(14 rows)
|
|
|
|
|
|
|
|
|
|
-- show that we do not pull to coordinator
|
|
|
|
@ -932,8 +932,8 @@ SELECT * FROM citus_local_table;
|
|
|
|
|
Tasks Shown: All
|
|
|
|
|
-> Task
|
|
|
|
|
Node: host=localhost port=xxxxx dbname=regression
|
|
|
|
|
-> Insert on citus_local_table_1509000 citus_table_alias
|
|
|
|
|
-> Seq Scan on citus_local_table_1509000 citus_local_table
|
|
|
|
|
-> Insert on citus_local_table_1509001 citus_table_alias
|
|
|
|
|
-> Seq Scan on citus_local_table_1509001 citus_local_table
|
|
|
|
|
(7 rows)
|
|
|
|
|
|
|
|
|
|
EXPLAIN (COSTS FALSE)
|
|
|
|
@ -946,8 +946,8 @@ SELECT reference_table.* FROM reference_table;
|
|
|
|
|
Tasks Shown: All
|
|
|
|
|
-> Task
|
|
|
|
|
Node: host=localhost port=xxxxx dbname=regression
|
|
|
|
|
-> Insert on citus_local_table_1509000 citus_table_alias
|
|
|
|
|
-> Seq Scan on reference_table_1509002 reference_table
|
|
|
|
|
-> Insert on citus_local_table_1509001 citus_table_alias
|
|
|
|
|
-> Seq Scan on reference_table_1509003 reference_table
|
|
|
|
|
(7 rows)
|
|
|
|
|
|
|
|
|
|
EXPLAIN (COSTS FALSE)
|
|
|
|
@ -963,7 +963,7 @@ SELECT reference_table.* FROM reference_table, postgres_local_table;
|
|
|
|
|
-> Task
|
|
|
|
|
Node: host=localhost port=xxxxx dbname=regression
|
|
|
|
|
-> Nested Loop
|
|
|
|
|
-> Seq Scan on reference_table_1509002 reference_table
|
|
|
|
|
-> Seq Scan on reference_table_1509003 reference_table
|
|
|
|
|
-> Materialize
|
|
|
|
|
-> Seq Scan on postgres_local_table
|
|
|
|
|
(11 rows)
|
|
|
|
@ -982,9 +982,9 @@ SELECT reference_table.* FROM reference_table, distributed_table;
|
|
|
|
|
-> Task
|
|
|
|
|
Node: host=localhost port=xxxxx dbname=regression
|
|
|
|
|
-> Nested Loop
|
|
|
|
|
-> Seq Scan on distributed_table_1509003 distributed_table
|
|
|
|
|
-> Seq Scan on distributed_table_1509004 distributed_table
|
|
|
|
|
-> Materialize
|
|
|
|
|
-> Seq Scan on reference_table_1509002 reference_table
|
|
|
|
|
-> Seq Scan on reference_table_1509003 reference_table
|
|
|
|
|
(11 rows)
|
|
|
|
|
|
|
|
|
|
-- truncate tables & add unique constraints to be able to define foreign keys
|
|
|
|
@ -992,21 +992,21 @@ TRUNCATE reference_table, citus_local_table, distributed_table;
|
|
|
|
|
NOTICE: executing the command locally: TRUNCATE TABLE citus_local_table_queries.reference_table_xxxxx CASCADE
|
|
|
|
|
NOTICE: executing the command locally: TRUNCATE TABLE citus_local_table_queries.citus_local_table_xxxxx CASCADE
|
|
|
|
|
ALTER TABLE reference_table ADD CONSTRAINT pkey_ref PRIMARY KEY (a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509002, 'citus_local_table_queries', 'ALTER TABLE reference_table ADD CONSTRAINT pkey_ref PRIMARY KEY (a);')
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509003, 'citus_local_table_queries', 'ALTER TABLE reference_table ADD CONSTRAINT pkey_ref PRIMARY KEY (a);')
|
|
|
|
|
ALTER TABLE citus_local_table ADD CONSTRAINT pkey_c PRIMARY KEY (a);
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509000, 'citus_local_table_queries', 'ALTER TABLE citus_local_table ADD CONSTRAINT pkey_c PRIMARY KEY (a);')
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509001, 'citus_local_table_queries', 'ALTER TABLE citus_local_table ADD CONSTRAINT pkey_c PRIMARY KEY (a);')
|
|
|
|
|
-- define a foreign key chain distributed table -> reference table -> citus local table
|
|
|
|
|
-- to test sequential execution
|
|
|
|
|
ALTER TABLE distributed_table ADD CONSTRAINT fkey_dist_to_ref FOREIGN KEY(a) REFERENCES reference_table(a) ON DELETE RESTRICT;
|
|
|
|
|
ALTER TABLE reference_table ADD CONSTRAINT fkey_ref_to_local FOREIGN KEY(a) REFERENCES citus_local_table(a) ON DELETE RESTRICT;
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509002, 'citus_local_table_queries', 1509000, 'citus_local_table_queries', 'ALTER TABLE reference_table ADD CONSTRAINT fkey_ref_to_local FOREIGN KEY(a) REFERENCES citus_local_table(a) ON DELETE RESTRICT;')
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509003, 'citus_local_table_queries', 1509001, 'citus_local_table_queries', 'ALTER TABLE reference_table ADD CONSTRAINT fkey_ref_to_local FOREIGN KEY(a) REFERENCES citus_local_table(a) ON DELETE RESTRICT;')
|
|
|
|
|
INSERT INTO citus_local_table VALUES (1);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 (a) VALUES (1)
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 (a) VALUES (1)
|
|
|
|
|
INSERT INTO reference_table VALUES (1);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.reference_table_1509002 (a) VALUES (1)
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.reference_table_1509003 (a) VALUES (1)
|
|
|
|
|
BEGIN;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (1) ON CONFLICT (a) DO NOTHING;
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (1) ON CONFLICT(a) DO NOTHING
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (1) ON CONFLICT(a) DO NOTHING
|
|
|
|
|
INSERT INTO distributed_table VALUES (1);
|
|
|
|
|
-- should show sequential as first inserting into citus local table
|
|
|
|
|
-- would force the xact block to use sequential execution
|
|
|
|
@ -1042,7 +1042,7 @@ ROLLBACK;
|
|
|
|
|
ALTER TABLE distributed_table DROP CONSTRAINT fkey_dist_to_ref;
|
|
|
|
|
BEGIN;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (1) ON CONFLICT (a) DO NOTHING;
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (1) ON CONFLICT(a) DO NOTHING
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (1) ON CONFLICT(a) DO NOTHING
|
|
|
|
|
show citus.multi_shard_modify_mode;
|
|
|
|
|
citus.multi_shard_modify_mode
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@ -1052,9 +1052,9 @@ NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.ci
|
|
|
|
|
ROLLBACK;
|
|
|
|
|
-- remove uniqueness constraint and dependent foreign key constraint for next tests
|
|
|
|
|
ALTER TABLE reference_table DROP CONSTRAINT fkey_ref_to_local;
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509002, 'citus_local_table_queries', 1509000, 'citus_local_table_queries', 'ALTER TABLE reference_table DROP CONSTRAINT fkey_ref_to_local;')
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_inter_shard_ddl_command (1509003, 'citus_local_table_queries', 1509001, 'citus_local_table_queries', 'ALTER TABLE reference_table DROP CONSTRAINT fkey_ref_to_local;')
|
|
|
|
|
ALTER TABLE citus_local_table DROP CONSTRAINT pkey_c;
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509000, 'citus_local_table_queries', 'ALTER TABLE citus_local_table DROP CONSTRAINT pkey_c;')
|
|
|
|
|
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1509001, 'citus_local_table_queries', 'ALTER TABLE citus_local_table DROP CONSTRAINT pkey_c;')
|
|
|
|
|
COPY citus_local_table(a) FROM PROGRAM 'seq 1';
|
|
|
|
|
-- should use local execution
|
|
|
|
|
BEGIN;
|
|
|
|
@ -1069,7 +1069,7 @@ COPY citus_local_table TO STDOUT;
|
|
|
|
|
1 \N
|
|
|
|
|
1 \N
|
|
|
|
|
COPY (SELECT * FROM citus_local_table) TO STDOUT;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
1 \N
|
|
|
|
|
1 \N
|
|
|
|
|
1 \N
|
|
|
|
@ -1083,7 +1083,7 @@ BEGIN;
|
|
|
|
|
COMMIT;
|
|
|
|
|
BEGIN;
|
|
|
|
|
COPY (SELECT * FROM citus_local_table) TO STDOUT;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table
|
|
|
|
|
1 \N
|
|
|
|
|
1 \N
|
|
|
|
|
1 \N
|
|
|
|
@ -1095,13 +1095,13 @@ NOTICE: executing the command locally: TRUNCATE TABLE citus_local_table_queries
|
|
|
|
|
NOTICE: executing the command locally: TRUNCATE TABLE citus_local_table_queries.reference_table_xxxxx CASCADE
|
|
|
|
|
BEGIN;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (1), (2);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (1), (2)
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (1), (2)
|
|
|
|
|
SAVEPOINT sp1;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (3), (4);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (3), (4)
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (3), (4)
|
|
|
|
|
ROLLBACK TO SAVEPOINT sp1;
|
|
|
|
|
SELECT * FROM citus_local_table ORDER BY 1,2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table ORDER BY a, b
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table ORDER BY a, b
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 |
|
|
|
|
@ -1109,12 +1109,12 @@ NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queri
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
SAVEPOINT sp2;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (5), (6);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (5), (6)
|
|
|
|
|
INSERT INTO distributed_table VALUES (5), (6);
|
|
|
|
|
INSERT INTO citus_local_table VALUES (3), (4);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (3), (4)
|
|
|
|
|
INSERT INTO distributed_table VALUES (3), (4);
|
|
|
|
|
ROLLBACK TO SAVEPOINT sp2;
|
|
|
|
|
SELECT * FROM citus_local_table ORDER BY 1,2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table ORDER BY a, b
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table ORDER BY a, b
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 |
|
|
|
|
@ -1127,13 +1127,13 @@ NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queri
|
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
|
|
SAVEPOINT sp3;
|
|
|
|
|
INSERT INTO citus_local_table VALUES (7), (8);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509000 AS citus_table_alias (a) VALUES (7), (8)
|
|
|
|
|
INSERT INTO reference_table VALUES (7), (8);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.reference_table_1509002 AS citus_table_alias (a) VALUES (7), (8)
|
|
|
|
|
INSERT INTO citus_local_table VALUES (3), (2);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.citus_local_table_1509001 AS citus_table_alias (a) VALUES (3), (2)
|
|
|
|
|
INSERT INTO reference_table VALUES (3), (2);
|
|
|
|
|
NOTICE: executing the command locally: INSERT INTO citus_local_table_queries.reference_table_1509003 AS citus_table_alias (a) VALUES (3), (2)
|
|
|
|
|
ROLLBACK TO SAVEPOINT sp3;
|
|
|
|
|
SELECT * FROM citus_local_table ORDER BY 1,2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509000 citus_local_table ORDER BY a, b
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.citus_local_table_1509001 citus_local_table ORDER BY a, b
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
1 |
|
|
|
|
@ -1141,7 +1141,7 @@ NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queri
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
SELECT * FROM reference_table ORDER BY 1,2;
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.reference_table_1509002 reference_table ORDER BY a, b
|
|
|
|
|
NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queries.reference_table_1509003 reference_table ORDER BY a, b
|
|
|
|
|
a | b
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
(0 rows)
|
|
|
|
@ -1149,4 +1149,4 @@ NOTICE: executing the command locally: SELECT a, b FROM citus_local_table_queri
|
|
|
|
|
COMMIT;
|
|
|
|
|
-- cleanup at exit
|
|
|
|
|
DROP SCHEMA citus_local_table_queries CASCADE;
|
|
|
|
|
NOTICE: drop cascades to 12 other objects
|
|
|
|
|
NOTICE: drop cascades to 14 other objects
|
|
|
|
|