I have a MySQL table with 140 columns and a txt file with about 80k lines, i.e. 7.5k entries(rows) for the table.
which would be faster?
“insert into myTable (<140 column names>) values (<140 column entries>);”
Shall i enter one whole row at a time(just one database transaction per row, but as there are 140 columns the lone insert statement will be very long)
or
“update myTable set = where =…;”
enter a column entry one by one(making many database transactions)
The fewer commits/queries that are ran, the faster it will be. Play around with different chunk sizes. E.g. insert x number of rows and commit. Repeat until all rows are done. Much of the performance is dependant on what triggers and indexes are configured on the table.