mysql UPDATE statement – overhead for same values?

No, MySQL is smart and won’t be slower. Don’t go through the trouble of checking for that, MySQL will do it for you.

If you set a column to the value it currently has, MySQL notices this and does not update it. No write action is performed. (Source)

BUT,

MySQL can use the WHERE-clause on the column-to-update to determine which index to use (and thus which rows to examine), in which case it might speed up your UPDATE-operation. If your column is indexed, do include it.

Leave a Comment