Admin dashboard randomly shows different total count for models
Summary
Users have experienced seeing random values for the total count in groups/projects and are back to normal values when the page is refreshed. The queries used in the admin dashboard return different values:
SELECT n_live_tup FROM pg_stat_user_tables WHERE relname = 'projects';
6692
SELECT reltuples::bigint AS estimate FROM pg_class where relname = 'projects';
6692
SELECT COUNT (*) FROM Projects;
3889
https://gitlab.zendesk.com/agent/tickets/98267 running 10.8.2-ee
https://gitlab.zendesk.com/agent/tickets/97856 running 10.8.3-ee
This may be related to n_live_tup: http://grokbase.com/p/postgresql/pgsql-general/12c5j2m9zb/statistics-mismatch-between-n-live-tup-and-actual-row-count
Edited by Cindy Pallares 🦉