Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose of LoweredUserName?

What is the purpose of having LoweredUserName column in addition to UserName column in aspnet_Users table?

like image 860
Gautam Jain Avatar asked Feb 16 '11 11:02

Gautam Jain


2 Answers

A case-sensitive database query is more performant than a case-insensitive one.

Since the username is considered a natural key, a lot of lookups will be based on the username instead of the GUID (think logging in, for instance).

The performance gain for small user tables will be marginal, but will be more prominent as your userbase grows.

like image 166
sanderd Avatar answered Oct 31 '22 05:10

sanderd


I would assume that it is rather the details of implementation of the SqlServerMembershipProvider, than a certain practice in terms of ASP.NET security. Probably, it influences general performance if you do LOWER operation once when the user is created, and later on just compare it with the parameter value. In this case, you'll have to lower only the parameter value.

like image 26
Yan Sklyarenko Avatar answered Oct 31 '22 07:10

Yan Sklyarenko