[wp-trac] [WordPress Trac] #33376: Create index on user_email and UNIQUE on user_nicename, user_email and user_login

WordPress Trac noreply at wordpress.org
Fri Aug 14 22:17:50 UTC 2015


#33376: Create index on user_email and UNIQUE on user_nicename, user_email and
user_login
-------------------------+------------------------------------------
 Reporter:  chriscct7    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Future Release
Component:  Database     |    Version:
 Severity:  normal       |   Keywords:  has-patch dev-feedback early
  Focuses:  performance  |
-------------------------+------------------------------------------
 In order to improve performance, an index could be added on user_email
 (indexes already exist on user_login and user_nicename), to make it faster
 to query against.

 In addition, the db structure could be altered to add a UNIQUE constraint
 on user_nicename, user_email, and user_nicename for those columns on the
 wp_users table, which would improve performance when a site has many
 users, and eliminates to run a pre-insert SELECT check when inserting
 users.

 The patch attached adds the schema changes proposed which would apply to
 new installs automatically, as well as the upgrade routine for existing
 installs (though the db_version compared against would likely need to be
 altered by the time this could get merged).

 In addition to the performance improvements, this would also eliminate the
 chance of race conditions such as proposed by #30959.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33376>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list