I have a database application in production, and all the tables use GUID primary keys which are currently set as the clustered indexes. I understand that this is a poor design due to performance considerations. I have been reading much on the topic, including this great article by Kimberly Tripp.
Can I improve the performance by simply creating an auto-incrementing index column of type INT
and setting it to be the clustered index? I understand from Kimberly's article that all non-clustered indexes (like my GUID primary keys going forward, if I do this) will reference the clustered index. But will this actually improve performance if I'm searching for a record using the GUID primary key in the WHERE
clause?
Also, will I have to populate the new column for existing records in the natural order of when the records were created in order to achieve a performance gain?
EDIT: To address whether this question is a duplicate of this other question: the other question is asking about the best practices in general regarding performance considerations for the use of a GUID primary key. No specific approaches are discussed. My question, on the other hand, is asking specifically whether adding an auto-incrementing index column of type INT
will help to ameliorate the issues with a GUID primary key. Furthermore, my question then asks whether I will have to populate the new column in their "natural order" to realize the benefits, which, again, is not addressed in the other question due to its higher level of generality.