DEV Community

Discussion on: Performance Guide to create 100k records in less than 3s using Ruby on Rails

Collapse
 
btrewern profile image
Ben

If you really want fast imports into PostgreSQL then copy is your friend. There is a gem called activerecord-copy that should be useful. It again does not go through validations or callbacks but could be up to 3-4 times as fast as .insert_all / .upsert_all.

Collapse
 
just-the-v profile image
Just The V

Hi Ben! Thanks for your feedback.

You're completely right, I already used this alternative, but I wanted to do a separate article for this one as the performance are very above the other alternatives.