in reply to mysql's join too slow; using Perl to compare two tables

I think you should try to use INSERT ON DUPLICATE KEYS UPDATE statement. It checks if the data you want to insert is already there, if it is, update the columns instead of creating new record. With this you don't need to do any select query at all and it (theoritically) will increase performance because you only do one INSERT query. The only thing you need is to create a unique index for the fields you mention (author, etc).
--------------
badaiaqrandista
  • Comment on Re: mysql's join too slow; using Perl to compare two tables

Replies are listed 'Best First'.
Re^2: mysql's join too slow; using Perl to compare two tables
by srdst13 (Pilgrim) on Feb 06, 2006 at 12:17 UTC
    I hadn't seen this before. Nice little trick.
    Sean