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/metaCache.php

    r34270 r34310  
    1717            update_comment_meta( $cid, 'foo', 'bar' );
    1818        }
     19
     20        // Clear comment cache, just in case.
     21        clean_comment_cache( $comment_ids );
    1922
    2023        $q = new WP_Comment_Query( array(
     
    4245            update_comment_meta( $cid, 'foo', 'bar' );
    4346        }
     47
     48        // Clear comment cache, just in case.
     49        clean_comment_cache( $comment_ids );
    4450
    4551        $q = new WP_Comment_Query( array(
Note: See TracChangeset for help on using the changeset viewer.