v.19.1New Features

Pruning of Unused Shards If SELECT Query Filters by Sharding Key (setting Optimize_skip_unused_shards)

Pruning of unused shards if SELECT query filters by sharding key (setting optimize_skip_unused_shards). #3851 (Gleb Kanterov, Ivan)
Introduces pruning of unused shards during SELECT queries when filtered by the sharding key, controlled by the optimize_skip_unused_shards setting.

Why it matters

This feature optimizes query execution by skipping shards that do not contain relevant data based on the sharding key filter, thus improving query performance and reducing resource usage.

How to use it

Enable shard pruning by setting optimize_skip_unused_shards to 1 before executing the SELECT query that includes filters on the sharding key.