Why do postgres database row counts differ between the dashboard and my queries?

Issue

You want to understand why row count statistics shown in your dashboard or via pg:info don't match the numbers you get by querying your database directly.

Resolution

Do not be alarmed if the row count you see in your dashboard or pg:info differ slightly from direct count queries.

To limit impact on your database we use the statistics provided by the catalog table pg_class, you can learn more here. To increase response time we also aggressively cache these metrics.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support