MergeTree
table engine is used to analyze a very large amount of data. It supports data partitioning, primary key indexing, sparse indexing, data TTL, and other features.MergeTree
engine also has some variants, such as ReplicatedMergeTree
, AggregatingMergeTree
, and SummingMergeTree
, which add data replication, data aggregation, data summation, and other features to the basic MergeTree
features. The MergeTree
engine supports all SQL syntax in ClickHouse, but there are differences in some features compared with standard SQL.MergeTree
and its variants:Family | Table Engine | Description | Reference |
MergeTree | MergeTree | Used to insert a very large amount of data into a table. The data is quickly written to the table part by part, and the parts are merged according to rules. | |
| ReplacingMergeTree | Used to remove duplicate entries with the same primary key. | |
| CollapsingMergeTree | Used to eliminate the feature limitations of the ReplacingMergeTree table engine. It greatly reduces the volume of storage and increases the efficiency of SELECT query as a consequence. | |
| VersionedCollapsingMergeTree | Serves the same purpose as CollapsingMergeTree but allows retention of data with the latest version. | |
| SummingMergeTree | Used to summarize data with the same primary key. | |
| AggregatingMergeTree | Used to aggregate data with the same primary key. |
Replicated
prefix needs to be added to the table engine name to represent multiple replicas. For more information, see Data Replication.
Was this page helpful?