欢迎投稿

今日深度:

mysql的索引,

mysql的索引,


什么是索引


为什么要建立索引


优势


劣势


索引分类


索引为什么能快速查找数据

基本语法

创建索引

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)

索引建立选择

适合建立索引

www.htsjk.Com true http://www.htsjk.com/Mysql/42964.html NewsArticle mysql的索引, 什么是索引 为什么要建立索引 优势 劣势 索引分类 索引为什么能快速查找数据 基本语法 创建索引 create [UNIQUE] index 索引名称 ON 表名(字段(长度))alter 表名 add [unque] index[索...
相关文章
    暂无相关文章
评论暂时关闭