Every Millisecond Counts
Engineers describe four months of ClickHouse optimizations that cut a 85.7-second analytics dashboard query to sub-second latency.
An engineering write-up details optimizations that reduced a ClickHouse query processing 1.96 billion rows and 198.69 GB from 85.7 seconds to sub-second latency. Key changes included repartitioning by client ID modulo 36 instead of by month to restore FINAL merge parallelism, promoting event_type in the sorting key for about a 15% latency reduction, and removing an expensive join. The post is a database performance case study with no security or AI relevance.
- Repartitioning by client_customer_id modulo 36 restored FINAL parallelism and controlled insert fan-out.
- Moving event_type earlier in the sorting key cut latency about 15% while reading 7% fewer rows.
- Removing an expensive join and reading fewer columns contributed to sub-second latency.
- Vendors
- ClickHouse
- Products
- ClickHouseKafka
From the original article
15 min read at jordivillar.com
Imagine you join a new project with a clear goal, improve ClickHouse performance, so our biggest customers can run their queries in a reasonable amount of time. This is something you’ve done lots of times before. You ask for the most expensive query since it’s usually the one that will have the most impact and a few low-hanging fruit improvements.
By theanonymousone · jordivillar.com
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.