SQL服务器中isnull和like语句的性能问题 [英] Performance issue with isnull and like statement in SQL server

查看:109
本文介绍了SQL服务器中isnull和like语句的性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在where子句中我可以使用其中任何一个 -

In where clause i can use either of them-

(@BROKERID IS NULL OR A.BROKERID like @BROKERID)






or

A.BROKERID=isnull(@BROKERID,A.BROKERID) 



(实际上第一个已经写好了,我想将条款改为第二个。)



任何人都可以帮助我理解,哪个会有更好的表现,为什么?

我正在使用SQL Server 2008 R2。



谢谢!!



我尝试了什么:



我试图使用第二个选项,但到目前为止还无法测试性能。


(Actually first one is already written and i want to change the clause to second one.)

Can anyone help me to understand ,which will have better performance and why?
I am using SQL server 2008 R2.

Thank you!!

What I have tried:

I have tried to use the second option, but not able to test the performance till now.

推荐答案

SQL Server或查询性能取决于许多fac职权范围。请参阅: SQL查询性能 [ ^ ]



结论:我们无法回答这个问题,因为这是基于意见的答案。
SQL Server or query performance depends on many factors. See: SQL query performance[^]

Conclusion: we can not answer such of question, because it would be opinion based answer.


这篇关于SQL服务器中isnull和like语句的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆