老师,怎么验证or关键字后面的字段不会使用索引呢
来源:8-2 SQL语句的优化

慕田峪2061518
2020-02-04
我在mysql5.7、8.0上解释,或者在2000万表执行都看不出来
select * from t_test where val = ‘ffffed39-50e2-40a0-acd2-f522099f66f5’ or val=‘2a5da86e-78fb-4769-b2cf-e40d894c0e03’;
select * from t_test where val = 'fffffbe3-7823-49e2-9d4c-4adc63ce4cf5’
union ALL
select * from t_test where val = ‘2a5da86e-78fb-4769-b2cf-e40d894c0e03’;
写回答
1回答
-
神思者
2020-02-04
用explain关键字解释执行sql语句
022020-02-05
相似问题