Wednesday, December 19, 2012

Why indexes may hurt performance of mysql DB incase of INSERT statements?

Indexes slow down INSERTS because of the overhead required to update the index, but an update might not hurt depending on whether the update is changing the index or not.
Updates that don't change indexes won't incur that extra overhead.
An update is actually a combination of a read and a write.  If the read uses the index and the update doesn't change it, the update might even be faster instead of slower. 

No comments:

Post a Comment