Vilket av dessa är snabbast?

ASP

1 svar · 235 visningar · startad av Lukaspojken

Medlem sedan maj 20011 312 inlägg
Trådstart#1
	strSQL = "SELECT username, epost, presentation FROM userr WHERE userID=" & userID
	Set RecSet = Connect.Execute(strSQL)
			
	IF NOT RecSet.EOF THEN
		arrRecords = RecSet.GetRows
	End If
				
	RecSet.Close
	Set RecSet = Nothing
	Connect.Close
	Set Connect = Nothing

	username = arrRecords(0,0)
	epost = Server.HTMLEncode(arrRecords(1,0))
	presentation = arrRecords(2,0)

Eller

	strSQL = "SELECT username, epost, presentation FROM userr WHERE userID=" & userID
	Set RecSet = Connect.Execute(strSQL)
			
	IF NOT RecSet.EOF THEN
	username = RecSet("username")
	epost = RecSet("epost")
	presentation= RecSet("presentation")
	End If
				
	RecSet.Close
	Set RecSet = Nothing
	Connect.Close
	Set Connect = Nothing

Getrow tar väl mer prestanda eller?

Medlem sedan dec. 200012 464 inlägg
#2

Jo, i detta fall är det onödigt att använda getrows.

505 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
123 ms — deklarationer (db)
0 ms — hämta statistik (cache)
378 ms — hämta tråd, inlägg och bilagor (db)
117 ms — ändringar (db)