data shaping... slooooow results page
I have a sql server db with 10,000 records (not many)... and am running a shape query to pull the results on to the page... it's a shape query with 5 children. My problem is the query is very slow to load... up to 15 seconds. Am I trying to do too much? Pulling too much data on the results page? The query is below, and any thoughts at all are MUCH appreciated... this one is really killing me. THANKS
code dump:
Sql = "SHAPE {SELECT DISTINCT opleaders.* FROM vwgroupsquery RIGHT JOIN (([vwrelationshipsquery] AS relationships RIGHT JOIN (vwleaderissues RIGHT JOIN (vwleadertypes RIGHT JOIN opleaders ON vwleadertypes.typetoleaderopleaderID = opleaders.opleaderID) ON vwleaderissues.issuetoleaderopleaderID = opleaders.opleaderID) ON relationships.relationshiptoleaderopleaderID = opleaders.opleaderID) LEFT JOIN vwcommunquery ON opleaders.opleaderID = vwcommunquery.commtoleaderopleaderID) ON vwgroupsquery.grouptoleaderopleaderID = opleaders.opleaderID" & whereclause & "ORDER BY opleaders.opleaderLname, opleaders.opleaderFname}"
Sql = Sql & " APPEND ({SELECT * FROM issues left join issuetoleader on issues.issueID like issuetoleader.issuetoleaderissueID ORDER BY issue} AS rsInternalTeam_Link RELATE opleaderID TO issuetoleaderopleaderID), ({SELECT * FROM leadertype left join typetoleader on leadertype.leadertypeID like typetoleader.typetoleadertypeID ORDER BY leadertype} AS rsInternalTeam_Link2 RELATE opleaderID TO typetoleaderopleaderID), ({SELECT * FROM relationships left join relationshiptoleader on relationships.relationshipID like relationshiptoleader.relationshiptoleaderrelations hipID ORDER BY relationship} AS rsInternalTeam_Link3 RELATE opleaderID TO relationshiptoleaderopleaderID), ({SELECT * FROM communications left join commtoleader on communications.commID like commtoleader.commtoleadercommID ORDER BY commdate desc} AS rsInternalTeam_Link6 RELATE opleaderID TO commtoleaderopleaderID), ({SELECT * FROM groups left join grouptoleader on groups.groupID like grouptoleader.grouptoleadergroupID ORDER BY [group]} AS rsInternalTeam_Link7 RELATE opleaderID TO grouptoleaderopleaderID)"
|