I have this query which is taking around 40-50 seconds to load

```
SELECT
  members.latitude,
  members.longitude,
  members.mem_id
FROM members
WHERE profile_type != "C"
    AND (gender = 'm'
          OR gender = 'f')
    AND members.mem_id IN(SELECT DISTINCT
                            n2.mem_id
                          FROM network n1,
                            network n2
                          WHERE n1.frd_id = n2.mem_id
                              AND n1.mem_id = '48'
                              AND n2.frd_id = '48')
ORDER BY profilenam

```

there is network table which contains users friends 

Please help..