citusdata / citusdata/citus

Postgres 14 support - Missing features on Citus

Open
#5,264 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

As of #5209, Citus works with Postgres 14.

Postgres 14 brings numerous new features, see Release Notes [here](https://www.postgresql.org/docs/14/release-14.html). Vast majority of these new features are already supported after #5209. In this issue, we wanted to list some of the remaining items that Citus may need to implement to be 100% compatible with all the Postgres 14 features.

- [ ] Multi-column expressions on extended table statistics are not supported on distributed tables (#5947)
```SQL

CREATE TABLE t1 (c1 int, c2 int);
SELECT create_distributed_table('t1', 'c1');

CREATE STATISTICS extstat1_data1 ON MOD(c1, 10),
MOD(c2, 10) FROM t1 ;
ERROR: only simple column references are allowed in CREATE STATISTICS
```

- [ ] pg_stat_progress_copy doesn't show useful information when `COPY dist/ref table TO XXX`
```SQL
table pg_stat_progress_copy;
pid | datid | datname | relid | command | type | bytes_processed | bytes_total | tuples_processed | tuples_excluded
-------+-------+----------+-------+---------+------+-----------------+-------------+------------------+-----------------
48939 | 13236 | postgres | 0 | COPY TO | FILE | 0 | 0 | 0 | 0
```

- [ ] pg_stat_progress_copy doesn't show useful information when `COPY dist/ref table FROM XXX` when COPY is executed locally. PG keeps a single shared memory area to keep track of progress of COPY for each backend. And, with local execution we re-start COPY on each shard. So, the progress report re-starts per shard, and the user cannot see the overall progress.

- [ ] Citus doesn't support creating bloom filters after create_distributed_table (The current error message is sufficient for now)
```SQL
CREATE TABLE t3 (key int, c1 numeric);
CREATE INDEX idx1_data1 ON t3 USING brin
(c1 numeric_bloom_ops (false_positive_rate = 0.05,
n_distinct_per_range = 100)) ;

select create_distributed_table('t3', 'key');

-- fails
CREATE INDEX idx1_data2 ON t3 USING brin
(c1 numeric_bloom_ops (false_positive_rate = 0.05,
n_distinct_per_range = 100)) ;
ERROR: citus currently doesn't support operator class parameters in indexes

```

- [ ] ALTER TABLE .. DETACH PARTITION .. CONCURRENTLY/FINALIZE commands are currently unsupported.
```SQL

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);
SELECT create_distributed_table('users_table_part', 'user_id');

alter table users_table_part detach partition users_table_part_0 concurrently;
ALTER TABLE .. DETACH PARTITION .. CONCURRENTLY commands are currently unsupported.
alter table users_table_part detach partition users_table_part_0 finalize;
ALTER TABLE .. DETACH PARTITION .. FINALIZE commands are currently unsupported.
```

- [ ] REINDEX TABLE queries on distributed partitioned tables are not supported

```SQL
CREATE TABLE part1(c1 NUMERIC, c2 VARCHAR(10)) PARTITION BY RANGE (c1);

SELECT create_distributed_table('part1', 'c1');

CREATE TABLE part1v1 PARTITION OF part1 FOR VALUES FROM (0) TO (100000) ;
CREATE TABLE part1v2 PARTITION OF part1 FOR VALUES FROM (100000) TO (200000) ;

CREATE INDEX idx1_part1 ON part1(c1) ;
REINDEX TABLE part1 ;
ERROR: REINDEX TABLE queries on distributed partitioned tables are not supported

```

- [ ] Recursive CTEs with search clause is not support
```SQL
CREATE TABLE graph0(f INT, t INT, label TEXT);
SELECT create_distributed_table('graph0', 'f');

INSERT INTO graph0 VALUES (1, 2, 'arc 1 -> 2'),
(1, 3, 'arc 1 -> 3'), (2, 3, 'arc 2 -> 3'),
(1, 4, 'arc 1 -> 4'), (4, 5, 'arc 4 -> 5') ;

WITH RECURSIVE search_graph(f, t, label) AS (
SELECT * FROM graph0 g WHERE f = 1
UNION ALL
SELECT g.* FROM graph0 g, search_graph sg WHERE
g.f = sg.t and g.f = 1
) SEARCH DEPTH FIRST BY f, t SET seq
SELECT * FROM search_graph ORDER BY seq ;
ERROR: recursive CTEs are not supported in distributed queries
```

- [ ] Procedure pushdown with OUT parameters are not supported, only performance issue. https://github.com/citusdata/citus/issues/5230

- [ ] REINDEX queries with distributed partitioned tables are not supported
```SQL
CREATE TABLE dist_part_table (a int) PARTITION BY RANGE (a);
CREATE TABLE dist_part_table_1 PARTITION OF dist_part_table FOR VALUES FROM (1) TO (5);
CREATE TABLE dist_part_table_2 PARTITION OF dist_part_table FOR VALUES FROM (5) TO (10);

SELECT create_distributed_table('dist_part_table', 'a');
CREATE INDEX dist_part_idx ON dist_part_table(a);

REINDEX TABLE dist_part_table;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.