简体   繁体   English

为什么wordpress不为`wp_users`.`user_login`创建唯一索引?

[英]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.

相关问题 WordPress 数据库错误:[表 'databasename.wp_users' 不存在] SELECT * FROM wp_users WHERE user_login = 'Username' - WordPress Database Error: [Table 'databasename.wp_users' doesn't exist] SELECT * FROM wp_users WHERE user_login = 'Username' WordPress在wp_users中插入新用户 - WordPress insert new user in wp_users wp_users数据库和Wordpress中的用户身份验证 - wp_users database and user authentication in Wordpress WordPress-我无法登录-wp_users表出了问题 - WordPress - I can't login - Something wrong with the wp_users table 在Wordpress中的wp_users表中自定义user_nicename - Customizing user_nicename in wp_users table in wordpress 如果用户已经存在于 wordpress db 的 wp_users 表中? - If user already exists in wp_users table of wordpress db? 如何检查 WordPress 中是否存在 user_login 并通过附加到现有 user_login 以编程方式创建新用户 - How to check if existing user_login in WordPress and create new user programatically by appending to an existing user_login wordpress CMS中wp_users的用户状态字段中的1是什么意思? - what is the meaning of 1 in user status field of wp_users in wordpress CMS? 新用户注册时,如何在wp_terms中插入wp_users->用户登录名? - How to insert wp_users ->user login name to wp_terms when a new user registering? 如何使用表 wp_users 作为登录名? - How to use table wp_users as login?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM