MergeTree Engine
Category: infrastructure
The core table engine in ClickHouse, designed for high-performance ingestion and background data merging.
The MergeTree family of engines is the workhorse of your database. It uses primary keys to sort data and "parts" that are periodically merged in the background. This design allows for massive write throughput while maintaining lightning-fast query speeds for time-series data like storm events or article ingestion.
Common Examples
- The MergeTree engine is configured to partition our article feed by date, allowing us to drop old partitions instantly without needing a slow SQL DELETE statement.
- Every time we ingest a batch of news, MergeTree stores it as a separate part, which the background process then optimizes into a compressed shard.