Assume I've a sql statement like the following with the variable @FOO set somewhere earlier in code:
SELECT FIELDLIST
FROM TABLE
WHERE
(FIELD = @FOO OR @FOO IS NULL)
Is the query optimizer smart enough to do the second side of the OR first (@FOO IS NULL) because (another assumption) it is faster to do a null check than it is to do a field comparison?
I've done some informal benchmarking and not only do I not see a difference, I get different result times on my attempts which throws off the ability to do a proper comparison.