Our billing pipeline was suddenly slow. The culprit was a hidden bottleneck in ClickHouse
May 14, 2026James Morrison, Christian Endres

Summary
This post details the debugging and resolution of performance degradation in the Ready-Analytics ClickHouse cluster due to increased data part counts following a migration to a new partitioning scheme. Three patches were developed and contributed upstream to address lock contention during query planning (using shared locks instead of exclusive locks), vector copying (deferring the copy and creating a shared copy), and to improve part filtering efficiency (binary search for parts).
More from the Data Infrastructure & Analytics trail
- Introducing Cloudflare Basin: an open, serverless data platform, now generally available
- Introducing the Billable Usage API: programmatic cost visibility for Cloudflare
- Announcing the Monetization Gateway: charge for any resource behind Cloudflare via x402
- How we built Cloudflare's data platform and an AI agent on top of it
- Iran's Internet is partially restored, Cloudflare Radar data shows