Hi Mikel,
Thanks for the feedback. Much appreciated.
>I'm using cursors to walk a table with close to a million rows at times.
>
>I am just wrapping the action in a transaction and then declaring the
>cursor within the transaction and then walking the table with a
>find_by_sql with an SQL fetch command.
>
>It works well.
>
>Any reason you aren't doing it this way? Could just call it with a
block...
I /could/ use an SQL cursor but:
- I wanted to write a method that could be re-used by the other
developers on the team.
- our code base is polluted with SQL, ostensibly for "performance"
reasons. I'm trying to refactor out unnecessary SQL.
- raw speed is less important that ensuring that the production db
doesn't crash, ie it doesn't matter if the updates take an hour or two
once the live site doesn't slow down considerably. Our max # rows is 3.3
million.
I don't know if these are valid reasons however :)
Thanks for your suggested solution (transaction, cursor, find_by_sql &
fetch). I'll play around with it & see what I can do. Can't immediately
envision how to spec it though.
Keith
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users