DataSet size (memory issues)...

wyrd

Well-known member
Joined
Aug 23, 2002
Messages
1,408
Location
California
When dealing with DataSets, would it be wise to keep it small as possible (ie; maybe only 100 or so records at a time)? I mean, if you have a database with 1 million records Im pretty sure itd significantly impact the speed of your program if you had all of those in the DataSet (memory). So.. what would be the breaking point (if any) of when things start becoming sluggish?
 
I use a general rule of thumb of 250 or 500 records max (depending on the number of columns). Anything more than that and youd be better off filtering or paging. You want to limit the records not only because it takes a lot of client resources, but a lot of server power, network traffic, etc. to send more records to the client. Some controls, notably the old VB6 Flexgrid, had trouble displaying too many records as well.

Hopefully you wont have the need to ever bring back more than 500 records at once. A good app will provide some kind of filter, either through a search or some paging mechanism to limit the amount of data going across the line. If they *really* need more records, you may have to deal with downloading entire tables to a client and do the paging there. Its not as fun to code so Id avoid it unless you have to.

Was this a "what if" question, or something that has actually come up?

-nerseus
 
Back
Top