bp_activity user count
We’re getting a long running query from:
SELECT COUNT(user_id) FROM wp_bp_activity WHERE component = ‘members’ AND type = ‘last_activity’ AND user_id NOT IN (28974,30626,50225,66864,77511,78706,107191,110540,110849…
primarily because we have a large number of users who have been identified as spam and the userids in the NOT IN clause continues to grow.
This is generating a KILLED QUERY and is impacting performance:
[Wed Sep 13 09:44:06.049075 2017] [:error] [pid 21222] [client 255.155.155.33:13537] KILLED QUERY (35798 characters long
Would it be possible to rewrite this query so that it is inclusive and filters out the unwanted userids instead of it being the exclusive query that it is now?
This query is in wp-content/plugins/buddypress/bp-members/bp-members-functions.php:762)
We are using WP version 4.7.5 and buddypress version 2.8.2
- You must be logged in to reply to this topic.