Skip to content

Instantly share code, notes, and snippets.

@msalahz
Created December 24, 2017 21:53
Show Gist options
  • Save msalahz/4f6d6e0b662bdebf353b3ff8002c8f24 to your computer and use it in GitHub Desktop.
Save msalahz/4f6d6e0b662bdebf353b3ff8002c8f24 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