Why doesn't wordpress create an unique index for `wp_users`.`user_login`?
In this page, you c开发者_高级运维an see what I mean,
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.
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. As you point out, though, user_login column is indexed so that gives the performance advantages when querying that table.
Don't know wp, but maybe it needs to allow for multiple user_logins
with different user_status
?
精彩评论