[wp-trac] [WordPress Trac] #8071: Refrain from querying all the comments on a post when paged
WordPress Trac
noreply at wordpress.org
Thu Oct 1 03:57:55 UTC 2015
#8071: Refrain from querying all the comments on a post when paged
--------------------------------------+---------------------------
Reporter: markjaquith | Owner: boonebgorges
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.4
Component: Comments | Version: 2.7
Severity: normal | Resolution: fixed
Keywords: dev-feedback needs-patch | Focuses:
--------------------------------------+---------------------------
Comment (by boonebgorges):
In [changeset:"34730"]:
{{{
#!CommitTicketReference repository="" revision="34730"
Prevent extra db queries in `WP_Comment::get_children()`.
`WP_Comment_Query::fill_descendants()` queries for a comment tree in a way
that
minimizes database overhead, and places the located descendants with their
proper parents. However, it doesn't touch leaf nodes - comments with no
children - so future calls to `get_children()` on those comment objects
result in unnecessary database queries. To prevent this,
`fill_descendants()`
now sets a `populated_children` flag on all located `WP_Comment` objects.
See #8071.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/8071#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list