I have a table with the following schema:
CREATE TABLE IF NOT EXISTS `feeds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`external_id` varchar(255) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`notes` text,
`image_id` int(11) DEFAULT NULL,
`location_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9046 ;
I am creating indexes on external_id and location_id they are meant to be used separately for different queries that effect the table. I understand that MySQL will have to rebuild the indexes every time a record is added or updated or deleted. What I cannot figure out is if updating the name field of a record in this table will cause either or both indexes to be rebuilt. Also, I am wondering, it is the case that these two separate indexes can exist on this table without effecting each others performance negatively? Thank you for your time.
The indexes are not “rebuilt”, but they are updated. Altering data in columns that are not indexed should not result in any re-indexing activity.