[wp-trac] [WordPress Trac] #37038: WP_Tax_Query needs caching
WordPress Trac
noreply at wordpress.org
Tue Jun 20 22:26:27 UTC 2017
#37038: WP_Tax_Query needs caching
--------------------------+--------------------------
Reporter: spacedmonkey | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.9
Component: Query | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
--------------------------+--------------------------
Comment (by spacedmonkey):
- I like that the tax query using fields=>'all'. I think it adds a little
overhead, but it always primes term caches. I feel like it highly likely
that you would using a post's terms in a loop. Like displaying a post
categories. That could be a performance win down stream.
- Allow filters is great, it adds an array of filters in play for tax
query, which currently has no hooks in it. A massive benefit.
- Might be worth testing this patch alongside #37189 as they are somewhat
related.
- On line 579 (in class-wp-tax-query.php) hierarchical taxonomies query by
term_id. Correct me if I am but if term splitting is complete, then tt_id
and term_id should be the same. Could we do something like this.
{{{#!php
$field = (get_option('finished_splitting_shared_terms', false) ) ?
'term_taxonomy_id' : 'term_id';
$this->transform_query( $query, $field );
}}}
This may save another query or hit existing caches.
Otherwise I think we are there.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37038#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list