您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mysql索引index相关命令的详细介绍

2024/4/15 15:53:25发布19次查看
本文主要内容:
显示表中多有的索引show all index
添加索引add index, 添加唯一索引add unique index
多列联合添加索引,primary key
关键词index vs key
show all indexshow index from  tb_name 例如:
show index from springdemo.blog;
添加索引add index, 添加唯一索引add unique indexalter table `table` add index `product_id` (`product_id`) # 创建唯一索引alter table tb_name add unique index `unique_idsrc_caffeversion` (`id_src`, `caffe_version`)
多列联合索引,添加主键#多列索引alter table `table` add index `index_name` (`col1`,`col2`) # add primary key 添加主键alter table `table_name` add primary key ( `column` )
关键词index vs key在创建表的时候,这两个关键词没什么区别,相当于同义词
what are differences between index v.s. key in mysql
create table tasks ( task_id int unsigned not null auto_increment, index parent (parent_id), ....# however i found a code using key instead of index as following....key order_date (order_date) ...
there’s no difference. they are synonyms.this was implemented for compatibility with other database systems.
以上就是mysql索引index相关命令的详细介绍的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product