Executing large result queries

  • Thread starter Thread starter pnp
  • Start date Start date
P

pnp

Hi all,
I've developed an app (C#) that connects to SQL Server 2000 without using
thread pooling (using SqlConnection) and I run a query that returns ~4000
tuples each time it runs and displays the results in a listview. The problem
is that after I run it 3-4 times the results are read very slowly from the
DB. The first times the results are displayed in 1-2 secs but the 4,5 time
it takes more than 2 minutes! What am I doing wrong? Are there any
in-between buffers that need to be emptied?

Thanks,
-peter
 
well i checked it with the profiler and while the SQL:BatchCompleted takes
about the same amount of time for each execution (~2200) the Audit Logout is
different and when the program slows down it takes numbers up to ~584263
while a normal execution takes up to ~20296.

So it is not an SQL Server problem...
Can anyone help?

Thanks in advance,
pnp
 
I expect you're running out of resources on the client. What are you trying
to do with these 4000 rows?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
They are the result of running a query on the db for some contacts based
upon certain criteria. There is no way of avoiding running the query. The
problem is if I should free resources somehow or clear some buffers other
that the ones used on the form... From the taskmanager though I can see that
each time I run the query the amount of RAM used by the app is increasing by
~2MB a time. Every time I run it. My computers RAM is 1GB so I came to the
conclusion that the program itself uses some internal buffers that I must
empty(?).
 
I would make sure you're releasing any objects after they're no longer
needed.
I would also try to see if some of the processing can be done on the server.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top