Let’s assume that we are building a high traffic site that will be used by millions of people, and we have used the default Membership Provider that comes with MVC’s default project with all of the membership infrastructure in place, with roles and everything which is nice.
But by default the primary id of the user created in the database is NEWID(), and it’s being used everywhere in the project.
Assuming we are talking about very busy site, are there any performance issues i am looking down the road with using NEWID() as my primary key? Is it even worth my time to convert everything into INT?
Just so you know, the clustered index on the [aspnet_Users] table is created on the unique username and not on the userid (NEWID).
Thanks!
If you’re using GUIDs fore your clustered index, consider using NEWSEQUENTIALID() instead of NEWID(). Using the latter will lead to fragmentation in the clustered index because it generates GUIDs in an essentially random order.