To see how many comments, posts, persons, etc you have in your database, this query gives accurate counts and takes less than 1/3 of a second to execute. You can re-run this query and see new activity instantly.
SELECT table_schema, table_name,
(xpath('/row/cnt/text()', xml_count))[1]::text::intas row_count
FROM (
SELECT table_name, table_schema,
query_to_xml(format('select count(*) as cnt from %I.%I', table_schema, table_name), false, true, '') as xml_count
FROM information_schema.tables
WHERE table_schema ='public'--<< change here for the schema you want
) t;
query to get your row counts
To see how many comments, posts, persons, etc you have in your database, this query gives accurate counts and takes less than 1/3 of a second to execute. You can re-run this query and see new activity instantly.
SELECT table_schema, table_name, (xpath('/row/cnt/text()', xml_count))[1]::text::int as row_count FROM ( SELECT table_name, table_schema, query_to_xml(format('select count(*) as cnt from %I.%I', table_schema, table_name), false, true, '') as xml_count FROM information_schema.tables WHERE table_schema = 'public' --<< change here for the schema you want ) t;