MapReduce服务 MRS-SELECT查询表数据:使用示例

时间:2025-01-26 10:38:54

使用示例

--查看ClickHouse集群信息select * from system.clusters;--显示当前节点设置的宏select * from system.macros;--查看数据库容量selectsum(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) "压缩率"from system.parts;--查询test表容量。where条件根据实际情况添加修改selectsum(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) "压缩率"from system.partswhere table in ('test')and partition like '2020-11-%'group by table;
support.huaweicloud.com/cmpntguide-mrs/mrs_01_24203.html