2021. 6. 23. 15:48
PostgreSQL
SELECT
schema_name,
relname,
pg_size_pretty(table_size) AS size,
table_size
FROM (
SELECT
pg_catalog.pg_namespace.nspname AS schema_name,
relname,
pg_relation_size(pg_catalog.pg_class.oid) AS table_size
FROM pg_catalog.pg_class
JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid
) t
WHERE schema_name NOT LIKE 'pg_%'
ORDER BY table_size DESC;
https://stackoverflow.com/questions/21738408/postgresql-list-and-order-tables-by-size/21738505
'PostgreSQL' 카테고리의 다른 글
DESCRIBE TABLE ( (0) | 2021.06.15 |
---|---|
pg_stat_statements (0) | 2021.06.03 |
blocking 체크 (0) | 2020.07.24 |
pg_settings 칼럼 설명 (0) | 2020.05.20 |
postgresql.conf 파일 설정 (0) | 2020.04.27 |