Rebalancing by disk size takes long to plan no moves
Open
performance
schema-based-sharding
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
```
select get_rebalance_table_shards_plan(rebalance_strategy:='by_disk_size');
get_rebalance_table_shards_plan
---------------------------------
(0 rows)
Time: 11154.771 ms (00:11.155)
```
All of this time seems to be spent in getting the sizes of shard groups. It's doing one query per shard group to get the size of the complete shard group. We could optimize this by fetching sizes of all shards/shard groups from a node in one go. Probably by using `citus_shard_sizes()`.
Contributor guide
Assessment
This issue has not been assessed yet.