The admin/user/user page shows a pageable, sortable table of all users. However, for the users.created column, there is no database index. The resulting queries require a full table sort to perform, so on a site like drupal.org that page can take ages to load (and users.created is the default sort order!). This is easily verified with an EXPLAIN query.

The attached patch adds an index on users.created and contains an update for existing installs.

Because this is a rather serious 5.0 performance issue for that page, it should be backported (so that drupal.org can use it, for example).

The attached patch is for HEAD, but also includes an update for 5.0. I created a "5.x extra updates" section in system.install which starts at the same number where "4.7 to 5.0" left off. The "5.x extra" update sets a variable which is checked by the HEAD update to avoid performing the queries twice when 5.x users finally update to 6.x.

The 5.x version of this patch is below and only includes the 5.x update.

CommentFileSizeAuthor
#1 users_created_5.patch1.74 KBSteven
users_created_head.patch2.46 KBSteven

Comments

Steven’s picture

StatusFileSize
new1.74 KB

5.x

killes@www.drop.org’s picture

Makes sense to me. Didn't try to run the code, yet.

dries’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. Feel free to commit.

Steven’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD and 5.

Anonymous’s picture

Status: Fixed » Closed (fixed)