[wp-trac] [WordPress Trac] #55360: Add limit to query in WP_Tax_Query

WordPress Trac noreply at wordpress.org
Tue Mar 15 16:30:55 UTC 2022

#55360: Add limit to query in WP_Tax_Query
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Taxonomy                  |     Version:  4.7
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
Changes (by spacedmonkey):

 * keywords:  has-patch => has-patch has-unit-tests


 I recommend testing this ticket along side #55352.

 With this change in place, it means that the early call to `get_term_by`
 populates the cache for the taxonomy query. This means one less query per
 page on tag pages.

 Even without this benefit, limiting the query, makes the query return
 first, as SQL, stop processing once the limit is meet.

Ticket URL: <https://core.trac.wordpress.org/ticket/55360#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list