clikchouse如何查看某张表的容量、行数和压缩率?

提问者:帅平 问题分类:大数据
clikchouse如何查看某张表的容量、行数和压缩率?
1 个回答
自愈
自愈
这也是从system.parts表里面查看,示例sql如下:
SELECT 
    table AS `表名`,
    sum(rows) AS `总行数`,
    formatReadableSize(sum(data_uncompressed_bytes)) AS `原始大小`,
    formatReadableSize(sum(data_compressed_bytes)) AS `压缩大小`,
    round((sum(data_compressed_bytes) / sum(data_uncompressed_bytes)) * 100, 0) AS `压缩率`
FROM system.parts
WHERE table IN (${表名})
GROUP BY table
发布于:3个月前 (02-29) IP属地:四川省
我来回答