MySQL: Is it faster to use inserts and updates instead of insert on duplicate key update?
- by Nir
I have a cron job that updates a large number of rows in a database. Some of the rows are new and therefore inserted and some are updates of existing ones and therefore update.
I use insert on duplicate key update for the whole data and get it done in one call.
But- I actually know which rows are new and which are updated so I can also do inserts and updates seperately.
Will seperating the inserts and updates have advantage in terms of performance? What are the mechanics behind this ?
Thanks!