Is there any different in performance between the following:
(1) Two statements
INSERT IGNORE...
UPDATE...
(2) One statement
INSERT INTO...ON DUPLICATE KEY UPDATE
Note that while this question "INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE" asks about the difference between INSERT IGNORE and INSERT...ON DUPLICATE KEY UPDATE I'm more concerned about which of the above two patters (using one statement, or two) would perform better.
ON DUPLICATE KEY is faster than INSERT IGNORE, but failing with a duplicate key error is a lot faster
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With