[wp-trac] [WordPress Trac] #8071: Refrain from querying all the comments on a post when paged

WordPress Trac noreply at wordpress.org
Fri Sep 25 14:34:22 UTC 2015


#8071: Refrain from querying all the comments on a post when paged
------------------------------------+---------------------------
 Reporter:  markjaquith             |       Owner:  boonebgorges
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  4.4
Component:  Comments                |     Version:  2.7
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------------

Comment (by boonebgorges):

 In [changeset:"34544"]:
 {{{
 #!CommitTicketReference repository="" revision="34544"
 Improve pagination internals in `WP_Comment_Query`.

 `WP_Comment_Query` will now report the total number of comments matching
 the
 query params (`comments_found`), as well as the total number of pages
 required
 to display these comments (`max_num_pages`). Because `SQL_CALC_FOUND_ROWS`
 queries can introduce a lot of overhead in some cases, we disable the
 feature
 by default. Pass `no_found_rows=false` to `WP_Comment_Query` to enable the
 count. (We use the negative parameter name 'no_found_rows' for parity with
 `WP_Query`.)

 Props wonderboymusic, boonebgorges.
 See #8071.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/8071#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list