Engineering team cuts ClickHouse query latency from 85 seconds to sub-second
A team tasked with speeding up ClickHouse for its largest customers found a critical dashboard query taking over 85 seconds and scanning nearly 2 billion rows across 198GB of data. Over four months, they applied a series of incremental, non-flashy optimizations—tackling issues like the overhead of ReplacingMergeTree's FINAL clause on mutable event data and an inefficient partition key—to bring the query down to sub-second response times.