Hi all -
I know this must be really easy to do, but I can’t for the life of me
figure it out.
I have about 100,000 rows I need to migrate over into rails using a
Right now, I select all of them out of the old database and do a series
new.col = old.col
Problem is each one is it’s own transaction. And it’s slow. I’d like
group them into sets of say 50-100 to speed things up a bit.
But the only example regarding transactions I can find are long the
Which doesn’t really help me.
What I want to do is start a transaction before I start looping then
a counter and every 50th time, commit, then open another one. Then have
I’ll deal with errors elsewhere… right now I just need it to go
I have a feeling I want begin_db_transaction and commit_db_transaction,
but I can’t figure out how to use them in the way I want.