Table Engine
The MergeTree engine and other engines of the MergeTree
family (e.g. ReplacingMergeTree
, AggregatingMergeTree
) are the most commonly used and most robust table engines in ClickHouse.
Main features of MergeTree
family table engines.
- The primary key does not reference individual rows but blocks of 8192 rows called granules. This makes primary keys of huge data sets small enough to remain loaded in main memory, while still providing fast access to on-disk data.
MergeTree
The most versatile and commonly used table engine that stores data in parts sorted by primary key and supports efficient range queries, updates, and deletions.
SummingMergeTree
Automatically sums numeric columns with the same primary key during background merges, making it ideal for storing pre-aggregated data like metrics and counters.
ReplacingMergeTree
Removes duplicate rows with the same primary key during merges, keeping only the latest version based on an optional version column for data deduplication.
AggregatingMergeTree
Stores intermediate aggregation states and merges them using aggregate functions during background operations, perfect for building materialized views with complex aggregations.