Home > Database > Mysql Tutorial > 七、mysql索引选择_MySQL

七、mysql索引选择_MySQL

WBOY
Release: 2016-05-31 08:47:12
Original
964 people have browsed it
1.myisam,bdb,innodb,memory 单表至少支持16个索引2.create index id_index on emp (id) 为emp表创建一个名为id_index的id字段的索引3.drop index id_index on emp 删除emp表的id_index 索引4.explain xxxxxxx,可以查看相关的执行结果,用于优化表用5.最合适的索引列是“条件列”,而不是“选择列”  比如 select name from emp where year >= 2014;  那么最好是在year字段上创建索引,而不是name字段  6.使用索引的字段,字段值最好是具有唯一性的,因为越具有唯一性,索引意义越大7.btree索引通过索引访问,而hash索引则进行全表扫描
Copy after login

 

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