LoginSignup
38
36

More than 5 years have passed since last update.

AWS Redshiftでテーブル名と容量の一覧を出力する

Last updated at Posted at 2014-10-27

下記のSQLを管理者ユーザーで実行する。
単位はMB。

select name, cnt from
(
  select tbl, count(*) as cnt
  from stv_blocklist
  where tbl in (
  select id
  from stv_tbl_perm)
  group by tbl
) block_list
inner join stv_tbl_perm
on block_list.tbl=stv_tbl_perm.id
group by tbl, stv_tbl_perm.name, block_list.cnt
order by cnt;
38
36
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
38
36