Hi there,
currently, we note very high database load for queries from the Events Calendar plugin. We have about 5000 events within 15000 posts.
This query needs up to 25 seconds (!) for the first call, it’s fast for the second call as it’s in the query cache after 1st call.
SELECT COUNT( DISTINCT( ID ) )
FROM wp_posts
WHERE wp_posts.post_type = 'tribe_events'
AND wp_posts.post_status <> 'auto-draft'
AND ID NOT IN (
-- Find those posts that already have timezone meta data
SELECT DISTINCT ( post_id )
FROM wp_postmeta
WHERE meta_key = '_EventTimezone'
)
LIMIT 1;
Can you please think over replacing subselects with joins? Subselects like this are very expensive concerning performance.
Cheers Alex