1
Vote

Query does not use index for NULL values

description

for 100.000 Objects and an index on name for a class Query:

Where(x => x.Name=="James") returns in 40 msec

Where(x => x.Name!=null && x.Name=="James") takes 920 msec

Trying a query

Where(x => x.Name=="James" || x.Name=="Peter") takes 1020 msec

So obviously the query engine only uses indexes when there is one constraint ?

comments