[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:26:56 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 turkeybucket):
Here's the function being called by the pre_get_posts filter:
{{{
function sno_lf_exclusion( $query ) {
if( $query->is_main_query() && !is_admin() ) {
$meta_query = array(
'relation' => 'OR',
array(
'key' => 'story_format',
'value' => 'Long-Form Chapter',
'compare' => 'NOT LIKE'
),
array(
'key' => 'story_format',
'value' => 'Long-Form Chapter',
'compare' => 'NOT EXISTS'
)
);
$query->set( 'meta_query', $meta_query );
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30814#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list