I'm migrating a database from DB2 to MySQL. There are big tables, so it takes a huge amount of time. The question here is:
If there's a table with about 9 millions of records with InnoDB storage engine.
What of the next approaches would take less time?
Create the table without indexes, foreign keys or any constraints. Load the data. Alter table to set the constraints
Create the table with constraints and load the data.
In theory the load of the data on an indexed table is slower than on a non indexed table. But creating an index and foreign keys on big tables takes a lot of time.