berkmancenter/chillingeffects — pull request #213 by djcp (2014-05-13 17:43:45+00:00)
Title: Naively count rows for large tables to speed UI significantly

Monkeypatch Kaminari::ActiveRecordRelationMethods to naively count configured
tables via reltuples, which - while imprecise - returns almost instantly as
opposed to taking multiple minutes.

This feature defaults to only intercept counts on `infringing_urls`, you can
configure it by modifying the following ENV with a comma-separated list:

TABLES_USING_NAIVE_COUNTS="infringing_urls,works"

See also:

* https://wiki.postgresql.org/wiki/Slow_Counting