[wp-trac] [WordPress Trac] #18105: Improve JOIN efficency of tax_query

WordPress Trac noreply at wordpress.org
Wed Oct 15 16:39:21 UTC 2014


#18105: Improve JOIN efficency of tax_query
-------------------------+---------------------------
 Reporter:  Otto42       |       Owner:  boonebgorges
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  4.1
Component:  Query        |     Version:
 Severity:  normal       |  Resolution:  fixed
 Keywords:               |     Focuses:
-------------------------+---------------------------
Changes (by boonebgorges):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"29902"]:
 {{{
 #!CommitTicketReference repository="" revision="29902"
 Avoid redundant table joins in WP_Tax_Query.

 IN clauses that are connected by OR require only a single table join. To
 avoid
 extraneous joins, keep track of generated table aliases, and let sibling
 clauses piggy-back on those aliases when possible.

 Introduces WP_Tax_Query::sanitize_relation() to reduce some repeated code.

 Adds unit tests to verify the JOIN consolidation, and integration tests
 for
 cases where JOINS are being combined.

 Props boonebgorges, otto42, jakub.tyrcha.
 Fixes #18105.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18105#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list