in this post, I can get the row count from nominated table.
Fast way to discover the row count of a table in PostgreSQL
SELECT count(*) AS exact_count FROM myschema.mytable;
But how can I list the row count and table size for top 10 biggest tables?
idea is:
- list all tables
- get table size for each tables, order and limit to 10 tables with largest table size.
- count row for these top 10 tables (if hard, can count row for each table)
- output for table name, table size and its row count for top 10 only
But how can I do it in one sql command?
Just check the statistics about the tables, much easier and faster: