Make WordPress Core


Ignore:
Timestamp:
09/18/2015 07:27:39 PM (9 years ago)
Author:
boonebgorges
Message:

Split the comment query.

WP_Comment_Query now fetches comments in two stages: (1) a query to get the
IDs of comments matching the query vars, and (2) a query to populate the
objects corresponding to the matched IDs. The two queries are cached
separately, so that sites with persistent object caches will continue to have
complete cache coverage for normal comment queries.

Splitting the query allows our cache strategy to be more modest and precise, as
full comment data is only stored once per comment. It also makes it possible
to introduce logic for paginated threading, which is necessary to address
certain performance problems.

See #8071.
data is only stored once per comment, instead of along with

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/query.php

    r34212 r34310  
    16681668        $q1->query( array(
    16691669            'post_id' => $p,
     1670            'fields' => 'ids',
    16701671        ) );
    16711672
     
    16751676        $q2->query( array(
    16761677            'post_id' => $p,
     1678            'fields' => 'ids',
    16771679            'foo' => 'bar',
    16781680        ) );
Note: See TracChangeset for help on using the changeset viewer.