2-2 mysql
索引
show index from 表名;
创建
create table create_index(
id int primary key,
name varchar(10) unique,
age int,
key (age)
);
create index 索引名称 on 表名(字段名称(长度))
例:
create index age_index on create_index(age);
create index name_index on create_index(name(10));
- 删除索引:
drop index 索引名称 on 表名;
查看执行的时间
set profiling=1;
show profiles;
explain
select * from test_index where title='test10000'

浙公网安备 33010602011771号