This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE columnar_test(col_int integer, col_text text, col_text_compressed text COMPRESSION pglz, col_json_b jsonb) USING COLUMNAR; | |
BEGIN; | |
insert into columnar_test SELECT i, i::text, i::text, test_jsonb() FROM generate_series(0,1000000)i; | |
CREATE INDEX i1 ON columnar_test(col_int, col_text, col_text_compressed, col_json_b); | |
set enable_seqscan to off; set columnar.enable_custom_scan to off; | |
EXPLAIN SELECT count(*) FROM columnar_test WHERE col_int = random(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Postgres 14 support - https://github.com/citusdata/citus/pull/5209 | |
1.1) Lots of newly supported features, see here for all the new imporovements: https://www.postgresql.org/docs/14/release-14.html | |
1.2) Major known unsupported PG 14 features on Citus 10.2: | |
- COPY progress report when COPY dist/ref TO ... | |
- Re-index partitioned tables: https://github.com/citusdata/citus/pull/5238 | |
- OUT parameters on procedure pushdown delegation - https://github.com/citusdata/citus/pull/5228 | |
- Extended statistics objects on expressions: https://github.com/citusdata/citus/pull/5224 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- tables and load 1M rows | |
CREATE TABLE table_1 (key int primary key, value int); | |
SELECT create_distributed_table('table_1', 'key'); | |
INSERT INTO table_1 SELECT i, i % 1000 FROM generate_series(0, 1000000)i; | |
-- create index on the table that we'll use as an index | |
CREATE INDEX table_1_value ON table_1 (value); | |
-- create the second table and populate it | |
CREATE TABLE table_2 (key int primary key, value int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- tables and load 1M rows | |
CREATE TABLE table_1 (key int primary key, value int); | |
SELECT create_distributed_table('table_1', 'key'); | |
INSERT INTO table_1 SELECT i, i % 1000 FROM generate_series(0, 1000000)i; | |
-- create index on the table that we'll use as an index | |
CREATE INDEX table_1_value ON table_1 (value); | |
-- create the second table and populate it | |
CREATE TABLE table_2 (key int primary key, value int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- shows the current data size on the TARGET nodes of online rebalance | |
-- update "nodename" in the query with the host address of the target node | |
-- or not have a nodename filter to see all the nodes | |
SELECT * FROM run_command_on_workers($$ | |
SELECT pg_size_pretty(sum(pg_total_relation_size(srrelid))) | |
FROM pg_subscription_rel,pg_stat_subscription | |
WHERE srsubid = subid AND subname = 'citus_shard_move_subscription';$$) WHERE nodename = '10.0.0.21'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE users_table_part(user_id bigint, value_1 int, value_2 int) PARTITION BY RANGE (value_1); | |
CREATE TABLE users_table_part_0 PARTITION OF users_table_part FOR VALUES FROM (0) TO (1); | |
CREATE TABLE users_table_part_1 PARTITION OF users_table_part FOR VALUES FROM (1) TO (2); | |
CREATE TABLE users_table_part_2 PARTITION OF users_table_part FOR VALUES FROM (2) TO (3); | |
CREATE TABLE users_table_part_3 PARTITION OF users_table_part FOR VALUES FROM (3) TO (4); | |
CREATE TABLE users_table_part_4 PARTITION OF users_table_part FOR VALUES FROM (4) TO (5); | |
CREATE TABLE users_table_part_5 PARTITION OF users_table_part FOR VALUES FROM (5) TO (6); | |
CREATE TABLE users_table_part_6 PARTITION OF users_table_part FOR VALUES FROM (6) TO (7); | |
CREATE TABLE users_table_part_7 PARTITION OF users_table_part FOR VALUES FROM (7) TO (8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE test (a int, b text); | |
EXPLAIN (ANALYZE, VERBOSE) | |
SELECT | |
a, | |
case when b = '1' then '-' | |
when b is null then '-' | |
else b end as b, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE on_call_updated | |
( | |
source text, | |
citus_version text, | |
postgres_version text, | |
"Issue description" text, | |
Resolved text, | |
Resolution text, | |
"Relevant Links" text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- regression tests regarding foreign key | |
-- drops cascading into undistributing Citus | |
-- local tables to Postgres local tables | |
CREATE SCHEMA drop_fkey_cascade; | |
SET search_patch TO drop_fkey_cascade; | |
SET client_min_messages TO WARNING; | |
-- show that DROP CONSTRAINT cascades to undistributing citus_local_table | |
CREATE TABLE citus_local_table(l1 int); | |
SELECT create_citus_local_table('citus_local_table'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET citus.replication_model to statement ; | |
set citus.shard_replication_factor TO 2; | |
CREATE SCHEMA sc1; | |
CREATE TABLE sc1.test (a int); | |
SELECT create_distributed_table('sc1.test', 'a'); | |