in reply to Re: DBI Question: bulk insertion with Unique-key constraint
in thread DBI Question: bulk insertion with Unique-key constraint

But I need to pre-process some columns, otherwise some data got corrupted, like datetime format. So I guess I need at least to use Perl to go through the CSV file and adjust some columns like datetime format, save them into another file and then load data with MySQL. :)
  • Comment on Re^2: DBI Question: bulk insertion with Unique-key constraint

Replies are listed 'Best First'.
Re^3: DBI Question: bulk insertion with Unique-key constraint
by perrin (Chancellor) on Apr 24, 2008 at 21:20 UTC
    Yes, doing a pass on the CSV file with perl and generating another CSV file to pass to MySQL is still probably faster than loading it row by row.

    By the way, INSERT IGNORE or INSERT ON DUPLICATE UPDATE are both typically faster than REPLACE if you do need to do it row by row.