본문 바로가기
데이터베이스/Postgresql

Postgresql 테이블스페이스 사용량 조회

by cbwstar 2021. 7. 16.
728x90
반응형

-- tablespace 총량

select spcname, pg_size_pretty(pg_tablespace_size(spcname)) 
from pg_tablespace;

 

-- table size (index 미포함)

select pg_size_pretty(pg_relation_size('table'));

 

-- index size

select pg_size_pretty(pg_relation_size('idx1'));

 

-- total size(data + index)

select pg_size_pretty(pg_total_relation_size('table1'));

 

-- DB size 단위적용 : pg_size_pretty()

 

728x90
반응형

댓글



"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."

loading