Advertisement
minafaw3

top 5 tabls

Jul 11th, 2021
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. SELECT
  2. relname AS "relation",
  3. pg_size_pretty (
  4. pg_total_relation_size (C .oid)
  5. ) AS "total_size"
  6. FROM
  7. pg_class C
  8. LEFT JOIN pg_namespace N ON (N.oid = C .relnamespace)
  9. WHERE
  10. nspname NOT IN (
  11. 'pg_catalog',
  12. 'information_schema'
  13. )
  14. AND C .relkind <> 'i'
  15. AND nspname !~ '^pg_toast'
  16. ORDER BY
  17. pg_total_relation_size (C .oid) DESC
  18. LIMIT 5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement