From 1b799d51d3854f826b89baffc2d70c298d7144c2 Mon Sep 17 00:00:00 2001 From: Allen Fair Date: Fri, 6 Jun 2014 08:12:25 -0400 Subject: [PATCH] Releasing gem v0.4.3 Fixes --- README.rdoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.rdoc b/README.rdoc index 495011a..523a92e 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 @@ -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. @@ -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. @@ -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