小编dre*_*012的帖子

使用 OR 运算符的单个查询与使用等于运算符的多个查询

案例 1 - 在 where 子句中使用 OR 运算符的单个查询:

select * from users where name='smith' or nick='smith' (using index_merge )
Run Code Online (Sandbox Code Playgroud)

案例 2 - 在 where 子句中使用 equals 运算符的多个查询:

select * from users where name='smith'; (using single index);

select * from users where nick='smith'; (using single index);
Run Code Online (Sandbox Code Playgroud)

:在案例 2 中是否有任何性能损失?

mysql index where

6
推荐指数
1
解决办法
1814
查看次数

标签 统计

index ×1

mysql ×1

where ×1