Slow Queries
Hi!
I need some help on slow queries. I have a 3s TTFB and I contacted my host on this. The host replied that there is a querie which blocks the page from rendering.
I have a lot of ads and want to ask how to solve this problem. This is the query:
SELECT SQL_CALC_FOUND_ROWS X5i3v_posts.ID FROM X5i3v_posts WHERE 1=1 AND X5i3v_posts.post_type = 'ad_listing' AND (X5i3v_posts.post_status = 'publish' OR X5i3v_posts.post_status = 'tr_pending' OR X5i3v_posts.post_status = 'tr_failed' OR X5i3v_posts.post_status = 'tr_completed' OR X5i3v_posts.post_status = 'tr_activated') ORDER BY RAND() LIMIT 0, 10
I know that CALC_FOUND_ROWS is very time consuming. There must be a way to work around this query. I found a lot of old posts but there is no help from these old ones.
Thank you in advance
Warm greetings
Julia