いずれも管理者で実行する
テーブルごとの容量
SELECT
TRIM(du.name) AS table_name,
COUNT(1) AS mb
FROM
svv_diskusage du
GROUP BY table_name
ORDER BY mb;
カラムごとの容量
SELECT
TRIM(du.name) AS table_name,
TRIM(atr.attname) AS column_name,
COUNT(1) AS mb
FROM
svv_diskusage du, pg_attribute atr
WHERE
du.col = atr.attnum-1 AND
du.tbl = atr.attrelid
GROUP BY 1, 2
ORDER BY 1, 3;
参考
https://docs.aws.amazon.com/ja_jp/redshift/latest/dg/r_SVV_DISKUSAGE.html
https://qiita.com/nabewata07/items/5c474b62c0c1c24df01a
https://gist.github.com/yujihamaguchi/b817e518117c63c73d8a