星空网 > 软件开发 > 数据库

存储过程效率优化总结——杨小辉

存储过程效率优化总结——杨小辉

1.字符串分割操作时,字符串长度达到20万级别时,性能会有明显下降应考虑其他处理方式。

2.当指定查询条件时,指定的参数格式最好与对应字段的格式相同,已避免查询系统自动转换格式导致索引失效。

1.在code=500234中,当code为字符串类型时,
应写为:code=’500234’

2.在dotime=’2016-04-04’中,dotime是为datetime格式,
应写为:dotime=convert(datetime,’2016-04-04’,120)

3.在指定查询条件时,尽量避免在条件中使用函数/!=/<>/等会导致索引失效的验证方法。

1.在charindex(‘123’,dwcode) = 1中,
应该写为 dwcode like ‘123%’

2.在isdel <> 9 中,应写为:isdel = 0
( isdel:0表示正常数据,9表示已删除数据)

4.在做if判断的时候,当出现多个条件时,可采用层叠写法,防止复杂的判断写在前面。

1.if(charindex(‘123’,dwcode) = 1 andisdel=0 )
可改为:
if (isdel=0) if(charindex(‘123’,dwcode) = 1)





原标题:存储过程效率优化总结——杨小辉

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

tiktok带货:https://www.goluckyvip.com/tag/81327.html
tiktok店铺:https://www.goluckyvip.com/tag/81328.html
tiktok怎么登录:https://www.goluckyvip.com/tag/81329.html
tiktok最新消息:https://www.goluckyvip.com/tag/81330.html
tiktok怎么下载安卓:https://www.goluckyvip.com/tag/81331.html
tiktok阿黑颜网红有哪些:https://www.goluckyvip.com/tag/81333.html
最新研究:亚马逊、沃尔玛、Temu和Shein卖家重合率不断攀升:https://www.kjdsnews.com/a/1836554.html
三清山好玩乜?:https://www.vstour.cn/a/365182.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流