Query Performance with NULL

前端 未结 8 2059
失恋的感觉
失恋的感觉 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:53

    They do not have a negative performance hit on the database. Remember, NULL is more of a state than a value. Checking for NOT NULL vs setting that value to a -1 makes no difference other than the -1 is probably breaking your data integrity, imo.

提交回复
热议问题