In the user_relationships_update_5() function, the 'INSERT INTO ...' statement happens early in the function, before several table manipulation statements. I recommend moving the 'INSERT INTO ...' to the end of the list of queries.

As a point of reference, we ran tests with ~500,000 relationships (before the update). Executing the SQL statements associated with update_5, in the original order, took about 92 seconds. When we moved the INSERT to the end, they took only 58 seconds. That's a noticeable improvement, and every little bit helps when your site is down for maintenance.

Comments

prfctns6@gmail.com’s picture

Status: Active » Fixed

I committed this change in cvs revision 1.6.4.6, which you should get if you checkout/update branch DRUPAL-5--2.

While I was at it, I fixed a missing semicolon and a mismatched function name/call.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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