Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Causing Huge MySQL Queries

$
0
0

Replies: 0

Hi

I’ve been running Better Search with Woocommerce and Woocommerce Search by SKU. All was working well for the past 4 or 5 months, but then last week we started to get MySQL processes hanging / getting stuck and then bringing the site down with the WP can’t connect to DB message.

After installing Query Monitor it seems that when a customer just hits return or types a v short query, this query runs;

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM db_posts INNER JOIN db_postmeta ON ( db_posts.ID = db_postmeta.post_id ) INNER JOIN db_postmeta AS mt1 ON ( db_posts.ID = mt1.post_id ) WHERE 1=1 AND db_posts.ID IN
(every,post,in,in,the,database) LIMIT 0, 48;

The “every,post,id,in,the,database” is literally every post ID from the DB which in this example creates a query approx 77k char long with 5156 post IDs.

When I disable Better Search, and repeat the empty or short searches, the query doesn’t appear.

  • This topic was modified 5 minutes ago by  davbel.
  • This topic was modified 4 minutes ago by  davbel. Reason: changed DB variables to hide DB

Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>