(On MySQL, InnoDB) I am not directly checking if a certain record exists, instead I do that check lazily : I am normaly using INSERT ... ON DUPLICATE KEY UPDATE .... At some points of my code, the probability of an existing record is higher than absence of it, in that case I plan to do:
UPDATE ...- If
affected_rows<1 INSERT IGNORE INTO..
Would this perform better than using INSERT ... ON DUPLICATE KEY UPDATE ...?