changing Guid(UniqueIdentifier) columns to Varchar - Indexing.

  • I started a new job for a company that needed serious work on thier database schemas. I noticed major problems, but one in particular is many tables use UniqueIdentifiers AND clustered keys on those columns.

    With millions of records inserted all the time, the overhead is outrageous. I want to Add a BigInt for a temporary placeholder for a TableID. Then change the datatype from UnqueIDentifier To VarChar so I can replace the Guid's with the new ID I have stored in the added column, once that is complete I will change it back to BigInt to remove the space. .

    My quesion is when I make that datatype change will the already clustered index resort the records even though they are already in physical order because the clustered index has been in play the whole time..?, And is there a way to NOT resort after I appply the change if it thinks it needs to..??

    Bascially I will be adding temporary ID columns to all the tables for this change, chagne the GUID types to VarChar then slowly replace the guid's with the numeric values temporary ID column, eventually removing the remporary ID column altgoether.

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply