Module: Sequel::Postgres::LooseCount
- Defined in:
- lib/sequel/extensions/pg_loose_count.rb
Instance Method Summary collapse
-
#loose_count(table) ⇒ Object
Look at the table statistics for the given table to get an approximate count of the number of rows.
Instance Method Details
#loose_count(table) ⇒ Object
Look at the table statistics for the given table to get an approximate count of the number of rows.
29 30 31 |
# File 'lib/sequel/extensions/pg_loose_count.rb', line 29 def loose_count(table) from(:pg_class).where(:oid=>regclass_oid(table)).get(Sequel.cast(:reltuples, Integer)) end |