Import CSV in batches of lines in Rails?

后端 未结 3 857
轮回少年
轮回少年 2021-01-15 03:43

I\'m using FasterCSV to import an uploaded file to a model, and it\'s working great for small files. However when I try to import a large dataset (21,000 lines) it takes age

3条回答
  •  感动是毒
    2021-01-15 04:20

    Try AR Import

    Old answer

    Have you tried to use AR Extensions for bulk import? You get impressive performance improvements when you are inserting 1000's of rows to DB. Visit their website for more details.

提交回复
热议问题