1. 테이블별 사이즈
A. 테이블 스페이스 총량
=> select spcname, pg_size_pretty(pg_tablespace_size(spcname)) from pg_tablespace;
B. 각 테이블별 사이즈
=> Index 미포함 : select pg_relation_size(‘TableName’);
=> Index 포함 : select pg_total_relation_size(‘TableName’);
C. 인덱스 사이즈
=> select pg_relation_size(‘IndexName’);
D. 총 사이즈(데이터 + 인덱스)
=> select pg_total_relation_size(‘TableName’);
--------------------------
단위 적용 : pg_size_pretty()
DB 사이즈:
=> select pg_size_pretty(pg_database_size(‘DBName’));
사용 예시) select pg_size_pretty(pg_total_relation_size('aiops_train_history'));
출처: https://korearank1.tistory.com/43
PostgreSQL 테이블 사이즈, 스페이스 사이즈. 인덱스 사이즈
1. 테이블별 사이즈 A. 테이블 스페이스 총량 => select spcname, pg_size_pretty(pg_tablespace_size(spcname)) from pg_tablespace; B. 각 테이블별 사이즈 ð Index 미포함 : select pg_re..
korearank1.tistory.com
'DB > Postgresql' 카테고리의 다른 글
postgres column값을 interval에 다이나믹하게 사용하는 방법 (0) | 2020.07.22 |
---|---|
postgres의 문자열 컬럼을 json으로 파싱 후 이용하는 형태 (0) | 2020.06.17 |
쉘스크립트로 sql파일들 여러개 실행하기 (0) | 2020.04.28 |
biggint칼럼으로 시퀀스를 쓸때 초기화하는 명령어? (0) | 2020.02.13 |
postgres에서 select 사용시 바로 json으로 받아오기 (0) | 2020.02.13 |
댓글