Postgresql에서 하나의 row의 bytes를 다음 명령어로 구할 수 있다.
SELECT sum(pg_column_size(t.*)) as filesize, count(*) as filerow FROM <TABLE_NAME> as t where id = <id>;
테이블 크기에 대해 알고 싶으면 where문을 빼면 된다.
SELECT sum(pg_column_size(t.*)) as filesize, count(*) as filerow FROM <TABLE_NAME> as t;
'db' 카테고리의 다른 글
Database partition in postgresql (0) | 2024.01.29 |
---|---|
[TIL] Redis Scan 개선 (0) | 2023.10.21 |
Clickhouse 알아보기 (0) | 2022.05.11 |