Poor join order plan when reference tables involved, leading to unnecessary repartitioning.
Open
enhancement
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
```SQL
CREATE TABLE dist1(id int);
SELECT create_distributed_table('dist1', 'id');
CREATE TABLE dist1(id int);
SELECT create_distributed_table('dist2', 'id');
SELECT table_0.id
FROM ref0 AS table_0
INNER JOIN dist2 AS table_1 USING (id)
INNER JOIN dist1 AS table_2 USING (id)
;
LOG: join order: [ "dist2" ][ reference join "ref0" ][ dual partition join "dist1" ]
```
I'd expected
` [ "dist2" ][local partition join dist_1] [ reference join "ref0" ]` or `
LOG: join order: [ "dist1" ][ reference join "ref0" ][ local partition join "dist2" ]`
Contributor guide
Assessment
This issue has not been assessed yet.