目录
建索引
普通索引
alert table student add index idx_age(age);
说明:为student表中的age(年龄)字段建一个普通索引idx_age。
组合索引
alert table student add index idx_time_name(create_time,name(8));
说明:为student表中的create_time(创建时间)、name(姓名)的前8位字符建一个组合索引idx_time_name。
目录
普通索引
alert table student add index idx_age(age);
说明:为student表中的age(年龄)字段建一个普通索引idx_age。
组合索引
alert table student add index idx_time_name(create_time,name(8));
说明:为student表中的create_time(创建时间)、name(姓名)的前8位字符建一个组合索引idx_time_name。