citusdata / citusdata/citus

Bug EXPLAIN and UNION

Open
#7,084 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

Environment: PostgreSQL 14.8 on Debian, Citus 11.0.4, 1-node cluster
Code:
```postgres
CREATE TABLE dist_table(id int primary key);
SELECT create_distributed_table('dist_table','id',shard_count:=2);

-- Ok. Return empty table
SELECT id FROM dist_table
UNION
SELECT id FROM dist_table
;
-- Get plan with error
EXPLAIN
SELECT id FROM dist_table
UNION
SELECT id FROM dist_table
;
```
```
Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
-> Distributed Subplan 34_1
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=4)
Task Count: 2
Tasks Shown: All
-> Task
Node: host=127.0.0.1 port=54331 dbname=citus_test
-> Seq Scan on dist_table_102008 dist_table (cost=0.00..35.50 rows=2550 width=4)
-> Task
Node: host=127.0.0.1 port=54331 dbname=citus_test
-> Seq Scan on dist_table_102009 dist_table (cost=0.00..35.50 rows=2550 width=4)
-> Distributed Subplan 34_2
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=4)
Task Count: 2
Tasks Shown: All
-> Task
Node: host=127.0.0.1 port=54331 dbname=citus_test
-> Seq Scan on dist_table_102008 dist_table (cost=0.00..35.50 rows=2550 width=4)
-> Task
Node: host=127.0.0.1 port=54331 dbname=citus_test
-> Seq Scan on dist_table_102009 dist_table (cost=0.00..35.50 rows=2550 width=4)
Task Count: 1
Tasks Shown: All
-> Task
Error: Could not get remote plan.
```

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.