请教一条SQL优化
大家好,我原来的一条语句:
select * from [T_user]
where classID='7066cb2fbb327377' and classNumID='5e08f3ac9efe64a1'
And ( phoneNum='310--' or phoneNum='-100-'
or phoneNum='--001' or phoneNum='31---'
or phoneNum='---01' or phoneNum='3----'
or phoneNum='-1---' or phoneNum='--0--'
or phoneNum='---0-' or phoneNum='----1' )
但是数据多了以后速度非常慢,请问怎么优化呀?
select * from [T_user]
where classID='7066cb2fbb327377' and classNumID='5e08f3ac9efe64a1'
And ( phoneNum='310--' or phoneNum='-100-'
or phoneNum='--001' or phoneNum='31---'
or phoneNum='---01' or phoneNum='3----'
or phoneNum='-1---' or phoneNum='--0--'
or phoneNum='---0-' or phoneNum='----1' )
但是数据多了以后速度非常慢,请问怎么优化呀?
...全文
相关推荐
Mysql查询最近一条记录的sql语句(优化篇)
主要介绍了Mysql查询最近一条记录的sql语句,非常不错,具有一定的参考借鉴价值,需要的朋友参考下吧
一条SQL引发的“血案”:与SQL优化相关的个案例(文末送书).docx
一条SQL引发的“血案”:与SQL优化相关的个案例(文末送书).docx
一条SQL引发的“血案”:与SQL优化相关的4个案例.docx
一条SQL引发的“血案”:与SQL优化相关的4个案例.docx
oracle下一条SQL语句的优化过程(比较详细)
很简单的一次调整,语句加了适当的索引后性能就有大幅的提升。当时看到这条语句的时候,第一感觉就是执行效率肯定低下。语句的功能是求某一客户当天产品的总销量。
优化一条千万级别数据的SQL语句
一张千万级别user表,涉及到的列id, name, sexcreate_time,id为主键。当前sql如下: select * from user where create_time between '2020-01-01' and '2023-0101' limit 5000000,100 是否存在优化空间?



