MySQL表中加一个字段并添加了Index索引,现在把字段删除后对该字段的索引是否还存在?若存在,后期要怎么删除该索引?
附上执行的sql语句:
ALTER TABLE `mytab` ADD COLUMN `is_export` enum('yes','no') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'no' COMMENT '是否已经导出' AFTER `start_time`;
CREATE INDEX `is_export` ON `mytab`(`is_export`) USING BTREE ;
ringa_lee2017-04-17 11:27:54
http://dev.mysql.com/doc/refman/5.6/en/alter-table.html
If columns are dropped from a table, the columns are also removed from
any index of which they are a part. If all columns that make up an
index are dropped, the index is dropped as well.
So for your question, after the field is deleted, the index of the field does not exist anymore