Ok I just checked it is actually
almost 500,000 rows in this table
It is on a dedicated dual xeon server just for the database
here is the table
CREATE TABLE `friend_friend` (
`autoid` int(11) NOT NULL auto_increment,
`userid` int(10) default NULL,
`friendid` int(10) default NULL,
`status` enum('1','0','3') NOT NULL default '0',
`submit_date` datetime NOT NULL default '0000-00-00 00:00:00',
`alert_message` enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (`autoid`),
KEY `userid` (`userid`),
KEY `friendid` (`friendid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=637223 ;
It seems to be doing the query 2 times is the lag on this particular page
Microtime takes about
0.2529 to load with both queries
when I do away with of of them it is around
0.1435