I have to update a table primary key identity index column from INT
to BIGINT
.
Background information:
- The column is an identity column
- The column is a primary key
- The index is a clustered index
- Table is partitioned
- There are currently 111 partitions
- The this is the column that the table is partitioned on
- Just under 1TB data space taken up
- Just under 400GB index space taken up
- Actual row count stands at just under 1.4B rows but the identity increment is higher as some rows have been deleted
- Currently it is SQL Server 2008 R2 but plan to have it on SQL Server 2016 at the time of the change
- There are over 40 foreign keys in other tables referencing this column
- Obviously since it is partitioned it is Enterprise Edition
- Rows are pretty wide with 81 other columns
- I would like to minimize the downtime as much as possible
- Values cannot change due to the 40+ foreign key but also there are a lot of manually inserted values in other tables that do not have a FK relationship.
- I have some amount of extra space I can work with, there is a lot but working with over 100TB of total files I have to be careful
- I can do this in a maintenance window
My current plan is to use the process outlined in https://dba.stackexchange.com/a/159251/44556 and covered in detail by Aaron Bertrand here: https://sqlperformance.com/2016/08/sql-indexes/widening-identity-column-4
Questions I have:
- Can I use the process outlined in the above link?
- Will this process need to differ given that it is partitioned table on that column?
- What else do I need to be aware of?
- Is there some alternate process I might consider that would be better? If so, why is it better?
There are a good number of posts regarding how to do the actual update process but I did not note any that referenced partitioned tables.
Snippet of the table definition: (artificially modified to protect the innocent) Note this is the SQL Server 2008 R2, prior to upgrade to 2016
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyDataRecord]
(
[JMyDataRecord_ID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
... 81 other columns
CONSTRAINT [PK_MyDataRecord_ID]
PRIMARY KEY CLUSTERED ([MyDataRecord_ID] ASC)
)
... other stuff like FK etc