Forum Moderators: coopster
What does this mean? For example, my table has four columns:
id
name
age
address
and only ID is an index. If I only update the value of age:
UPDATE tab SET age=age+1
or UPDATE tab SET age=20 WHERE id>200
does mysql still have to update the index?
Does mysql still have to update the index?
No - mysql only needs to update the index if one or more of the indexed columns is updated.
"When you update a table with an index, you have to update the index as well."
I found the document you were referring to - i think the author is trying to make a general point about the performance implications of inserts/updates/deletes when indexes are defined.