iplist table (id, username, ip, created) - stores the distinct IP addresses of each user
I want to find all the usernames who ever had the same IP address as 'angryuser'
MySQL QUERY:
SELECT username,
ip
FROM `iplist`
WHERE ip IN (
SELECT ip
FROM iplist
WHERE username='angryuser'
)
If I run this query it gets in a loop and kills my server :)
Why?
Update:
Here's the execution plan:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY iplist ALL NULL NULL NULL NULL 102757 Using where
2 DEPENDENT SUBQUERY iplist ALL NULL NULL NULL NULL 102757 Using where