Piotr Zadrożny

Ruby on Rails developer, entrepreneur, algorithms enthusiast

Bulk insertion of data with ActiveRecord and activerecord-import gem

If you ever had to implement a script for importing data, for example from some csv, then you probably know that simple creating objects one by one is quite ineffective. Even if you don't have callbacks or validations, it will be very slow. Each create will cause one insert and each insert will be executed inside a separate transaction. There are few different ways to improve it.

Continue Reading »