I have two amazon rds postgres instances, one is staging, one is production...
In staging, a table has 21 million rows, and in production that same table has 29 million rows.
If I do select count (*) on staging, it takes approx 3 seconds to get the count.
On the production database, that same call takes around 160 seconds.
Production's total relation size is 16168345600, and relation size is 9859072000 Staging's total relation size is 13933518848, and relation size is 8604483584
Autovacuum is on both databases...
Is there anything I can do to narrow down what is causing the drastic difference in performance?