mysql的索引,
什么是索引
为什么要建立索引
优势
劣势
索引分类
索引为什么能快速查找数据
基本语法
创建索引
create [UNIQUE] index 索引名称 ON 表名(字段(长度))
alter 表名 add [unque] index[索引名称] on(字段(长度))
查看索引
show index from 表名
删除索引
drop index[索引名称] on 表名
更改索引
优势
劣势
索引分类
索引为什么能快速查找数据
基本语法
创建索引
create [UNIQUE] index 索引名称 ON 表名(字段(长度))
alter 表名 add [unque] index[索引名称] on(字段(长度))
查看索引
show index from 表名
删除索引
drop index[索引名称] on 表名
更改索引
索引分类
索引为什么能快速查找数据
基本语法
创建索引
create [UNIQUE] index 索引名称 ON 表名(字段(长度))
alter 表名 add [unque] index[索引名称] on(字段(长度))
查看索引
show index from 表名
删除索引
drop index[索引名称] on 表名
更改索引
基本语法
创建索引
create [UNIQUE] index 索引名称 ON 表名(字段(长度))
alter 表名 add [unque] index[索引名称] on(字段(长度))
查看索引
show index from 表名
删除索引
drop index[索引名称] on 表名
更改索引
create [UNIQUE] index 索引名称 ON 表名(字段(长度))
alter 表名 add [unque] index[索引名称] on(字段(长度))
show index from 表名
drop index[索引名称] on 表名
添加一个主键,索引必须是唯一索引,不能为NULL
alter table tab_name add primary key(column_list)
创建的索引是唯一索引,可以为NULL
alter table tab_name add unque index_name(column_list)
普通索引,索引值可出现多次
alter table tab_name add index index_name(column_list)
全文索引
alter table tab_name add fulltext index_name(column_list)
索引建立选择
适合建立索引
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。