Hi,
So, theres a query (SQL_CALC_FOUND_ROWS) who consumes a lot of physical memory on large websites.
I found this fix (https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows) and applied in “functions.php” file of the theme.
Is working in the desktop, it no longers show the slow query, but in mobile the problem persists.
Where should i put the code to fix the mobile version too?
Thanks.
Calin, thank you for your assistance, it work.
Now, im still getting some high physical memory consumptions alerts, but for this query:
SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND wp_posts.ID NOT IN (59675) AND (
wp_term_relationships.term_taxonomy_id IN (72)
) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 3
and this one:
SELECT COUNT(*) FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND wp_posts.ID NOT IN (4458) AND (
wp_term_relationships.term_taxonomy_id IN (4,48,49)
) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish'))
Do you know which part of the template is using this query?
Is a block? is the related articles?
Can you help me please?
Thank you!
Hi,
Unfortunately I’m not very sure for what is use that code, sorry, this code can be use for related articles, for next prev articles, there are quiet of blocks for that it can be use this code, as I can see is selecting the posts that are relevant one to other.
I think that this topic it can help you to make the resource from server to be less consumed – https://forum.tagdiv.com/topic/a-few-tips-for-newspaper-x-speed-high-cpu-usage-issues/
Thank you for your understanding!