Home > Database > Mysql Tutorial > mysql索引操作_MySQL

mysql索引操作_MySQL

WBOY
Release: 2016-06-01 13:43:18
Original
1350 people have browsed it

bitsCN.com
1 为表创建索单列索引   ALTER TABLE table_name ADD INDEX indexName (colname);
   创建多列索引  ALTER TABLE table_name ADD INDEX indexName1_indexName2 (colname1,colname2);
   这种联合创建多列的方式比分别创建多个单列索引的效率高,因为这种方式在查询时会真正联合使用索引    indexName1,indexName2,而多个单列的模式查询时只会用其中最严格的一个,达不到更好的高效 2 删除索引  ALTER TABLE table_name DROP INDEX indexName;   索引会引起添加、修改的查询操作时间、所以在没有常用查询的情况下最好不要用,取消索引 
  作者 jias_je bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template