Second, do not use stored procedures, directly using the Adodb.recordset function to pagination, the specific code is as follows:
Setrs=server.createobject ("ADODB.") Recordset ")
Sql= "Select*fromguestbookorderbydateandtimedesc"
rs.opensql,conn,1,1
Rs.pagesize=150 ' The number of messages displayed per page,
Total=rs. RecordCount
Mypagesize=rs.pagesize
Rs.absolutepage=page
To show the speed more clearly, I've increased the number of messages displayed on each page to 150 (in fact, I wouldn't have set such a large value). As for the configuration of my machine, I omit to say it, because it is mainly speed contrast.
Found that the time of execution is as follows:
The first: stable in 0.1953125 seconds to 0.2109375 seconds, the average is about: 0.20 seconds
The second: stable between 0.1716875 seconds to 0.1857 seconds, the average is approximately: 0.177 seconds
Third: Stable between 0.4375 seconds to 0.4632 seconds, the average is approximately: 0.45 seconds
However, when the number of record bars read is 20, the result is as follows:
Found that the time of execution is as follows:
First: Stable in. 0390625 seconds to 0546875 seconds, the average is about 0.045 seconds.
Second: Stable in 0.046875 seconds to. 0546875 seconds, the average is approximately: 0.050 seconds
Third: Stable in. 09375 seconds to 0.1015625 seconds, the average is approximately: 0.97 seconds
In this view, it seems that the two ways of Conn.execute and Command.Execute seem to be very different,
And the former way of calling seems simpler.
At the same time, you can see that the paging stored procedure is much faster than the recordset's paging speed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.