MergeTree engine family

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/engines/table-engines/mergetree-family/index.md)

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](/docs/engines/table-engines/mergetree-family/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](/docs/engines/table-engines/mergetree-family/replication) 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](/docs/engines/table-engines/log-family).

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Page Description|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [MergeTree table engine](/docs/engines/table-engines/mergetree-family/mergetree) `MergeTree`-family table engines are designed for high data ingest rates and huge data volumes.| [Replicated\* table engines](/docs/engines/table-engines/mergetree-family/replication) Overview of data replication with the Replicated\* family of table engines in ClickHouse|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [Custom Partitioning Key](/docs/engines/table-engines/mergetree-family/custom-partitioning-key) Learn how to add a custom partitioning key to MergeTree tables.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [ReplacingMergeTree table engine](/docs/engines/table-engines/mergetree-family/replacingmergetree) differs from MergeTree in that it removes duplicate entries with the same sorting key value (`ORDER BY` table section, not `PRIMARY KEY`).| [CoalescingMergeTree table engine](/docs/engines/table-engines/mergetree-family/coalescingmergetree) CoalescingMergeTree 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 engine](/docs/engines/table-engines/mergetree-family/summingmergetree) SummingMergeTree inherits from the MergeTree engine. Its key feature is the ability to automatically sum numeric data during part merges.|  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [AggregatingMergeTree table engine](/docs/engines/table-engines/mergetree-family/aggregatingmergetree) Replaces all rows with the same primary key (or more accurately, with the same [sorting key](/docs/engines/table-engines/mergetree-family/mergetree)) with a single row (within a single data part) that stores a combination of states of aggregate functions.| [CollapsingMergeTree table engine](/docs/engines/table-engines/mergetree-family/collapsingmergetree) Inherits from MergeTree but adds logic for collapsing rows during the merge process.|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | [VersionedCollapsingMergeTree table engine](/docs/engines/table-engines/mergetree-family/versionedcollapsingmergetree) Allows for quick writing of object states that are continually changing, and deleting old object states in the background.|  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | | [GraphiteMergeTree table engine](/docs/engines/table-engines/mergetree-family/graphitemergetree) Designed for thinning and aggregating/averaging (rollup) Graphite data.|  |  |  |  | | --- | --- | --- | --- | | [Exact and Approximate Vector Search](/docs/engines/table-engines/mergetree-family/annindexes) Documentation for Exact and Approximate Vector Search|  |  | | --- | --- | | [Full-text Search with Text Indexes](/docs/engines/table-engines/mergetree-family/textindexes) Quickly find search terms in text. | | | | | | | | | | | | | | | | | | | | | | | | | |

Was this page helpful?