在 SQL Server 中使用 ISNULL() 时是否有任何性能问题? [英] Is there is any Performance issue while using ISNULL() in SQL Server?
问题描述
我在 MS SQl server 2008 中使用 ISNULL
,因为我的表太大,使用 ISNULL
是否会对性能造成任何影响?.
I am using ISNULL
in MS SQl server 2008, since my table is too huge, whether using of ISNULL
may cause any thing to the performance ?.
提前致谢
推荐答案
如果您需要使用它,那么 ISNULL 与 COALESCE 或 CASE 等替代方案之间的任何差异都是微不足道的.不用担心
If you need to use it, then any differences between ISNULL and alternatives like COALESCE or CASE are minuscule. Don't worry about it
任何差异都来自于数据类型的处理方式.COALESCE/CASE 可以添加隐式数据类型转换,而 ISNULL 的规则更简单.
Any differences come from how datatypes are handled. COALESCE/CASE can add implicit data type conversions whereas ISNULL has simpler rules.
编辑
在 SELECT 列表中使用 ISNULL 来抑制 NULLS 是微不足道的.主要工作将在处理行和数据方面完成.额外的 ISNULL 将无法衡量:不要过早优化
ISNULL in the SELECT list to suppress NULLS is trivial. The main work will done in processing rows and data. An extra ISNULL won't be measurable: Don't optimise prematurely
这篇关于在 SQL Server 中使用 ISNULL() 时是否有任何性能问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!