Query Performance with NULL

前端 未结 8 2050
失恋的感觉
失恋的感觉 2021-01-14 14:29

I would like to know about how NULL values affect query performance in SQL Server 2005.

I have a table similar to this (simplified):

ID | ImportantDa         


        
8条回答
  •  無奈伤痛
    2021-01-14 14:50

    NULL looks good to me as well. SQL Server has many kinds of indices to choose from. I forget which ones do this, but some only index values in a given range. If you had that kind of index on the column being tested, the NULL valued records would not be in the index, and the index scan would be fast.

提交回复
热议问题