Skip to content

Instantly share code, notes, and snippets.

@yujihamaguchi
Created August 13, 2014 02:27
Show Gist options
  • Save yujihamaguchi/b817e518117c63c73d8a to your computer and use it in GitHub Desktop.
Save yujihamaguchi/b817e518117c63c73d8a to your computer and use it in GitHub Desktop.
[Redshift] 列ごとの容量確認
-- refer: http://dev.classmethod.jp/cloud/aws/amazon-redshift-tutorial-tuning-table-design/
-- システム生成の列を除外する為にWHERE句にcol < 6がある
select col, max(blocknum)
from stv_blocklist b, stv_tbl_perm p
where (b.tbl=p.id) and name ='<table name>'
and col < 6
group by name, col
order by col;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment