I noticed in
sys.column_store_segmentsthemin_data_idandmax_data_idcolumns store very large bigint values in the segments fordatetime2columns. After doing a bit more googling and tinkering, I found forbit/tinyint/smallint/int/bigintit stores the min/max of the actual values rather than dictionary lookup values. So I assume it’s likely doing the same fordate/time/datetime/datetime2and storing some sort of bigint representation of the actual value.This post is going to focus on
datetime2(7)datatypes mainly because that’s what I was dealing with. Though I’m sure it wouldn’t be much work to figure out the other types.
Click through to learn more about the datatype and see how this wraps into a discussion of temporal table cleanup and columnstore indexes.