您的位置:首页 > 数据库 > MySQL

mysql索引之普通索引

2015-09-15 10:01 423 查看
1,普通索引的创建

  普通索引可以在建表的时候创建 sql :

create table temp2(id int(10) not null auto_increment ,title varchar(10) not null, content varchar(10) not null,primary key (`id`),index(title,content)) engine = MYISAM;

2,sql :

alter table temp2 add index title (title);

3,sql :

  create index title on temp2(title);

删除索引

  drop index title on temp2;

查看索引

  show index from temp2;

普通索引的使用方式,一般在对筛选条件比较多的where后的字段建立索引,但是索引会影响数据的插入更新速度,
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: