Home All Groups Group Topic Archive Search About

Obtaining different timings for the same process??

Author
13 Jan 2006 12:49 PM
Enric
Dear fellows,

The following loop bring me differents results, execute one after one (among
them a truncate table, of course):

DECLARE @loop as integer
set @loop = 1

while @loop < 10000
       begin
        insert into A_test(id,nombre,ape) values(@loop,'a','aadfasdf')

    set @loop = @loop  + 1
       end


1st: 26 sec.
2nd: 30 sec.
3rd: 32 sec.

What's happening?
Any input would be much appreciated.
Enric

Author
13 Jan 2006 12:57 PM
Rick Sawtell
Show quote
"Enric" <En***@discussions.microsoft.com> wrote in message
news:F66A1DC3-E5CD-4B06-AE4E-53818843E3C5@microsoft.com...
> Dear fellows,
>
> The following loop bring me differents results, execute one after one
> (among
> them a truncate table, of course):
>
> DECLARE @loop as integer
> set @loop = 1
>
> while @loop < 10000
>       begin
> insert into A_test(id,nombre,ape) values(@loop,'a','aadfasdf')
>
> set @loop = @loop  + 1
>       end
>
>
> 1st: 26 sec.
> 2nd: 30 sec.
> 3rd: 32 sec.
>
> What's happening?
> Any input would be much appreciated.
> Enric

What other processes are running on your server while this is running.
Page splitting or allocation of new extents to store your data may be
happening.
Indexes may be getting updated
Statistics may be getting updated


It's hard to say what the real culprit is.  These are some things that I
would check however.

Rick Sawtell
MCT, MCSD, MCDBA
Author
13 Jan 2006 1:42 PM
Enric
Thanks to both for the quick responses but I was wondering about the
difference among them. It seems very high. We are talking about 6 or 7
seconds for a total of 35 more or less..

Show quote
"Rick Sawtell" wrote:

>
> "Enric" <En***@discussions.microsoft.com> wrote in message
> news:F66A1DC3-E5CD-4B06-AE4E-53818843E3C5@microsoft.com...
> > Dear fellows,
> >
> > The following loop bring me differents results, execute one after one
> > (among
> > them a truncate table, of course):
> >
> > DECLARE @loop as integer
> > set @loop = 1
> >
> > while @loop < 10000
> >       begin
> > insert into A_test(id,nombre,ape) values(@loop,'a','aadfasdf')
> >
> > set @loop = @loop  + 1
> >       end
> >
> >
> > 1st: 26 sec.
> > 2nd: 30 sec.
> > 3rd: 32 sec.
> >
> > What's happening?
> > Any input would be much appreciated.
> > Enric
>
> What other processes are running on your server while this is running.
> Page splitting or allocation of new extents to store your data may be
> happening.
> Indexes may be getting updated
> Statistics may be getting updated
>
>
> It's hard to say what the real culprit is.  These are some things that I
> would check however.
>
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>
>
Author
13 Jan 2006 12:59 PM
ML
Well, what does your Profiler say?


ML

---
http://milambda.blogspot.com/

AddThis Social Bookmark Button