postgreSQL db 테이블 사이즈 확인하기
2024. 10. 8. 10:37ㆍDB/postgreSQL
728x90
--SELECT pg_size_pretty(pg_database_size('db이름'))
--SELECT pg_size_pretty(pg_relation_size('테이블이름'))
--select nspname from pg_catalog.pg_namespace pn;
--
-- SELECT nspname || '.' || relname AS "relation",
-- pg_size_pretty(pg_relation_size(C.oid)) AS "size",
-- pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
-- FROM pg_class C
-- LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
-- WHERE nspname IN ('스키마이름')
-- AND C.relkind <> 'i'
-- AND nspname !~ '^pg_toast'
-- ORDER BY pg_relation_size(C.oid) desc;
728x90
반응형