Blog Archive for July 18, 2017

Row Counts in Postgres

July 18, 2017

Here's a query that will give an estimate of the rows in all tables of a postgres database.

SELECT schemaname,relname,n_live_tup 
FROM pg_stat_user_tables 
ORDER BY n_live_tup DESC;