views:

428

answers:

3

I have two SqlDataSource controls on a page. One loads high level data and the other loads more details based on which high level item you choose. It is a part of a large search that has over 900,000 records and I am looking for ways to speed it up. Whether it is options I can add onto the SqlDataSource, things I can do to the sql query, or use an alternative such as an ObjectDataSource.

I changed the DataSourceMode to DataReader because I heard it was faster and uses less memory. I also noticed that the paging is really slow.

I am doing the following from my this website, http://mosesofegypt.net/post/2008/02/Building-a-grouping-Grid-with-GridView-and-ASPNET-AJAX-toolkit-CollapsiblePanel.aspx, but obviously with my data which is over 900,000 records and I am unsure how I can add paging to the second gridview, because right now, it is only on the top-level gridview

+3  A: 

I don't think your data source control itself would need to be the target for any optimizations. It is only going to work with the data that you get from it (meaning you should optimize your SQL) or the data put into it before sending it off to SQL (meaning you should optimize your application code).

TheTXI
+1  A: 
  1. I would start with server-side paging for your data in asp.net.
  2. I would make sure to index your database tables to get maximum performance. Also use query analyzer to see pain points in your query performance.
  3. If you are searching I would recommend using Full Text Indexing that SQL server provides.
irperez
I have paging, but noticed it is really slow.
Xaisoft
irperez
A: 

When I used to have to track large amounts of data I found it was better to not use the default pagin and instead override to only collect 10 or 20 rows a time from the database. You do need a decent indexing process so the code knows which 10 or 20 rows or so it is displaying but it does speed things up.

Matrim
Are you referring to using something like ROW_NUMBER in the procedure.
Xaisoft