Leandro
refactor database to stop using UNIQUEIDENTIFIER as PK
So I didn't know enough of databases to know that it is not a good idea to use uniqueidentifiers as PK in MSSQL database. Now that I have a lot of records my queries are starting to become slow. I'm using Entity Framework.
What steps should I take to migrate my database to INT PK bearing in mind all the relationships between tables that already exists? I can't loose the relationships. I would still have a column like, "referenceKey" that I would use to access specific records in my database so I can prevent the guessing PK attack. But having INT as PK would allow me to create more efficient indices and whatnot, right?
Has anyone ever done such a thing? How should I proceed?
60 replies