[TOC]
前言 在上篇文章中,我们介绍了clickhouse的新特性——MergeTree启动加速,及其使用方法。本文将介绍MergeTree启动加速的设计原理。
MergeTree启动原理 part结构 我们知道,在clickhouse中,MergeTree表由一个个part组成。每个part对应一个目录,该目录下有两类文件:元数据文件,数据文件和projection part目录(如果该表创建了projection的话)
$ ll ./20210321_310_310_0 total 36 -rw-r----- 1 root root 28 Feb 9 14:26 primary.idx -rw-r----- 1 root root 4 Feb 9 14:26 partition.dat -rw-r----- 1 root root 4 Feb 9 14:26 minmax_day.idx -rw-r----- 1 root root 10 Feb 9 14:26 default_compression_codec.txt -rw-r----- 1 root root 1648 Feb 9 14:26 data.mrk3 -rw-r----- 1 root root 2110 Feb 9 14:26 data.bin -rw-r----- 1 root root 1 Feb 9 14:26 count.