【发布时间】:2017-01-12 20:19:15
【问题描述】:
我有一个表,其中有一个多列索引(名称、类型)。索引是否对像这样的查询有帮助
Select *
from [table_name] a
where a.name = '[some_name]' and a.type in ('1','2','3')
或者最好有类似的查询,
Select *
from [table_name] a
where a.name = '[some_name]' and (a.type = '1' or a.type = '2' or a.type = '3')
假设表有数百万条记录
【问题讨论】:
-
你可以自己回答这个问题,使用
EXPLAIN分析查询的索引使用情况。
标签: mysql indexing database-indexes