Note that you can combine any of the solutions suggested above
with "%seenKey" hash, so you can at least know if _this instance_ of the loader has already seen a particular key and go directly to the update branch in that case.
Mike
Comment on Re: Of Mysql, DBI and PK best practices