本周突然间,我们较大的结果集查询(500多条记录)开始回复得慢得多,有时会超时。这些通常会在几秒钟内选择,循环和显示。现在可能需要20秒才能超过一分钟。如果我从本地计算机或服务器执行查询,它将在1秒内返回所有数据。
我看了很多东西,似乎没有什么不合适的地方,所以我想知道是否有人有任何建议。我们上周确实搬到了新的网络服务器,但我刚刚在旧服务器上测试了这些相同的页面,这也是同样的问题。 SQL服务器仍然是相同的。这是一个例子。 **代码删除部分只是“if-then”类型的东西。使用SQL Server 2008.这使我认为它是SQL框或SQL本身的外部连接。我昨天做了重启,感觉变化不大。
提前感谢任何试图帮助的人!我知道这些很难诊断。
'Get past transactions to calculate any refunds made to date
Set rsReport = Server.CreateObject("ADODB.Recordset")
rsReport.ActiveConnection = strConn
rsReport.Source = "EXEC sp_MyStoredProc" & ID
rsReport.CursorType = 3
rsReport.Open()
Response.Write "<!--d" & now() & "-->" & vbcrlf
Do Until rsReport.EOF
CurrERID = rsReport("ERID")
'** code removed
'Test to see if the next ERID is the same or not. If not, the next order is a new customer so check and close out current one.
rsReport.MoveNext
bMovePrevious = False
'Make sure not at the end of RS
If not rsReport.EOF Then
If CurrERID <> rsReport("ERID") Then
'When we are NOT at EOF, MovePrevious AFTER we do the processing (need correct OptionPrice below)
bMovePrevious = True
Else
'Go back to the previous record to keep our place in the RS
rsReport.MovePrevious
End If
If bMovePrevious Then
'Go back to the previous record to keep our place in the RS
rsReport.MovePrevious
End If
End If 'If not credit (real charge)
NextERID = rsReport("ERID")
rsReport.MoveNext
Loop
rsReport.Close()
Set rsReport = Nothing
Response.Write "<!--e" & now() & "-->" & vbcrlf