Is there is any Performance issue while using ISNULL() in SQL Server?

后端 未结 8 1819
陌清茗
陌清茗 2020-12-15 06:51

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 ?.

Than

8条回答
  •  余生分开走
    2020-12-15 07:21

    Yes it can. For optimizer is better rewrite the query (if possible) to form

    (Field = @x OR @x IS NULL)
    

    Because using functions in certain cases prevents from optimizer to use statistics and sometimes forced implicit datatype conversions

提交回复
热议问题