重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
altinity-expert-clickhouse-merges by altinity/skills
npx skills add https://github.com/altinity/skills --skill altinity-expert-clickhouse-merges逐一运行 checks.sql 中的所有查询(集群范围)并生成一份可供决策的报告。
system.merges 中的当前活跃合并。system.part_log 中的合并成功/失败趋势。merge_ok、merge_failed、上次成功/失败)。merge_reason、merge_algorithm)。system.merges.memory_usage、)。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
system.part_log.peak_memory_usagedatabase = 'system'database != 'system'明确使用以下最终结论之一:
PROVED:集群范围合并停止(在选定时间窗口内无成功合并)。DECLINED:集群范围停止不成立。PARTIAL:特定表合并被阻塞,而其他表仍在合并。附加规则:
merge_ok = 0 且重复出现 MEMORY_LIMIT_EXCEEDED,则报告表级阻塞。Horizontal,则说明规划器选择了水平合并(除非设置证明垂直合并被禁用,否则不要声称垂直合并被禁用)。system.* 表驱动,请明确指出告警来源不匹配,以避免错误归因于业务表。针对特定表,运行临时检查(限时且有限制):
select
toStartOfMinute(event_time) as minute,
countIf(event_type = 'NewPart') as new_parts,
countIf(event_type = 'MergeParts') as merges,
countIf(event_type = 'MergeParts') - countIf(event_type = 'NewPart') as net_reduction
from system.part_log
where database = '{database}'
and table = '{table}'
and event_time > now() - interval 1 hour
group by minute
order by minute desc
limit 60
如果 net_reduction 持续为负,则插入速度超过了合并速度。
检查 system.merge_tree_settings 是否被修改。如果出现问题,建议作为补救措施进行更改(减少或增加)。
明确指出反模式:
partition_id='all')TTL ... GROUP BY ... SET ...推荐的长期方向:
-- 始终包含 LIMIT
limit 100
-- 历史查询始终限制时间范围
where event_time >= now() - interval 24 hour
-- 对于 part_log,始终过滤 event_type
where event_type in ('NewPart', 'MergeParts', 'MutatePart')
select * from system.part_log*_log 表上进行无限制扫描| 发现 | 负载模块 | 原因 |
|---|---|---|
| 合并期间内存使用高 / OOM | altinity-expert-clickhouse-memory | 内存限制和压力 |
| 合并慢 + 磁盘正常 | altinity-expert-clickhouse-schema | ORDER BY/分区反模式 |
| 合并慢 + 磁盘 IO 高 | altinity-expert-clickhouse-storage | 存储瓶颈 |
| 合并被数据变更阻塞 | altinity-expert-clickhouse-mutations | 数据变更积压 |
| 复制延迟 + 合并问题 | altinity-expert-clickhouse-replication | 队列/副本瓶颈 |
system 与非 system)每周安装数
43
仓库
GitHub Stars
5
首次出现
2026年1月24日
安全审计
安装于
codex41
claude-code37
opencode20
gemini-cli20
github-copilot19
kimi-cli16
Run all queries from checks.sql (cluster-wide) one by one and produce a decision-ready report.
system.merges.system.part_log.merge_ok, merge_failed, last success/failure).merge_reason, merge_algorithm).system.merges.memory_usage, system.part_log.peak_memory_usage).database = 'system'database != 'system'Use one of these final verdicts explicitly:
PROVED: cluster-wide merge stop (no successful merges in the selected window).DECLINED: cluster-wide stop is false.PARTIAL: merges are blocked for specific table(s) while others still merge.Additional rules:
merge_ok = 0 with repeated MEMORY_LIMIT_EXCEEDED, report table-level block.Horizontal, state that planner selected horizontal merges (do not say vertical is disabled unless settings prove it).system.* tables, call out alert-source mismatch to avoid misattribution to business tables.For a specific table, run ad-hoc checks (time-bound and limited):
select
toStartOfMinute(event_time) as minute,
countIf(event_type = 'NewPart') as new_parts,
countIf(event_type = 'MergeParts') as merges,
countIf(event_type = 'MergeParts') - countIf(event_type = 'NewPart') as net_reduction
from system.part_log
where database = '{database}'
and table = '{table}'
and event_time > now() - interval 1 hour
group by minute
order by minute desc
limit 60
If net_reduction is negative consistently, inserts outpace merges.
Check system.merge_tree_settings if modified Suggest changing (reducing or increasing) in case of a problem as remediation.
Call out anti-patterns explicitly:
partition_id='all')TTL ... GROUP BY ... SET ... on a hot ingestion tableRecommended long-term direction:
-- Always include LIMIT
limit 100
-- Always time-bound historical queries
where event_time >= now() - interval 24 hour
-- For part_log, always filter event_type
where event_type in ('NewPart', 'MergeParts', 'MutatePart')
select * from system.part_log*_log tables| Finding | Load Module | Reason |
|---|---|---|
| High memory during merges / OOM | altinity-expert-clickhouse-memory | Memory limits and pressure |
| Slow merges + normal disk | altinity-expert-clickhouse-schema | ORDER BY/partitioning anti-patterns |
| Slow merges + high disk IO | altinity-expert-clickhouse-storage | Storage bottleneck |
| Merges blocked by mutations | altinity-expert-clickhouse-mutations | Mutation backlog |
| Replication lag + merge issues |
system vs non-system)Weekly Installs
43
Repository
GitHub Stars
5
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex41
claude-code37
opencode20
gemini-cli20
github-copilot19
kimi-cli16
Dogfood - Vercel Labs 自动化 Web 应用探索与问题报告工具
20,800 周安装
altinity-expert-clickhouse-replication| Queue/replica bottlenecks |