So now that 1). we have our table and b). we have an index we can use, we can run the developer’s query and be SARGable right?
([Test_Date]) = @
Nope! Table scan, ignores our Index and reads all 15M (too lazy for all the zeros) for a measely 127,782 rows! It’s not the slowest, taking around 3.960 seconds but still, we want SARGable!!!
Watch for the surprise twist at the end.