Tech & AI News
Hacker News

Every Millisecond Counts

The team reduced a ClickHouse query that processed 1.96 billion rows and used 23 GiB RAM from 85 seconds to sub-second latency by applying incremental optimizations, chiefly replacing the month-based partition key with a modulo-based key (client_customer_id % 36). This change limited the number of parts per insert to 36, balanced partition sizes, and enabled parallel FINAL merges, eliminating costly range-intersection calculations.