I noticed in
sys.column_store_segments
themin_data_id
andmax_data_id
columns store very large bigint values in the segments fordatetime2
columns. After doing a bit more googling and tinkering, I found forbit
/tinyint
/smallint
/int
/bigint
it 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
/datetime2
and 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.
Comments closed