Why does this MySQL command take forever to execute?

Chakra

New member
First off, this is the general command:

select distinct `name` from `gameplayers` where `ip` = any (select distinct `ip` from `gameplayers` where `name` = 'chakra')

It generally takes about 20 seconds to execute on a first query, then near instantly for the next few minutes (I assume the query is stored). What I want is to grab all the IP-Addresses any general player has (been using a fixed name for testing), then find all the accounts associated with those IPs.

Problem is the host program freezes on query (could do a roundabout method of ignoring that), but 20 seconds is forever... and I fear the server might cry.

Am I doing something incredibly inefficient or something?


gameplayers only has 4800 entries. 'chakra' only has ONE IP (75 total entries). The IP has five associated accounts with a total of 624 entries.

But it generally lags for any user, even if they aren't in the database.

The database would be constantly updating at random intervals (no buffer or anything) and I'd expect to run the queries up to a few hundred, maybe a thousand times a day. I really don't want to stress the server. What I'm doing honestly isn't that important. ^^
 
Back
Top