[thelist] MySQL: importing non-duplicate records

John Hicks johnlist at gulfbridge.net
Thu May 11 11:36:40 CDT 2006


Canfield, Joel wrote:
> hmmm . . . mysqlimport with --ignore specified? will that do what I
> want?

I'm guessing it would be faster to write first to a temporary table and 
try to delete as much as possible before doing the insert/replace 
operation. (I'm thinking one delete on a table of 100,000 records will 
be faster than 100,000 inserts into an even larger table.)

If you have to do it from the command line (and not programmatically via 
PHP, Perl, etc.) you can use the 'mysql' utility with a script file.

--John



More information about the thelist mailing list