我知道USE INDEX,IGNORE INDEX,FORCE INDEX这3个命令,分别是添加 USE INDEX 来提供你希望 MySQ 去参考的索引列表,就可以让 MySQL 不再考虑其他可用的索引。IGNORE INDEX让 MySQL 忽略一个或者多个索引。FORCE INDEX为强制 MySQL 使用一个特定的索引。哪有什么命令可以让mysql同时使用两个索引来进行查询吗?
光阴似箭催人老,日月如移越少年。
What does it mean? Do you want a joint index? Something like this:
alter table test add INDEX `sindex` (`aaa`,`bbb`,`ccc`)
aaa, bbb, ccc are the three columns of the test table
Mysql will merge the indexes. For relevant information in the manual, please see http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html
http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html
The answer above is to create a composite primary key. If you query, select group by a,b
What does it mean? Do you want a joint index? Something like this:
aaa, bbb, ccc are the three columns of the test table
Mysql will merge the indexes. For relevant information in the manual, please see
for details.http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html
The answer above is to create a composite primary key. If you query, select group by a,b