So I have a csv file with approximately 4000 rows that I need read from a Rails app. I plan to have this import performed once or twice a week.
Using csv-mapper, I am able to perform this operation (Delete current table, repopulate/save) however it takes a long time.
What is the best way to bulk import a csv file in a situation like this?
Thanks!
I suggest creating multiple records at one time. Here is a similar question Rails inserting multiple records for single model
I suggest you don’t try to do all 4000 rows at once, but maybe break it down into smaller chunks of 10-20