[wp-trac] [WordPress Trac] #24093: WP_Meta_Query is inefficient when referencing the same keys in "OR" query

WordPress Trac noreply at wordpress.org
Wed Jan 22 02:45:12 UTC 2014


#24093: WP_Meta_Query is inefficient when referencing the same keys in "OR" query
-------------------------------------------------+-------------------------
 Reporter:  sc0ttkclark                          |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Query                                |  Review
 Severity:  normal                               |     Version:  3.5.1
 Keywords:  needs-refresh meta-query needs-      |  Resolution:
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by kevinfodness):

 I wrote a patch that uses subqueries instead of JOIN operations and seems
 to be significantly more efficient. It should work fine for both OR and
 AND operations. I tested the patch on a relatively large site running
 WordPress 3.8.

 I'd be interested to get the opinions of core contributors and see the
 results of unit tests to determine if this is a workable solution.

 I posted a detailed writeup on my blog, here:
 http://kevinfodness.com/2014/01/21/performance-patch-for-wp_meta_query-in-
 wordpress-core/

 The patch itself can be found here: http://kevinfodness.com/wp-
 content/uploads/2014/01/wp_meta_query.patch

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


More information about the wp-trac mailing list