We could use postgresql statistics to get a faster approximation of the record counts
On databases with dozen of millions of record doing a simple SELECT count() FROM foo
can sometimes takes more than a minute.
Given that we're using estimated_count
for many queries we ought to have a more efficient way to get an estimation of the count of records.
We could use postgres statistics table in order to do so.