티스토리 뷰

DataBase/Postgresql

테이블 사이즈 확인

디비자 2019. 8. 13. 10:50
반응형

select
    schemaname
    ,relname as "Table"
    ,pg_size_pretty(pg_total_relation_size(relid)) as "size"
    ,pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "external size"
    ,now()
from pg_catalog.pg_statio_user_tables
where 1=1
order by schemaname,pg_total_relation_size(relid) desc;

반응형

'DataBase > Postgresql' 카테고리의 다른 글

postgresql 요일 구하기  (0) 2024.05.13
postgresql 파티션 테이블 생성 및 데이터 이관  (0) 2024.05.09
role에 속한 계정 조회  (0) 2019.08.13
테이블단위 autovacuum 끄기  (0) 2019.08.13
postgresql 한글정렬  (0) 2017.10.12