Hello, we are experiencing a problem with the Ajax Search functionality on a website that contains a lot of articles (~60.000).
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE '%dollar%') OR (wp_posts.post_excerpt LIKE '%dollar%') OR (wp_posts.post_content LIKE '%dollar%')) AND ((wp_posts.post_title LIKE '%bitcoin\\%7C%') OR (wp_posts.post_excerpt LIKE '%bitcoin\\%7C%') OR (wp_posts.post_content LIKE '%bitcoin\\%7C%')) AND ((wp_posts.post_title LIKE '%Bityard.com%') OR (wp_posts.post_excerpt LIKE '%Bityard.com%') OR (wp_posts.post_content LIKE '%Bityard.com%')) AND ((wp_posts.post_title LIKE '%Free%') OR (wp_posts.post_excerpt LIKE '%Free%') OR (wp_posts.post_content LIKE '%Free%')) AND ((wp_posts.post_title LIKE '%Bonus%') OR (wp_posts.post_excerpt LIKE '%Bonus%') OR (wp_posts.post_content LIKE '%Bonus%'))) AND (wp_posts.post_password = '') AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish') ORDER BY (CASE WHEN wp_posts.post_title LIKE '%dollar+to+bitcoin\\%7C+Bityard.com+Free+Bonus%' THEN 1 WHEN wp_posts.post_title LIKE '%dollar%' AND wp_posts.post_title LIKE '%bitcoin\\%7C%' AND wp_posts.post_title LIKE '%Bityard.com%' AND wp_posts.post_title LIKE '%Free%' AND wp_posts.post_title LIKE '%Bonus%' THEN 2 WHEN wp_posts.post_title LIKE '%dollar%' OR wp_posts.post_title LIKE '%bitcoin\\%7C%' OR wp_posts.post_title LIKE '%Bityard.com%' OR wp_posts.post_title LIKE '%Free%' OR wp_posts.post_title LIKE '%Bonus%' THEN 3 WHEN wp_posts.post_excerpt LIKE '%dollar+to+bitcoin\\%7C+Bityard.com+Free+Bonus%' THEN 4 WHEN wp_posts.post_content LIKE '%dollar+to+bitcoin\\%7C+Bityard.com+Free+Bonus%' THEN 5 ELSE 6 END), wp_posts.post_date DESC LIMIT 0, 10;
We believe that those queries may be coming from the Ajax Search functionality of the theme as we have used the “Disable Search” plugin and we are still seeing these kinds of queries. Also another issue is the fact that we are seeing multiple ajax requests being made to the backend when a user is typing which ends up hogging and crashing our MySQL server due to the memory required for performing all these queries.
Can you point us to a way to disable any possible search operations through the theme?
Thank you.
-
This topic was modified 5 years by
webarts.
Hi webarts, if I can ask what resource do you have on your host?
I’m asking this because there are many options that need to make querist to database, all options that you are using are using queries (mega menu, infinite loading, next and prev, pagination, pages/templates settings, live search… ).
Using the guide from here – https://forum.tagdiv.com/topic/a-few-tips-for-newspaper-x-speed-high-cpu-usage-issues/ you can reduce the number of queries.
Let us know the results!
Thank you!