-
- for n in (0..node_count)
- Node.find(:all, :limit => 1, :offset => n).each do |node|
+ limit = 1000 #the number of nodes to grab in one go
+ offset = 0
+
+ while offset < node_count
+ Node.find(:all, :limit => limit, :offset => offset).each do |node|