I released a new gem - GitHub - fatkodima/fast_count: Quickly get a count estimation for large tables (>99% of accuracy for PostgreSQL)..
It allows to get an accurate count estimation (>>99% accuracy for PostgreSQL) for large tables in a blink of an eye (compared to
SELECT COUNT(*), which can literally take tens of minutes or hours to compute).
Note that while it also supports MySQL, there is no way to accurately estimate a count of rows in the MySQL (InnoDB) table all the time yet, so it can vary from the actual value by as much as 50%. But still is useful to get a rough idea of the number of rows in very large tables.
Getting count of rows in the tables is very often useful in the admin sections of the site, for reporting, some growth predictions, capacity or some operation times estimations etc.