user_save(), even when inserting a new user, does a db_delete('user_roles') "just to be safe" - this is responsible for 1 of the 13 database queries we issue when saving a new user. Since it's impossible for a user to have any roles when this code executes, there's no reason for it to be there.

The same code, with the same comment, has been in there since 4.6.

CommentFileSizeAuthor
user_roles_no_op_delete.patch928 bytescatch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

be gone crufty cruft

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Performance

Automatically closed -- issue fixed for 2 weeks with no activity.