Open
Description
When using MySQL and loading yaml data, the tables are cleared via "TRUNCATE". This is a DDL statement in MySQL and seems to break the surrounding transaction in Rails. In consequence, the INSERT statements get very slow on my system.
Importing about 500.000 records takes two hours. When I replace the TRUNCATE by a DELETE statement, the surrounding transaction works fine and the import is done within minutes. The additional time for the DELETE instead of TRUNCATE is negligible. I thus suggest to either always use a "DELETE" statement or to put the transaction block around the "load_records" call.
I used rails 5.1.5 with mysql2 gem 0.4.10 to produce the issue.
Metadata
Metadata
Assignees
Labels
No labels
Activity