Skip to main content
update picture
Source Link
crokusek
  • 2.1k
  • 4
  • 24
  • 33

Replace dateadd() with datediff() to get an adequate approximate (30%ish).

 select distinct SessionId from [User].Session     -- 1.2M est, 3.0M act.
  where datediff(day, CreatedUtc, sysutcdatetime()) <<= 365

This appears to be a bug similar to MS Connect 630583.

Option recompile makes no difference.

enter image description herePlan Stats

Replace dateadd() with datediff() to get an adequate approximate (30%ish).

 select distinct SessionId from [User].Session     -- 1.2M est, 3.0M act.
  where datediff(day, CreatedUtc, sysutcdatetime()) < 365

This appears to be a bug similar to MS Connect 630583.

Option recompile makes no difference.

enter image description here

Replace dateadd() with datediff() to get an adequate approximate (30%ish).

 select distinct SessionId from [User].Session     -- 1.2M est, 3.0M act.
  where datediff(day, CreatedUtc, sysutcdatetime()) <= 365

This appears to be a bug similar to MS Connect 630583.

Option recompile makes no difference.

Plan Stats

Source Link
crokusek
  • 2.1k
  • 4
  • 24
  • 33

Replace dateadd() with datediff() to get an adequate approximate (30%ish).

 select distinct SessionId from [User].Session     -- 1.2M est, 3.0M act.
  where datediff(day, CreatedUtc, sysutcdatetime()) < 365

This appears to be a bug similar to MS Connect 630583.

Option recompile makes no difference.

enter image description here