gpt4 book ai didi

amazon-web-services - 如何在 RedShift/ParAccel 中测量磁盘上的表空间

转载 作者:行者123 更新时间:2023-12-03 12:02:34 24 4
gpt4 key购买 nike

我在 RedShift 中有一张 table 。
如何查看它使用了多少磁盘空间?

最佳答案

使用此演示文稿中的查询:http://www.slideshare.net/AmazonWebServices/amazon-redshift-best-practices

分析集群的磁盘空间使用情况:

select
trim(pgdb.datname) as Database,
trim(pgn.nspname) as Schema,
trim(a.name) as Table,
b.mbytes,
a.rows
from (
select db_id, id, name, sum(rows) as rows
from stv_tbl_perm a
group by db_id, id, name
) as a
join pg_class as pgc on pgc.oid = a.id
join pg_namespace as pgn on pgn.oid = pgc.relnamespace
join pg_database as pgdb on pgdb.oid = a.db_id
join (
select tbl, count(*) as mbytes
from stv_blocklist
group by tbl
) b on a.id = b.tbl
order by mbytes desc, a.db_id, a.name;

分析节点之间的表分布:
select slice, col, num_values, minvalue, maxvalue
from svv_diskusage
where name = '__INSERT__TABLE__NAME__HERE__' and col = 0
order by slice, col;

关于amazon-web-services - 如何在 RedShift/ParAccel 中测量磁盘上的表空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19509989/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com