I read the slow counting entry in the Postgres Wiki.
For my tables the estimates are quite accurate. For views, however
SELECT reltuples FROM pg_class WHERE relname = 'tbl';
doesn't work and always return 0 records. Is there any way to count or estimate the rows of a view in Postgres other than this?
SELECT COUNT(*) FROM someview;
ANALYZE
did not work either for views (no problem for tables), I just get:
ANALYZE v_myview;
WARNING: skipping "v_myview" --- cannot analyze non-tables or special system tables
ANALYZE