[buddypress-trac] [BuddyPress Trac] #5572: last_activity migration function is unnecessarily slow

buddypress-trac noreply at wordpress.org
Tue Apr 22 01:03:31 UTC 2014


#5572: last_activity migration function is unnecessarily slow
--------------------------+-------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.0.1
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-------------------
 `bp_last_activity_migrate()` uses a `NOT IN` clause to prevent duplicates.
 https://buddypress.trac.wordpress.org/browser/tags/2.0/bp-members/bp-
 members-functions.php#L998 This was mainly added to help with testing of
 repeated migrations. It turns out that the clause slows down migrations by
 a large amount on large installations, because the `NOT IN` subquery
 returns so many results.

 I'm proposing a change that will alter `bp_last_activity_migrate()` so
 that uniqueness is enforced by deleting all existing `last_activity` data
 in the activity table before migrating the new content over. This should
 not cause any problems, because BP mirrors the data (so it could even be
 run later, via the Tools panel).

 In my tests, the query speed is dramatically increased.

 Posting here for feedback.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5572>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list