I have a pretty big website and on it's admin section I have to present satistics on more tables (how many users, products etc) on the header of every page.
My problem is that these tables are getting pretty big and a select count(*) on them takes more and more time every day.
My solution would be to create a table that counts the number of rows in every other table but I'm afraid it would create too many locks because the tables are updated heavily. That is why I thought I should show the number PGAdmin shows as estimated number of rows, but how can I find out that? I know this estimated number is updated when vacuuming but the autovacuum is turned on and a cronjob is vacuuming every table in every 30 minutes, so those estimated numbers would suffice. |