Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT(a1.actor)
- FROM actions a1
- JOIN actions a2 ON a1.ip = a2.ip
- WHERE a2.actor = 143
- AND a2.ip != '0.0.0.0'
- AND a2.ip != ''
- AND a2.actor != a1.actor
- AND a1.actor != 0
- +----+-------------+-------+-------+------------------+---------+---------+------------------+------+--------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-------+-------+------------------+---------+---------+------------------+------+--------------------------+
- | 1 | SIMPLE | a2 | range | actor,ip,actorIp | actorIp | 66 | NULL | 3800 | Using where; Using index |
- | 1 | SIMPLE | a1 | ref | ip | ip | 62 | formabilio.a2.ip | 11 | Using where |
- +----+-------------+-------+-------+------------------+---------+---------+------------------+------+--------------------------+
- SELECT DISTINCT(a1.actor)
- FROM actions a1
- INNER JOIN actions a2
- ON a1.ip = a2.ip AND
- a1.actor <> a2.actor
- WHERE a2.actor = 143
- AND a2.ip <> '0.0.0.0'
- AND a2.ip <> ''
- AND a1.actor <> 0
- CREATE INDEX _actions_ip ON actions( ip );
- CREATE INDEX _actions_actor ON actions( actor );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement