Skip to content
This repository
Browse code

explains the order in which records are fetched by find_each

  • Loading branch information...
commit 60644467527bf2ffb45148b80f572a11a73f6e56 1 parent 8ac0e63
Xavier Noria fxn authored
2  railties/guides/source/active_record_querying.textile
Source Rendered
@@ -809,7 +809,7 @@ To be able to iterate over big sets of rows like that Active Record provides +fi
809 809
810 810 Behind the scenes +find_each+ fetches rows in batches of 1000 and yields them one by one. The size of the underlying batches is configurable via the +:batch_size+ option.
811 811
812   -The +:start+ option allows you to configure the first ID of the sequence if the lowest is not the one you need. This may be useful for example to be able to resume an interrupted batch process if it saves the last processed ID as a checkpoint.
  812 +Records are fetched in ascending order on the primary key, which must be an integer. The +:start+ option allows you to configure the first ID of the sequence if the lowest is not the one you need. This may be useful for example to be able to resume an interrupted batch process if it saves the last processed ID as a checkpoint.
813 813
814 814 +find_each+ accepts the same options as +find+ except for +:order+ and +:limit+. Those two are needed internally and if the options argument include any of them an exception is raised.
815 815

0 comments on commit 6064446

Please sign in to comment.
Something went wrong with that request. Please try again.