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后的字段建立索引,但是索引会影响数据的插入更新速度,
普通索引可以在建表的时候创建 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后的字段建立索引,但是索引会影响数据的插入更新速度,
相关文章推荐
- MySQL数据库InnoDB引擎下服务器断电数据恢复
- MySQL load语句详细介绍
- MySQL查询表内重复记录
- [MySQL]-->询5 几天之内解决在新年发行一个同事的生日过程
- MySQLの理解备份选项
- MySQLの执行MySQL备份
- MySQLのMySQL备份
- mysql sql优化
- mysql sql优化及注意事项
- MySQL:索引工作原理
- sql server 转 mysql
- mysql,多对多的hibernate操作对应的jdbc操作
- MySQL什么的
- mysql使用知识点总结
- mysq中的子查询
- 关掉mysql中sleep程序
- mysql部署到云主机的笔记
- MySQL数据文件及常用工具
- my.ini文件配置mysql字符集
- 关于mysql中文乱码问题的解决