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

标签 amazon-web-services amazon-redshift paraccel

我在 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/

相关文章:

postgresql - 如何在 Kafka 中进行转换(PostgreSQL-> Red shift)

security - 如何在 Redshift 中将表所有权分配给多个用户或组

postgresql - 对于不存在的行,Redshift SELECT * 性能与 COUNT(*)

amazon-web-services - Athena Presto 中 array_agg 的长度限制

amazon-web-services - AWS CannotPullContainerError 设备 Docker 上没有剩余空间

amazon-redshift - 以Parquet格式将数据文件从Amazon Redshift卸载到Amazon S3

sql - Amazon Redshift/PostgreSQL 中的高效 GROUP BY CASE 表达式

amazon-web-services - AWS CLI : Could not connect to the endpoint URL : "https://sts.amazonaws.com/"

amazon-web-services - Terraform 多个 s3 存储桶创建