Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with slow queries generated by the Extra theme that include SQL_CALC_FOUND_ROWS #715

Open
salvatoresansone89 opened this issue Oct 21, 2024 · 0 comments

Comments

@salvatoresansone89
Copy link

Problem Description

Hi Extra Team,
I am experiencing a performance issue with my site, specifically with slow SQL queries generated by the Extra theme that use SQL_CALC_FOUND_ROWS. After running a detailed analysis using the Query Monitor plugin, I have identified that many slow queries include this feature, causing the site to slow down significantly.
Here are some examples of slow queries I have encountered:
sql
Copy code
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
WHERE 1=1
AND ((wp_posts.post_type = 'post'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private')))
ORDER BY wp_posts.post_date DESC
LIMIT 0, 10;
Another example: vbnet Copy code SELECT SQL_CALC_FOUND_ROWS 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_term_relationships.term_taxonomy_id IN (2)) AND ((wp_posts.post_type = 'post' AND ( wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private'))) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 3;
I tried implementing a filter to remove SQL_CALC_FOUND_ROWS, but it seems that these queries are generated directly by the theme, and the filter had no effect.
Could you please provide me with a specific solution to optimize these queries or possibly a patch that reduces the use of SQL_CALC_FOUND_ROWS? I am available to provide more details or additional information if needed.
Thanks in advance for your assistance.

Steps To Reproduce

Screenshot and/or gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant