alaa_wmde added a comment.
So we are one of two options: 1. use INSERT IGNORE (I'd keep it last resort) 2. query master first for existing records before insert. This we didn't want to do because it adds another query to master, but after thinking about it again, we are actually adding just another read query to 2 other queries (insert then read) that we will do anyway. In most cases, records that do not exist in replica, do not exist in master so we end up doing 2 reads and 1 insert on master in those most cases. The very sweet but very edge case (caused by replication) might be that we do only 1 read from master and get all records we want. Now the question for 2 is, how much worse it is to do 2 reads and 1 insert, compared to doing 1 read and 1 insert, given that the former will avoid duplicate entry errors altogether? TASK DETAIL https://phabricator.wikimedia.org/T226639 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: alaa_wmde Cc: hoo, Addshore, darthmon_wmde, WMDE-leszek, Lydia_Pintscher, Lucas_Werkmeister_WMDE, alaa_wmde, Aklapper, Ladsgroup, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Jonas, Wikidata-bugs, aude, Jdforrester-WMF, Mbch331, Jay8g, Krenair
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs