I downloaded the zip file, but I was not really able to repro the problem with the incorrect estimate. The database does not have the dates in the original post of the thread.
But here is a question which may be really stupid, but looking at your queries, I think: why don't you split this funny DatumID it is date component and the version component. The you define a unique filtered index on (DatumID) WHERE LastVersion = 1.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
No comments:
Post a Comment