SELECT `p`.`ID` AS `id` FROM `Profiles` AS `p` LEFT JOIN `sys_friend_list` AS `f1` ON (`f1`.`ID`=`p`.`ID` AND `f1`.`Profile`='337260' AND `f1`.`Check`=1) LEFT JOIN `sys_friend_list` AS `f2` ON (`f2`.`Profile`=p.`ID` AND `f2`.`ID`='337260' AND `f2`.`Check`=1) WHERE 1 AND (`f1`.`ID` IS NOT NULL OR `f2`.`ID` IS NOT NULL);
That query takes about 1.7 seconds.
Dolphin 7.1.4