0

bulk update like this:

update table_name set price='x1' where sku='x1'; #updated because sku=x1 exist
update table_name set price='x2' where sku='x2'; #ignored because sku=x2 does not exist
update table_name set price='x3' where sku='x3'; #ignored because sku=x2 does not exist
  ...about 10000 lines...

some lines did not update anything because they do not exist, I want to know, would they make mysql slow OR just affect nothing?

Mil0R3
  • 3,876
  • 4
  • 33
  • 61

1 Answers1

1

If you have an index on sku, then the updates should have reasonable performance. If they are in a single transaction, then the performance should be okay.

However, you would be better off putting the new data into a table and using a join for the update.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786