altinity-expert-clickhouse-storage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStorage and Disk Usage Analysis
存储与磁盘使用分析
Diagnose disk usage, compression efficiency, part sizes, and storage bottlenecks.
诊断磁盘使用情况、压缩效率、数据分片大小以及存储瓶颈。
Diagnostics
诊断步骤
Run all queries from the file checks.sql and analyze the results.
运行checks.sql文件中的所有查询并分析结果。
Ad-Hoc Query Guidelines
临时查询指南
Required Safeguards
必要的安全措施
sql
-- Always limit results
limit 100
-- For part_log
where event_date >= today() - 1sql
-- Always limit results
limit 100
-- For part_log
where event_date >= today() - 1Key Tables
核心表
- - Disk configuration
system.disks - - Part storage details
system.parts - - Column compression
system.columns - - Tiered storage
system.storage_policies - - Orphaned parts
system.detached_parts
- - 磁盘配置
system.disks - - 数据分片存储详情
system.parts - - 列压缩信息
system.columns - - 分层存储策略
system.storage_policies - - 孤立分片
system.detached_parts
Cross-Module Triggers
跨模块触发规则
| Finding | Load Module | Reason |
|---|---|---|
| Poor compression | | Codec recommendations |
| Many small parts | | Merge backlog |
| High write IO | | Batch sizing |
| System logs large | | TTL configuration |
| Slow disk + merges | | Merge optimization |
| 发现的问题 | 加载模块 | 原因 |
|---|---|---|
| 压缩效果差 | | 编码格式建议 |
| 大量小分片 | | 合并任务积压 |
| 写入IO过高 | | 批量大小调整 |
| 系统日志过大 | | TTL配置优化 |
| 磁盘缓慢+合并问题 | | 合并操作优化 |
Settings Reference
配置参数参考
| Setting | Notes |
|---|---|
| Threshold for Wide vs Compact parts |
| Row threshold for Wide parts |
| Max merge size |
| Disable merges (emergency) |
| 配置项 | 说明 |
|---|---|
| Wide与Compact分片的阈值 |
| Wide分片的行数阈值 |
| 最大合并大小 |
| 禁用合并(紧急场景) |