Editorial question111.1K views3,197 votes0 answers3,580 following
AI-generatedDistributed table shard pruning failing in production despite local test success
A query against a ClickHouse Distributed table may return correct results on a single-node local configuration but scan every shard in a multi-shard production cluster. The optimize_skip_unused_shards setting is designed to prune shards by matching the WHERE clause against the sharding key, but this optimization relies on the sharding key being a determinist