chrissparkle
Programmer
I've got a dating site which is starting to buckle under some heavy load. I have a few problem areas but this code in particular is slow.
Is there some thing obvious that I'm doing wrong here - is there a way to optimise this code so that it will compute faster? The table isn't exactly huge - the Smiles table has 55,000 rows, the members table has about 100,000.
Code:
SELECT Smiles.Viewed,Smiles.SID, Members.MemberID, Members.Nickname, Members.Age, Members.Country, Members.Region, Members.Gender,
Members.Looking, Members.FriendshipSex, Members.DatingSex, Members.Lage1, Members.Lage2, Members.Hage1, Members.Hage2, Members.Title, Members.DateJoined, Members.Updated, Members.Photo, members.online, members.regionN
FROM Smiles WITH (NOLOCK)
INNER JOIN Members WITH (NOLOCK)
ON Smiles.MemberID = members.memberid
Where Smiles.SmileID = @MemberID
Order by Smiles.Viewed, Smiles.SID DESC
Is there some thing obvious that I'm doing wrong here - is there a way to optimise this code so that it will compute faster? The table isn't exactly huge - the Smiles table has 55,000 rows, the members table has about 100,000.