3 ms·
If you want an approximate count you can do something like to get data for all your tables: SELECT S.nspname || '.' || relname, reltuples FROM pg_c
by Erwin 14y ago
If you want an approximate count you can do something like to get data for all your tables:
SELECT S.nspname || '.' || relname, reltuples
FROM pg_class C, pg_namespace S
WHERE C.relnamespace = S.oid
ORDER BY reltuples DESC
This is the estimate used by the query planner, so it's updated whenever a VACUUM occurs (not sure how often the autovacuum runs).
- outworlder 14y agoAs often as it is needed, depending on your database settings.