Skip to main content
Skip to main content

MergeTree engine family

Table engines from the MergeTree family are the core of ClickHouse data storage capabilities. They provide most features for resilience and high-performance data retrieval: columnar storage, custom partitioning, sparse primary index, secondary data-skipping indexes, etc.

Base MergeTree table engine can be considered the default table engine for single-node ClickHouse instances because it is versatile and practical for a wide range of use cases.

For production usage ReplicatedMergeTree is the way to go, because it adds high-availability to all features of regular MergeTree engine. A bonus is automatic data deduplication on data ingestion, so the software can safely retry if there was some network issue during insert.

All other engines of MergeTree family add extra functionality for some specific use cases. Usually, it's implemented as additional data manipulation in background.

The main downside of MergeTree engines is that they are rather heavy-weight. So the typical pattern is to have not so many of them. If you need many small tables, for example for temporary data, consider Log engine family.

PageDescription
MergeTree table engineMergeTree-family table engines are designed for high data ingest rates and huge data volumes.
Replicated* table enginesOverview of data replication with the Replicated* family of table engines in ClickHouse
Custom Partitioning KeyLearn how to add a custom partitioning key to MergeTree tables.
ReplacingMergeTree table enginediffers from MergeTree in that it removes duplicate entries with the same sorting key value (ORDER BY table section, not PRIMARY KEY).
CoalescingMergeTree table engineCoalescingMergeTree inherits from the MergeTree engine. Its key feature is the ability to automatically store last non-null value of each column during part merges.
SummingMergeTree table engineSummingMergeTree inherits from the MergeTree engine. Its key feature is the ability to automatically sum numeric data during part merges.
AggregatingMergeTree table engineReplaces all rows with the same primary key (or more accurately, with the same sorting key) with a single row (within a single data part) that stores a combination of states of aggregate functions.
CollapsingMergeTree table engineInherits from MergeTree but adds logic for collapsing rows during the merge process.
VersionedCollapsingMergeTree table engineAllows for quick writing of object states that are continually changing, and deleting old object states in the background.
GraphiteMergeTree table engineDesigned for thinning and aggregating/averaging (rollup) Graphite data.
Exact and Approximate Vector SearchDocumentation for Exact and Approximate Vector Search
Full-text Search using Text IndexesQuickly find search terms in text.