Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/12/2014 09:27:20 PM (10 years ago)
Author:
boonebgorges
Message:

Migrate user 'last_activity' data from usermeta to the activity table

Storing last_activity in usermeta caused severe bottlenecks on sites with
large user bases. The usermeta table has a tendency to get bloated. Its
option_value column is not indexed, and even if it were, it would not be
indexed properly for the kind of chronological sorting that BuddyPress was
using it for.

This changeset refactors all core last_activity user functionality, so that
the data is stored in the wp_bp_activity table (even when the activity
component is disabled).

For backward compatibility with plugins that reference last_activity metadata
entries, all last_activity data is retained in wp_usermeta, and new data will
be mirrored there until further notice.

See #5128

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-schema.php

    r7521 r7860  
    2424        $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
    2525
     26    // Activity Streams
     27    // Install tables even when inactive, to store last_activity data
     28    bp_core_install_activity_streams();
     29
    2630    // Notifications
    2731    if ( !empty( $active_components['notifications'] ) )
    2832        bp_core_install_notifications();
    29 
    30     // Activity Streams
    31     if ( !empty( $active_components['activity'] ) )
    32         bp_core_install_activity_streams();
    3333
    3434    // Friend Connections
Note: See TracChangeset for help on using the changeset viewer.