Support shard pruning based on join with VALUES
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
The following SQL will be pushed to all workers instead of the 2 workers that have the distribution key. This issue is being opened to request that VALUES clauses like this can take advantage of the router executor where applicable.
```SQL
DROP TABLE IF EXISTS test;
CREATE TABLE test (
id TEXT,
app TEXT,
dist_id TEXT,
status INTEGER,
PRIMARY KEY (id, dist_id)
);
SELECT create_distributed_table('test', 'dist_id');
-- theses queries hit every shard :(
EXPLAIN ( ANALYZE, TIMING, BUFFERS )
UPDATE test AS t
SET
status = c.status
FROM (VALUES
('blah', 'GRRRR:blah', 30000),
('1234', 'foo_app:1234', 30000),
('cdef', 'bar_app:cdef', 30000)) AS c(id, dist_id, status)
WHERE c.id = t.id AND t.dist_id = c.dist_id;
```
Contributor guide
Assessment
This issue has not been assessed yet.