[buddypress-trac] [BuddyPress] #5210: Using DISTINCT in the select statement when retrieving activity data slows down the query
buddypress-trac
noreply at wordpress.org
Mon Oct 28 13:26:11 UTC 2013
#5210: Using DISTINCT in the select statement when retrieving activity data slows
down the query
-------------------------------+--------------------
Reporter: kwerri | Owner:
Type: enhancement | Status: new
Priority: high | Milestone: 2.0
Component: Activity | Version: 1.8.1
Severity: major | Resolution:
Keywords: reporter-feedback |
-------------------------------+--------------------
Changes (by boonebgorges):
* priority: normal => high
* severity: normal => major
* milestone: Awaiting Review => 2.0
Comment:
Thanks very much for the feedback, kwern. As I suspected, the real issue
here is not so much the DISTINCT + ORDER BY (there's not much we can do to
avoid this), but the fact that our query is not optimized in other ways.
As we did in the case of users and `BP_User_Query` (and as WP did with
`WP_Query`), we should split our query into two parts: one that fetches
activity IDs, and another that separately fetches data about the located
items. This will allow our table indexes to function properly.
I've been wanting to do something like this for a while, and your ticket
is a good impetus to work on it for 2.0.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5210#comment:6>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list