Skip to content

Instantly share code, notes, and snippets.

@muzhig
Created June 6, 2014 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muzhig/86b8041cd6352c1f15c1 to your computer and use it in GitHub Desktop.
Save muzhig/86b8041cd6352c1f15c1 to your computer and use it in GitHub Desktop.
postgres table sizes
SELECT relname, pg_size_pretty(relpages::bigint * 8 * 1024) as size, relkind, reltuples::bigint as rows, relpages, relfilenode FROM pg_class ORDER BY relpages DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment