Speed up profiles

I am currently using the dolphin version but i have come accross a pretty major problem with the coding. You see the feature for friends to be diplayed on a members profile page works just fine when a member has but just a few friends.
 
However in my case i have profiles with over 100 friends, so when these memebrs are trying to open their profile pages it can take upto 2 minutes and puts an enormouse load on the database, to the point of almost crashing.
 
The msql search query that i am refering to is
 
SELECT `Profiles`.* FROM `FriendList` LEFT JOIN `Profiles` ON (`Profiles`.`ID` = `FriendList`.`Profile` AND `FriendList`.`ID` = '$id' OR `Profiles`.`ID` = `FriendList`.`ID` AND `FriendList`.`Profile` = '$id')
WHERE (`FriendList`.`Profile` = '$id' OR `FriendList`.`ID` = '$id') AND `FriendList`.`Check` = '1' ORDER BY `Profiles`.`Picture` DESC LIMIT 12";
 
This code is found in the /inc/profiles.inc.php file. is their a faster way to show the friends on a profile page or is this script only for sites where members dont have many friends?

Quote · 11 Aug 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.