[wp-trac] [WordPress Trac] #27571: WP_Comment_Query::query() querying for too much data

WordPress Trac noreply at wordpress.org
Fri Mar 28 15:25:50 UTC 2014


#27571: WP_Comment_Query::query() querying for too much data
--------------------------+-----------------------------
 Reporter:  mkilian       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  3.8.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Since [17667], the query() method of WP_Comment_Query not only fetches the
 comment data, but also the post data, if there are any constraints related
 to posts (like 'post_status' => 'publish' as used in the recent_comments
 widget, for example).

 This doesn't scale well if you've a lot of large posts with a lot of
 comments, and it may cause the database to use an unnecessary large amount
 of memory or creating large internal temporar tables.

 The attached patch should fix that (but it should be widely tested, in
 case any theme or plugin started to rely on the currently wrong
 behaviour).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27571>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list