Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 03-21-2005, 12:25 PM   #1 (permalink)
Insane
 
Location: Michigan
[.NET] DataReader, DataAdapter.Fill() performance question

Ok, so I am trying to figure out if DataAdapter.Fill() is efficient.

SQL Server, itself, has no real paging ability. If you want to see the Nth set of 10 records, you have to do some funky sql to get the results you want. It's a bitch to do queries like this, because you have to exec(sqlstringhere). If you are trying to used stored procedures, it makes them 100% pointless as you are generating a new string each time the stored procedure is called. There are other methods, but they are complicated. The point in doing sql this way is to return ONLY the data you want to display and not the other 10,000 records that the query without paging returns.

In the .NET framework, the DataAdapter.Fill() allows you to set a starting record, and how many records to return after the starting record. I know that the .Fill method uses a DataReader, but my question is this:

Using .Fill(), will sql server return all 10,000 records, then doing its "limit" in the .NET framework.

OR

ONLY the count of recurds to return after the starting record? And if so, HOW is this done in sql server? What commands do you have to give sql server to do the paging (what does the DataReader do that is so special)?

My problem with just using it and not knowing is, if you have your database server and web server seperate (any large project does), why transfer 10k records worth of data time after time when you are only going to display, say, 25 records?
__________________
Patterns have a habit of repeating themselves.
asshopo is offline  
Old 03-21-2005, 04:00 PM   #2 (permalink)
Psycho
 
Devoid's Avatar
 
Location: Floating amongst the ether
We've recently started a .Net project at work. Unless I'm mistaken, it only transfers your 10k records across the servers once, puts it into a DataSet, and manipulates it there. It's much more efficient than moving stuff all over the place multiple times. I'm no expert, but I think that's how it works.
__________________
We're here to steal your pornography, and sodomize our vast imaginations. - Inignot
Devoid is offline  
Old 03-21-2005, 06:59 PM   #3 (permalink)
Insane
 
Location: Michigan
Quote:
Originally Posted by Devoid
We've recently started a .Net project at work. Unless I'm mistaken, it only transfers your 10k records across the servers once, puts it into a DataSet, and manipulates it there. It's much more efficient than moving stuff all over the place multiple times. I'm no expert, but I think that's how it works.
Ok, if that is the case, what if you query returns 10 million records instead of 10 thousand? Logically, with a dataset that size, it would make sense to return the paged data only, right?

If you are using asp.net, storing 10k records in a dataset (bound to a datagrid or something) is going to be a HUGE post back, thus making the end user wait for 10k records worth of viewstate back to the server.

See why it doesn't make sense? There has to be something I am missing and in all my research I have not been able to find it .

edit: It may be more efficient to hit the database once, but you take a huge hit on the client side. It needs to be balanced out. Thats my opinion anyways.
__________________
Patterns have a habit of repeating themselves.
asshopo is offline  
 

Tags
dataadapterfill, datareader, net, performance, question

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:02 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57