mysql有什么命令可以让mysql同时使用两个索引
大家讲道理
大家讲道理 2017-04-17 15:21:18
0
3
1001

我知道USE INDEX,IGNORE INDEX,FORCE INDEX这3个命令,分别是
添加 USE INDEX 来提供你希望 MySQ 去参考的索引列
表,就可以让 MySQL 不再考虑其他可用的索引。
IGNORE INDEX让 MySQL 忽略一个或者多个索引。
FORCE INDEX为强制 MySQL 使用一个特定的索引。
哪有什么命令可以让mysql同时使用两个索引来进行查询吗?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (3)
伊谢尔伦

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 seehttp://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html

    for details.
      阿神

      The answer above is to create a composite primary key. If you query, select group by a,b

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!