ClickHouse Release 22.12
ClickHouse 22.12 adds a grace hash join algorithm that partitions both join sides into hash buckets spilled to disk, dynamically increasing the bucket count when the in-memory hash table exceeds max_bytes_in_join, so large joins run with bounded memory. On a self-join of the hits dataset it beat partial_merge on speed while using more memory, and stayed slower than hash and parallel_hash. Tuning grace_hash_join_initial_buckets avoids re-bucketing. The release also adds regex-based password complexity rules, BSON input for mongodump files, GROUP BY ALL, and a Prometheus metrics endpoint for ClickHouse Keeper.
Related posts
- ClickHouse Newsletter January 2023: Better Safe Than Sorry
ClickHouse mediumAdept
ClickHouse's January 2023 newsletter lists upcoming webinars and recaps the 22.12 release. That release added grace hash join, which joins tables bucket by bucket to cut memory use at some cost in speed. It also brought async insert deduplication, password complexity rules, GROUP BY ALL, underscores in numeric literals, and parallel async reads from MergeTree on object storage. The featured query shows built-in column encryption with encrypt, decrypt and tryDecrypt using AES-128-CBC; tryDecrypt returns NULL for values the user's key cannot decrypt. It is pitched as a cheap security improvement that is weaker than an external KMS.
- ClickHouse Release 24.12
ClickHouse mediumAdept
ClickHouse 24.12 adds LIKE and unknown-value equality/IN support for Enums, an experimental descending MergeTree sorting key, JSON subcolumns as primary key columns, Iceberg REST catalog (Unity, Polaris) and schema evolution support, and automatic JOIN side swapping via query_plan_join_swap_table. On 100M Bluesky events, ordering by JSON subcolumns made a filtered query about 50x faster with 150x less memory. The now-default parallel hash join ran TPC-H Q3 at scale factor 100 about 8x faster than the plain hash join. The auto swap mode picks the smaller table as the hash-table build side to save memory and time.
- ClickHouse Release 25.2
ClickHouse mediumAdept
ClickHouse 25.2 ships 12 features, 15 performance optimizations and 72 bug fixes. The parallel hash join build phase no longer locks every hash table to check size limits when max_rows_in_join and max_bytes_in_join are unset. That removes thread contention and halves a synthetic 1-billion-row join from 12.3s to 6.3s on 32 cores. Parquet output now writes Bloom filters by default, costing about 10% in file size and speeding point lookups by 30-40%. The optimizer also infers transitive conditions, such as a < 5 from a < b < 5, so primary-key pruning can apply. The release adds a read-only Backup database engine, experimental Delta Lake support via the Delta Rust kernel, and compact JSON WithProgress streaming formats over HTTP.
- ClickHouse Joins Under the Hood - Hash Join, Parallel Hash Join, Grace Hash Join
ClickHouse mediumAdept
ClickHouse implements three in-memory hash-table-based join algorithms within its parallel query pipeline. The default hash join builds a single hash table from the right-hand table in one thread, so with a 100M-row table on the right it ran 5x slower and used 8.95 GiB versus 716 MiB with the small table on the right. Parallel hash join splits right-side rows into max_threads buckets and fills that many hash tables concurrently, roughly halving runtime at more than double the memory. Grace hash join spills buckets to disk to stay within memory limits without requiring sorting, and the post uses EXPLAIN pipeline graphs and query_log statistics to show each algorithm's behavior.
- ClickHouse Release 25.1
ClickHouse mediumAdept
ClickHouse 25.1 speeds up the default parallel hash join by building N two-level hash tables whose 256 buckets are filled by threads in a non-overlapping way, then merging them in constant time into one shared table. The probe phase can then read that table concurrently without splitting input blocks, and it uses a single hash function where the old design used two. Benchmarks on a 32-vCPU m6i.8xlarge show roughly 37% faster joins on a synthetic query and 32% faster on a TPC-H SF100 lineitem/orders join. The release also adds the add_minmax_index_for_numeric_columns setting, which creates MinMax skip indexes on every numeric column, and it improves Merge tables and adds auto-increment support.