概述
1、集群详情
select * from system.clusters;
2、merge状态查看
SELECT
database,
table,
round(elapsed, 2) AS time_use,
round(progress, 2) AS progress,
num_parts,
round(((total_size_bytes_compressed / 1024) / 1024) / 1024, 2) AS total_size_bytes_compressed_GB,
round(((bytes_read_uncompressed / 1024) / 1024) / 1024, 2) AS bytes_read_uncompressed_GB,
rows_read / 10000 AS rows_read_w,
rows_written / 10000000 AS rows_written_kw,
round((memory_usage / 1024) / 1024) AS memory_usage_MB
FROM system.merges
ORDER BY time_use DESC;
3、统计压缩比
select table,countDistinct(name) as num_cols,formatReadableSize(sum(data_compressed_bytes) as c) as comp,formatReadableSize(sum(data_uncompressed_bytes) as r) as raw,c / r as compress_ratio from system.columns group by table order by raw desc limit 10;
4、统计parts
SELECT
database,
table,
engine,
active,
count(*) AS parts_total,
countDistinct(partition) AS partition_total,
round(sum(rows) / 10000, 2) AS rows_w,
round(((sum(bytes) / 1024) / 1024) / 1024, 2) AS size_GB
FROM system.parts
WHERE active = 1
GROUP BY
database,
table,
engine,
active
ORDER BY size_GB DESC
LIMIT 5;
5、查询状态检查
select * from system.processes where ( elapsed > 10000 ) and query like '%select%' limit 2;
最后
以上就是复杂项链为你收集整理的ClickHouse性能查看的全部内容,希望文章能够帮你解决ClickHouse性能查看所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复