ClickHouse MergeTree explained: parts, granules, partitions and engine variants
Prepare-sh
0:00 / 0:00
ClickHouse MergeTree explained: parts, granules, partitions and engine variants
3 просмотра · 3 дн. назад
Prepare-sh
65 подписчиков
3 просмотра · 3 дн. назад
See how the ClickHouse MergeTree engine stores data on disk, what parts and granules are, why ORDER BY matters so much, and when to pick ReplacingMergeTree, SummingMergeTree, AggregatingMergeTree or ReplicatedMergeTree.
After explaining what a table engine is, the video walks through parts, background merges, the default granule size of 8,192 rows, and how PARTITION BY splits data on disk. The practical section goes through the syntax of each variant, then builds a table of five million events partitioned by month, inspects it through system.parts, queries a single month and forces a merge with OPTIMIZE FINAL.
0:00 The system that organizes your data on disk
1:10 What a table engine is
1:57 The problem MergeTree solves
3:08 Parts, merges and granules
4:48 ORDER BY and the primary key
5:43 Partitioning and how an insert is written
7:40 The MergeTree family
8:58 ReplacingMergeTree in practice
9:53 SummingMergeTree
10:24 AggregatingMergeTree
10:56 ReplicatedMergeTree
11:38 Build a partitioned table and inspect system.parts
13:27 Force a merge with OPTIMIZE FINAL
Build this partitioned table in your own lab environment at https://prepare.sh