G
Guest
I am using a DataReader to read what can potentially be a pretty large result
set (thousands of records).
Most of the time, I only need the first X records of the result set (I can't
predict in advance how many records I'll need). In my case, where there
could potentially be thousands of records that meet my select criteria, but
where I'm probably only going to use a much smaller number, is there a
performance gain from setting the "ROWCOUNT" returned by SQL Server to a
small value. If necessary I can requery the database to get the next X
records until I am done.
I guess I'm concerned that although the DataReader is getting records for me
one at a time that SQL Server is building an indexed list of thousands of
records.
Thanks.
BBM
set (thousands of records).
Most of the time, I only need the first X records of the result set (I can't
predict in advance how many records I'll need). In my case, where there
could potentially be thousands of records that meet my select criteria, but
where I'm probably only going to use a much smaller number, is there a
performance gain from setting the "ROWCOUNT" returned by SQL Server to a
small value. If necessary I can requery the database to get the next X
records until I am done.
I guess I'm concerned that although the DataReader is getting records for me
one at a time that SQL Server is building an indexed list of thousands of
records.
Thanks.
BBM