LoweredUserName 的目的?
除了 aspnet_Users 表中的 UserName 列之外,还拥有 LoweredUserName 列的目的是什么?
What is the purpose of having LoweredUserName column in addition to UserName column in aspnet_Users table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
区分大小写的数据库查询比不区分大小写的数据库查询性能更高。
由于用户名被视为自然键,因此许多查找将基于用户名而不是 GUID(例如,考虑登录)。
小用户表的性能提升将是微乎其微的,但随着用户群的增长,性能提升将更加突出。
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.
我认为这更多的是 SqlServerMembershipProvider 的实现细节,而不是 ASP.NET 安全性方面的某种实践。如果在创建用户时进行一次 LOWER 操作,然后再与参数值进行比较,可能会影响总体性能。在这种情况下,您只需降低参数值。
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.