v.21.4Improvements

Add optimize_skip_unused_shards_limit Setting to Limit Sharding Key Values

Add setting optimize_skip_unused_shards_limit to limit the number of sharding key values for optimize_skip_unused_shards. #21512 (Azat Khuzhin).
Introduces the setting optimize_skip_unused_shards_limit to control the maximum number of sharding key values considered when using optimize_skip_unused_shards.

Why it matters

This feature addresses the problem of excessive consideration of sharding key values during query optimization, which can impact performance. By limiting the number of sharding key values, it improves efficiency and optimizes query execution on sharded tables.

How to use it

Users can enable this feature by setting the parameter optimize_skip_unused_shards_limit to a desired integer value representing the maximum number of sharding key values to evaluate. This works in conjunction with the optimize_skip_unused_shards setting.