(My)SQL performance: updating one field vs many unneccesary fields

Posted by changokun on Stack Overflow See other posts from Stack Overflow or by changokun
Published on 2011-06-23T13:40:29Z Indexed on 2011/06/23 16:22 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

i'm processing a form that has a lot of fields for a user who is editing an existing record. the user may have only changed one field, and i would typically do an update query that sets the values of all the fields, even though most of them don't change. i could do some sort of tracking to see which fields have actually changed, and only update the few that did. is there a performance difference between updating all fields in a record vs only the one that changed? are there other reasons to go with either method? the shotgun method is pretty easy...

© Stack Overflow or respective owner

Related posts about mysql

Related posts about Performance