[英]Why doesn't wordpress create an unique index for `wp_users`.`user_login`?
In this page, you can see what I mean, 在此页面中,您可以了解我的意思,
http://codex.wordpress.org/Database_Description#Table:_wp_users http://codex.wordpress.org/Database_Description#Table:_wp_users
It only creates a normal index for the user_login
column while I think an unique index should be created for it. 它只为user_login
列创建一个普通索引,而我认为应该为其创建唯一索引。
Well since the unique index (primary key) is the ID column, the coder probably didn't see the need to define another column in the table as unique. 好吧,因为唯一索引(主键)是ID列,所以编码人员可能不需要将表中的另一列定义为唯一列。 As you point out, though, user_login column is indexed so that gives the performance advantages when querying that table. 但是,正如您所指出的那样,对user_login列进行了索引,以便在查询该表时提供性能优势。
不知道wp,但也许它需要允许多个具有不同user_status
user_logins
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.