So I currently am trying to insert a row into a MEMORY table but only if the primary key doesn't already exist.
I'm using INSERT IGNORE but I was reading, much to my surprise, that INSERT IGNORE is actually slower than INSERT ... ON DUPLICATE KEY, but that letting the regular INSERT just fail is faster than both of them.
In this particular case, it's a MEMORY table (as mentioned), and I am expecting the primary key already exists 90% of the time. In that case, does it make more sense to use INSERT and let the MySQL error out as opposed to using INSERT IGNORE? Are there any other things I need to consider here, such as a write in the file system error log no longer making it faster than INSERT IGNORE?