Query performance degradation on Date due to incompletely cached value
The internal structures used to implement equality indexes, btrees, cache
portions of the values of certain data types within their structure, to
avoid faulting in the actual object for some comparisons.
The code that caches Date instances was incorrect, resulting in the year
portion of the Date not being cached. This did not cause any functional
errors, but performance could be impacted as the Date object always had
to be faulted into memory for comparison.
Note that this is Date, not DateTime. DateTime values are not cached in
the btree, so in most cases Date will provide better performance.
Clustering the Dates involved in an index will reduce page demand and improve