블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday
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
posted by bedbmsguru