为什么图中显示的数据与结论不符合?因为图中的数据是禁用了自适应索引粒度后得到的,默认情况下索引粒度是自适应的。
https://clickhouse.com/docs/en/optimize/sparse-primary-indexes
We mentioned in the beginning of this guide in the "DDL Statement Details", that we disabled adaptive index granularity (in order to simplify the discussions in this guide, as well as make the diagrams and results reproducible).
For tables with adaptive index granularity (index granularity is adaptive by default) the size of some granules can be less than 8192 rows depending on the row data sizes.
我们在本指南开头的“DDL 语句详细信息”中提到,我们禁用了自适应索引粒度(为了简化本指南中的讨论,并使图表和结果可重现)。
对于具有自适应索引粒度的表(默认情况下索引粒度是自适应的),某些粒度的大小可以小于 8192 行,具体取决于行数据大小。
https://clickhouse.com/docs/en/whats-new/changelog/2019#experimental-features-1
ClickHouse Release 19.6.3.18, 2019-06-13
Experimental Features:实验性特性
Add setting index_granularity_bytes (adaptive index granularity) for MergeTree* tables family.
为合并树家族的表系列添加设置index_granularity_bytes(自适应索引粒度)。
ClickHouse Release 19.10.1.5, 2019-07-12
Performance Improvement:优化改进
Add the possibility to write the final mark at the end of MergeTree columns. It allows to avoid useless reads for keys that are out of table data range. It is enabled only if adaptive index granularity is in use.
添加在合并树列末尾写入最终标记的可能性。它允许避免对超出表数据范围的键进行无用的读取。仅当使用自适应索引粒度时,才会启用它。
- The deleted function modelEvaluate() was superseded by
catboostEvaluate().
- Also delete the external model repository, as modelEvaluate() was it's
last user. Additionally remove the system view SYSTEM.MODELS for
inspecting the repository.
- SYSTEM RELOAD MODELS is also obsolete. HOWEVER, it was retained and
made a no-op instead of deleted.
Why?
The reason is that RBAC in distributed setups works by storing
privileges (granted and revoked) as plain SQL statements in Keeper.
Nodes read these statements at startup and parse them. If a privilege
for SYSTEM RELOAD MODELS exists but parser doesn't recognize it
nodes would fail to come up.
Considered but rejected alternatives:
- Ignore SYSTEM RELOAD MODELS during parsing RBAC privileges and
return an error for regular SYSTEM RELOAD MODELS SQL. Special-case
of no-op behavior, too brittle.
- Remove SYSTEM RELOAD MODELS manually from Keeper via command-line
manipulation of Keeper nodes or via SQL by dropping the privileges.
Needs user intervention during upgrade.
- superseded by catboostEvaluate() which no longer uses the internal
repository for external models
- also removed was statement SYSTEM RELOAD MODELS and the monitoring view
SYSTEM.SYSTEMMODELS