Created
March 17, 2018 06:12
-
-
Save aks/70ac2d06d37f836d6053e40778bbbf72 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- quickly select the estimated row counts, using reltuples, across all tables | |
| -- sort the results by descending size, and table names alphabetically | |
| -- | |
| -- This relies on the table having been recently analyzed. | |
| SELECT relname as "Table" | |
| , to_char(reltuples::bigint, '9,999,999,999,999') AS "~Rows" | |
| FROM pg_class | |
| WHERE relname NOT LIKE 'pg%' | |
| AND relkind = 'r' | |
| ORDER BY 2 DESC, 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment