The ASP.net membership provider user database uses uniqueidentifier as a primary key. Could this cause any problem with scalability for potentially millions of users?
The ASP.net membership provider user database uses uniqueidentifier as a primary key. Could this
Share
Using a GUID as primary (and thus by default clustering) key in SQL Server is a recipe for really bad performance. Due to the randomness of the GUIDs, they’ll lead to a heavy clustered index fragmentation on your table. If you have more than a few entries, you’ll have to constantly rebuild that clustered index to get even halfway decent performance.
So yes – I think using a GUID as your primary/clustered key in any database table of more than a few hundred entries is a really bad idea – and as the example shows, even certain Microsoft teams don’t seem to care about that and come up with bad designs.
Read more about the topic in the excellent series of blog post by Kimberly Tripp – the Queen of Indexing has great insights into why this is a horribly bad idea, and gives more pointers as to what would make a good clustered key: