[DB] POSTGRESQL

[PostgreSQL] 테이블스페이스 및 오브젝트 사용량 조회

mewoni 2020. 4. 22. 17:50
반응형

-- tablespace 총량

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

 

-- table size (index 미포함)

select pg_relation_size('table'); 

 

-- index size

select pg_relation_size('idx1'); 

 

-- total size(data + index)

select pg_total_relation_size('table1');

 

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

select pg_total_relation_size('DBname'); 

 

반응형