ClickHouse Release 25.6

ClickHouse Team
14 min readintermediate
--
View Original

Overview

ClickHouse version 25.6 introduces significant enhancements including a consistent snapshot mechanism for SELECT queries, support for JSON in Parquet files, and improved performance through multiple projections. The release also welcomes new contributors and includes various bug fixes and optimizations.

What You'll Learn

1

How to utilize the new single snapshot feature for SELECT queries in ClickHouse

2

Why using multiple projections can enhance query performance in ClickHouse

3

How to store and retrieve JSON data in Parquet format using ClickHouse

4

When to apply Time and Time64 data types for better compatibility with SQL DBMS

Prerequisites & Requirements

  • Understanding of SQL and database concepts

Key Questions Answered

How does ClickHouse ensure consistent snapshots for SELECT queries?
ClickHouse version 25.6 ensures that SELECT queries operate on a consistent snapshot of data by marking relevant data parts as referenced. This allows queries to see the same data throughout their execution, even if changes occur in parallel, thus preventing inconsistencies.
What improvements have been made to projections in ClickHouse 25.6?
In version 25.6, ClickHouse allows the use of multiple projections in a single query, improving performance by enabling the system to prune unnecessary data parts based on different filters. This builds on the previous support for the _part_offset virtual column, reducing storage overhead.
How is JSON data handled in Parquet files with ClickHouse?
ClickHouse 25.6 introduces the ability to write JSON data to Parquet files, storing it as a string with a logical JSON type. This allows for better compatibility and retrieval of JSON data directly as a JSON type rather than a string.
What are the new Time and Time64 data types in ClickHouse?
ClickHouse now includes Time and Time64 data types, allowing storage of time values down to the second and sub-second respectively. This feature enhances compatibility with other SQL databases and is currently experimental, requiring specific settings to enable.

Key Statistics & Figures

New features in ClickHouse 25.6
25
The release includes 25 new features aimed at enhancing functionality and performance.
Performance optimizations
32
Version 25.6 includes 32 performance optimizations to improve query execution efficiency.
Bug fixes
105
This release addresses 105 bug fixes, contributing to overall stability and reliability.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Database
Clickhouse
Used for real-time analytics and data storage with enhanced features in version 25.6.
File Format
Parquet
Utilized for storing JSON data in a structured format that allows efficient querying.

Key Actionable Insights

1
Implement the single snapshot feature in your ClickHouse queries to ensure data consistency during execution.
This is particularly important for complex queries involving subqueries or multiple table references, as it prevents inconsistencies that could arise from concurrent data modifications.
2
Leverage multiple projections in your ClickHouse tables to optimize query performance, especially when filtering on multiple columns.
By using projections with different sort orders, you can significantly reduce the amount of data scanned during queries, leading to faster response times and lower resource usage.
3
Utilize the new Time and Time64 data types for better time data handling in ClickHouse.
These types allow for more precise time storage and compatibility with other SQL systems, which is essential for applications that require accurate time tracking.

Common Pitfalls

1
Failing to enable the shared storage snapshot setting can lead to inconsistent query results.
Without this setting, queries with subqueries may reference different snapshots of data, resulting in discrepancies in the output.

Related Concepts

Projections In Clickhouse
Data Types In SQL
Performance Optimization Techniques