[buddypress-trac] [BuddyPress] #4041: Use SELECT FOUND_ROWS() for 'total' queries instead of a second query

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Feb 24 12:40:27 UTC 2012

#4041: Use SELECT FOUND_ROWS() for 'total' queries instead of a second query
 Reporter:  boonebgorges    |       Owner:  DJPaul
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  1.6
Component:  All Components  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |

Comment (by boonebgorges):

 webraket - Thanks for the pointer. WordPress uses SELECT FOUND_ROWS() in
 WP_Query - have you found similar performance issues?

 I would like to benchmark this before moving forward with any broad
 changes. Someone should write a script that will write a few million
 records into the activities table (I will do it this weekend if I get a
 chance) and then test webraket's patch for the activity query against
 SELECT FOUND_ROWS(). If they are close or the same, we should go with
 SELECT FOUND_ROWS() (all things being equal, it's better to do what WP
 does, better to hand work off to the DB, better to have fewer queries).
 But if we find that webraket's results are reproducible, then we should
 probably think about keeping what we currently have in place, at least for
 components (like Activity) where the table is liable to get very, very,
 very large.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4041#comment:4>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list