Skip to content

Commit

Permalink
Releasing gem v0.4.3
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
afair committed Jun 6, 2014
1 parent 2df5b19 commit 1b799d5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
PostgreSQLCursor extends ActiveRecord to allow for efficient processing of queries
returning a large number of rows.

Note: Rails/ActiveRecord 4.x support has been reworked in the v0.5 Branch. For AR < 4.x, use the gem 0.4.x series.

== Why use this?

ActiveRecord is designed and optimized for web performance. In a web transaction, only a "page" of
Expand All @@ -13,10 +15,10 @@ around 20 rows is returned to the user. When you do this
Model.find(:all, :conditions=>["id>0"]

The database returns all matching result set rows to ActiveRecord, which instantiates each row with
the data returned. This function returns an array of all these rows to the caller.
the data returned. This function returns an array of all these rows to the caller.

Asyncronous, Background, or Offline processing may require processing a large amount of data.
When there is a very large number of rows, this requires a lot more memory to hold the data. Ruby
When there is a very large number of rows, this requires a lot more memory to hold the data. Ruby
does not return that memory after processing the array, and the causes your process to "bloat". If you
don't have enough memory, it will cause an exception.

Expand Down Expand Up @@ -46,7 +48,7 @@ to declare a cursor to run a given query returning "chunks" of rows to the appli
retaining the position of the full result set in the database. This overcomes all the disadvantages
of using find_each and find_in_batches.

Also, with PostgreSQL, you have on option to have raw hashes of the row returned instead of the
Also, with PostgreSQL, you have on option to have raw hashes of the row returned instead of the
instantiated models. An informal benchmark showed that returning instances is a factor of 4 times
slower than returning hashes. If you are can work with the data in this form, you will find better
performance.
Expand Down Expand Up @@ -81,7 +83,7 @@ Thank you to:
* Julian Mehnle, julian@mehnle.net (Suggestions)

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
Expand Down

0 comments on commit 1b799d5

Please sign in to comment.