Fix Error 500 viewing admin page due to statement timeouts (EE port)
Uses PostgreSQL tuple estimates to provide a much faster yet approximate count. See https://wiki.postgresql.org/wiki/Slow_Counting and https://wiki.postgresql.org/wiki/Count_estimate for more details.
We only use this fast method if the table has been analyzed or vacuumed within the last hour.
EE port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18982