Advertisement
Pandaaaa906

PG表大小

Oct 14th, 2022
1,678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2. table_schema,
  3. table_name,
  4. pg_size_pretty(pg_table_size('"'||table_schema||'"."'||table_name||'"')) table_size,
  5. pg_size_pretty(pg_indexes_size('"'||table_schema||'"."'||table_name||'"')) index_size,
  6. pg_size_pretty(pg_relation_size('"'||table_schema||'"."'||table_name||'"')) relation_size,
  7. pg_size_pretty(pg_total_relation_size('"'||table_schema||'"."'||table_name||'"')) total_size
  8. from information_schema.tables
  9. order by pg_total_relation_size('"'||table_schema||'"."'||table_name||'"') desc
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement