[wp-trac] [WordPress Trac] #30814: Large wp_postmeta table causes core database queries to become extremely slow.

WordPress Trac noreply at wordpress.org
Mon Dec 22 21:01:16 UTC 2014


#30814: Large wp_postmeta table causes core database queries to become extremely
slow.
--------------------------+------------------------------
 Reporter:  turkeybucket  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+------------------------------

Comment (by boonebgorges):

 This is helpful - thanks, turkeybucket. Can you share the code that's
 being used in the 'pre_get_posts' filter to generate this SQL? I'm
 guessing it's adding a meta_query that looks something like:

 {{{
 array(
     'relation' => 'OR',
     array(
         'key' => 'story_format',
         'value' => 'Long-Form Chapter',
         'compare' => 'NOT LIKE',
     ),
     array(
         'key' => 'story_format',
         'compare' => 'NOT EXISTS',
     ),
 ),
 }}}

 It'd be helpful for me to see the exact syntax being used, so I can run
 some comparisons of the SQL syntax generated in 4.0 and 4.1.

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


More information about the wp-trac mailing list