v.20.4Improvement
Evaluate Constant Expressions for optimize_skip_unused_shards
Evaluate constant expressions foroptimize_skip_unused_shards(i.e.SELECT * FROM foo_dist WHERE key=xxHash32(0)) #8846 (Azat Khuzhin)
Why it matters
This feature improves query performance on distributed tables by enabling the evaluation of constant expressions for shard skipping. It enhances the optimization process by allowing more complex filters involving constant expressions to be recognized, reducing unnecessary shard scans and improving overall efficiency.How to use it
Users can benefit from this feature by using constant expressions in their query filters whenoptimize_skip_unused_shards is enabled. For example, write queries like:SELECT * FROM foo_dist WHERE key=xxHash32(0)and ClickHouse will evaluate the constant expression and skip shards accordingly.