Hej,
Jag har fått ett system i ASP/MS SQL från en kund som nu ska optimeras då det är väldigt tunggrott att arbeta i med långa väntetider medans systemet arbetar.
Jag har nu fått bukt på det mesta men presentationen av statistiken tar fortfarande 40-50 sek att exekvera, och så vill jag inte ha det.
Skulle nu behöva tips på hur, om det är möjligt, jag smidigast optimerar följande sql-satser. :)
[red]Function unikahits()
Set RecSet = Connect.Execute("SELECT COUNT(hit) AS unika FROM hits WHERE ipadd <> N'xxx.xx.xxx.xx' AND hit = 1")
unikahits = RecSet("unika")
RecSet.Close
Set RecSet = Nothing
End Function
Function hits()
Set RecSet = Connect.Execute("SELECT COUNT(hit) AS hits FROM hits WHERE ipadd <> N'xxx.xx.xxx.xx'")
hits = RecSet("hits")
RecSet.Close
Set RecSet = Nothing
End Function
Function akcv()
Set RecSet = Connect.Execute("SELECT COUNT(JE_candidate_cv_id) AS akcv FROM JE_candidate_cv WHERE JE_candidate_cv_status = 1")
akcv = RecSet("akcv")
RecSet.Close
Set RecSet = Nothing
End Function
Function anscv()
Set RecSet = Connect.Execute("SELECT COUNT(JE_Application_cvprofileid) AS anscv FROM JE_Application WHERE JE_Application_cvprofileid > 0")
anscv = RecSet("anscv")
RecSet.Close
Set RecSet = Nothing
End Function
Function ans()
Set RecSet = Connect.Execute("SELECT COUNT(JE_Application_cvprofileid) AS ans FROM JE_Application")
ans = RecSet("ans")
RecSet.Close
Set RecSet = Nothing
End Function[/red]