I have a query similar to the following:
SELECT id FROM MyTable
WHERE eventCount > eventCutoff * eventFactor
eventCount and eventCutoff are defined as a smallint, and eventFactor as a float.
I have two questions: is there an implicit cast of eventCount to a float for the comparison? And if so, will this prevent me from effectively leveraging an index on eventCount?
CASE WHEN eventCount > eventCutoff * eventFactor THEN 1 ELSE 0 ENDto use an index. – Martin Smith Jan 22 at 9:40