« first day (954 days earlier)      last day (3920 days later) » 

6:17 AM
Sanity check:
I have a non unique clustered key on an integer and I have a primary key on another integer identity column.
Should I add the primary key as a second column in the clustered key or not?
Using both columns in the clustered key gives 4 + 4 bytes. Using a non unique key gives 4 byte plus a 4 byte uniquifier and an extra 2 bytes because the uniquifier is variable length.
10 bytes for the non unique clustered key and 8 bytes for the two column unique clustered key plus that the primary key values will be part of every non clustered key seams like a no-brainer but I might have misse
 
6:42 AM
The table has (will soon have) about 800,000,000 rows ever increasing and there are about 1,000,000 unique values in the clustered key column and there are 4 more non clustered keys. So size matters here.
Currently watching The Clustered Index Debate
 
@MikaelEriksson Seems like a no-brainer to me too.
 
6:57 AM
@PaulWhite Half way through the video I see that my calculations is not really accurate. There are 2 more bytes added by the uniquifier for "end of row". So I think it is time for a change here. And long due since I designed it like this from the start, 12 years ago.
 

« first day (954 days earlier)      last day (3920 days later) »