Query Causing Site to Hang

Our site seems to hang once in a while. The host says it because of a particular query but we can’t track down what is calling the query.

Here’s the query:

SELECT user\_id, meta\_key, meta\_value FROM wp\_usermeta WHERE user\_id IN (14870,14901,14880,14919,…,14896) ORDER BY umeta\_id ASC;

The user\_id list in parentheses is around 120,000+ IDs.

Any idea of what could be doing this or how we can go about finding what’s making these calls?

3 Comments
  1. Check whatever plugin you are using for memberships. I say membership because you have 120,000+ users.

  2. Dang that’s likely to be a huge query. It’s returning all the metadata for 120K users and then sorting it. Yeesh.

    Where are they seeing that this query is causing the issue? If it’s on the web server side are there any related records in the error log?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer