【健康度判断】
SELECT
ROUND(percentage/100,2)
FROM
(
SELECT
FLOOR(written_rows / 1000) * 1000 AS start,
(FLOOR(written_rows / 1000) * 1000) + 999 AS end,
COUNT(*) AS count,
ROUND((COUNT(*) * 100) / (
SELECT COUNT(*) AS total
FROM system.query_log
WHERE (event_date >= (today() - 1)) AND (event_time >= (now() - toIntervalDay(1))) AND (type = 'QueryFinish') AND (query_kind = 'Insert')
), 2) AS percentage
FROM system.query_log
WHERE (event_date >= (today() - 1)) AND (event_time >= (now() - toIntervalDay(1))) AND (type = 'QueryFinish') AND (query_kind = 'Insert')
GROUP BY FLOOR(written_rows / 1000)
) AS percentage_data
WHERE end=999
LIMIT 1
【可能风险】
ClickHouse exception, code: 1002, host: 11.142.xx.xx, port: 8123; Code: 252. DB::Exception: Too many parts (4101 with average size of 8.54 MiB) in table 'xx.xxxx(b9cf0e01-3bc7-4836-91cd-e27d00c02038)'. Merges are processing significantly slower than inserts. (TOO_MANY_PARTS) (version 23.8.9.1)
【原因分析】
background_pool_size
默认 16),合并任务优先级低,资源被查询,mutation等操作占用PARTITION BY
)粒度过细(如按秒分区),导致每个插入生成新分区 parts【建议】
【备注】
too many parts报错原因
300或3000,23.6之前版本为300
),或未合并的 parts 总数超过阈值,会抛出 Too many parts
错误。原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。