chDB Kernel Upgrade Journey: Upgrading ClickHouse to v25.8.2.29
Blog post from ClickHouse
chDB is an embedded OLAP SQL engine that integrates ClickHouse's analytical capabilities into Python, eliminating the need for a standalone ClickHouse server. The recent upgrade to the ClickHouse kernel version v25.8.2.29 introduced new features and performance improvements, although it also posed technical challenges. chDB's architecture allows for zero-copy data transfers and supports multiple data formats, and it utilizes two dynamic libraries to address multi-Python version compatibility issues. Memory management presented a significant challenge, particularly with memory allocation and deallocation conflicts between jemalloc and glibc, which was resolved through runtime memory source detection. The upgrade improved performance, notably in complex queries, by optimizing memory management and reducing lock contention, and enhanced compatibility with ClickHouse's latest features. Additionally, the improvements were crucial in reducing overhead and execution times, making chDB more competitive with ClickHouse-local in terms of performance for both single and batch queries. Overall, the kernel upgrade significantly boosted chDB's efficiency and broadened its functionality while maintaining compatibility with ClickHouse's core enhancements.