Created
April 7, 2017 01:47
-
-
Save Wintus/df6bb24509439f077e5ee55e81c942ab to your computer and use it in GitHub Desktop.
PostgreSQL Table Size Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT relname, reltuples, (relpages / 128) as mbytes, (relpages * 8192.0 / (reltuples + 1e-10)) as average_row_size FROM pg_class ORDER BY mbytes DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment