Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-05 : 10:56:34
|
| scott writes "My project need me to design a form to display the data from tables, some of them, the tables, with quite large amount of data, like 1m records. I have to display them one by one, e.g. 20 record per page. It's easy if i set a recordset to whole table, but it take me a long time to do that and i need to consider about the performance of the server(it need to handle others requests). Can you guys suggest me a way to deal with this? btw, if i use the "2 top" to do it, will the subquery, which will still contain a select of large number, will it affect the performance of the server? thanks a lot" |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-07-05 : 11:14:45
|
| Actually, I've done something like this before.... except they had one additional request. Page 1 would always have to be the same results everytime they viewed it (Same 20 records on page1). So would page2 and so on. So another column was added called pagenumber numeric(10,4)data orderIDabc 1add 2amgk 2.2dks 3aad 3.1anni 4.0The table was constantly ordered by this column (consider indexs on it.. but I won't get into it now)ASP would then hold a value (I stuck in in a query string) which was the Max value of the last one displayed. To get a record set with the first 20 records:select top 20 * from tablename order by OrderID ASCIf they clicked next 20 records a string would be passed on to the sql server (lets say @lastshown):select top 20 * from tablename where ORDERID > @lastshown order by orderID ASC This was implemented on a table with 940k records (about that) and although a little slow, we didn't see too many problems.Might not be what you want but I thought I'd atleast give you a couple ideas[edit] 250... yay [/edit]-----------------------Take my advice, I dare yaEdited by - M.e. on 07/05/2002 11:15:12 |
 |
|
|
macka
Posting Yak Master
162 Posts |
Posted - 2002-07-05 : 11:53:32
|
| I'd recommend you take a look at something like this:[url]http://www.aspfaqs.com/webtech/062899-1.shtml[/url]macka. |
 |
|
|
|
|
|
|
|