Skip to content

Instantly share code, notes, and snippets.

@vnisor
Created April 18, 2016 23:51
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 vnisor/e95f89ad4fb1d6a0dae306662b212444 to your computer and use it in GitHub Desktop.
Save vnisor/e95f89ad4fb1d6a0dae306662b212444 to your computer and use it in GitHub Desktop.
Row counts for all tables in a postgres db.
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment