Slow queries overloading server
-
Through a lot of research, we’ve found that the below query is causing over 100 minutes of MySQL time / day, which is well above the allowed limit on our hosting.
SELECT SQL_CALC_FOUND_ROWS (wp_tec_occurrences.occurrence_id + 10000000) as occurrence_id FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = '_EventHideFromUpcoming' ) JOIN wp_tec_occurrences ON wp_posts.ID = wp_tec_occurrences.post_id WHERE 1=1 AND ( CAST(wp_tec_occurrences.start_date AS DATETIME) < '2023-12-22 18:00:00' AND wp_postmeta.post_id IS NULL ) AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'publish')) AND (wp_posts.ID NOT IN (58249)) GROUP BY wp_tec_occurrences.occurrence_id ORDER BY wp_tec_occurrences.start_date DESC, wp_posts.post_date DESC LIMIT 0, 1
What is interesting though is that this is not a very complex query, but as per the slow queries log, it sometimes takes up to 30 seconds to return the results.
Any insights would be greatly appreciated!
WordPress version: 6.2
The Events Calendar version: 6.0.12
PHP version: 8.1.11
MySQL version: 8.0.26The page I need help with: [log in to see the link]
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Slow queries overloading server’ is closed to new replies.