What is the better way to insert large data into multiple tables in DB from CSV with foreign keys?
I tried to import large csv file into multiple tables and I use the normal Mysql query with looping csv data, but it was very slow. Then I tried 'LOAD DATA' method.But it is only possible to insert data into a single table with same column order.
However, it will not work for because I need to insert data to multiple tables and need to use last
inserted id of one table to join another table.
Can anyone suggest a better way to upload data into multiple tables?
Here, I am using Zend Framework with Doctrine for handling database operations. However, from my understanding Doctrain is taking more time than normal MySQL query, that is the reason why I used direct MySQL Query.