Answer the question
In order to leave comments, you need to log in
Do mysql update queries use indexes?
When I try to check with explain it swears at the syntax.
Answer the question
In order to leave comments, you need to log in
and if you just write EXPLAIN SELECT with the same parameters for WHERE and see?
Used, of course, if the where clause allows it.
Indexes allow you to quickly select the desired rows, and what to do with them - update, delete, give to the client or use in the join - this is the tenth thing.
Even with an insert, an index is needed to check the uniqueness of the field value.
I would say that the indexes that participate in the update increase the update time =)
Uh ... what's stopping if you don't look at the source code, then at least read the manual?
“The speed of the write depends on the amount of data being updated and the number of indexes that are updated. Indexes that are not changed do not get updated .
dev.mysql.com/doc/refman/5.0/en/update-speed.html
If an indexed field is not affected during the update, the index is not rebuilt either. All indexes associated with updated fields will be rebuilt. Actually in it also there is a sense of indexes. And what part of the index will be rebuilt and how much effectively depends on the type of index used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question