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?
Check whatever plugin you are using for memberships. I say membership because you have 120,000+ users.
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?
What are the table indexes and how many minutes does it take for the query to complete?