Brandon Owensby (123@abc.com) writes:
[quoted text, click to view] > I have a process that can potentiall affect alot of records. I was
> testing this out and it seems that when I let it go on a large number of
> records it takes along time. The time it takes seem to start of linear
> until you get to a point and then it becomes an exponential increase in
> time. I was wondering if having a transaction that deals with changes
> to many tables and with rows numbering 50,000 - 100,000 if you would
> start getting into memory issues or other things that my start slowing
> you down. I haven't tried taking out the transaction control because it
> would be a pain to do so at every level of this call stack not to
> mention I wouldn't want to leave it without transaction control and I
> really don't want my changes to persist during testing. Any information
> would be appreciated. Thanks.
I have also experienced this, though in our case it appeared to expotential
all the way through.
I did make inquiry in our internal MVP forum about it, and I was contacted
by a guy who gave good suggestions to track what was happening.
Unfortunately, I did have the time to investigate. In our case, it was
obvious that the whole operation was in need of a redesign. We were calling
a stored procedure that only accepted data for one row at a time, but had
become a wrapper on a new procedure that accepted many rows at at time.
(So the operation needed to be rewritten to use the new procedure.) In
this case, the innermost procedure in the loop was creating some 20
temp tables on each occassion, and the locks for these in tempdb, system
tables and elsewhere, were held for the duration of the transaction.
I would not expect the above to be very helpful. However, if the case
is that your process is working with one row at a time, then you should
consider a redesign.
Another issue to consider is the size of the database files. If you have a
small transaction log file with a 10% autogrow, then there will be a lot
of autogrow. Also watch tempdb for this.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se
Books Online for SQL Server SP3 at