79498237

Date: 2025-03-10 14:07:31
Score: 1
Natty:
Report link

I had a different, but possibly the same root cause. To sort the INDEX issue the only thing that worked was adding a new Date column which was something like [DateSmall] = CAST(DATETIME2 AS Date) So removing TIME. Of course this creates new issues, such as UTC vs local dates, but it did solve teh performance issue.

PS I did try tackling it as an ASCENDING KEY problem, which helped somewhat but only if I updated Stats with Full scan, which on a table with over 3 million inserts per day that wasn't really viable.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: David Singleton