I'm getting an index seek on this, but it's taking up about 70 percent of my query time.
UPDATE #events SET orderNo = ei.orderNo
FROM #events e
JOIN eventItems_rob ei ON ei.eventValue = e.serviceID
WHERE e.orderNo = '[NONE]' AND ei.eventTime BETWEEN @fromDate AND @thruDate AND ei.orderNo <> '[NONE]'
AND (ei.event = 'ServiceAddedToOrder' OR ei.event LIKE 'Search-%')
AND ISNUMERIC(ei.eventValue) = 1
Guessing it's cause of the like?
I have a non clustered on orderno,event,eventime,eventvalue.
Any ideas, I can't use a literal in place of the like.
Should I try making it a clustered?