GitXplorerGitXplorer
d

approximately

public
3 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
832596ab685379c2a42819d94feaa08ec6833b85

Update Bundler to non-vulnerable version

dderekprior committed 3 years ago
Unverified
5f71912cdf71af8c8397e453520d7d7b6c412c1f

Clarify accuracy of the approximation

dderekprior committed 11 years ago
Unverified
8cf3b9f54c7b8a5f8c8ee8441ebc6d89f0f9a4d4

Update README

dderekprior committed 11 years ago
Unverified
5debd4f840156bc07e6e0abe1fd63e33474430e5

Fix gemspec

dderekprior committed 11 years ago
Unverified
2ae98eb040f1ea116887c894c52e6d73a07db814

Initial Commit

dderekprior committed 11 years ago

README

The README file for this repository.

Approximately

Count queries without a where clause cause PostgreSQL to do a full table scan to count the exact number of rows. Approximately uses metadata stored by PostgreSQL to return an approximate count of the rows without the full table scan.

The number will be correct immediately following a VACUUM or ANALYZE on the table and will not be updated until the next VACUUM or ANALYZE. This makes it most appropriate for tables that are subject to [autovacuum] on a regular basis. See the Postgres documentation on [row estimation] and autovacuum for more.

Installation

Add this line to your application's Gemfile:

gem 'approximately'

And then execute:

$ bundle

Or install it yourself as:

$ gem install approximately

Usage

ApproximateCount.of(Vote.table_name) # => 256233

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request