You are here: Re: SQL server - script execution time « MsSQL Server « IT news, forums, messages
Re: SQL server - script execution time

Posted by Erland Sommarskog on 11/23/05 00:14

(iam980@gmail.com) writes:
> Hello All.
>
> We have tested following SQL script from query analyzer:
> -- Script begin
> DECLARE @I int;
> SET @I = 1;
> WHILE @I < 10000000 BEGIN
> SET @I = @I + 1;
> END
> -- Script end
>...
> I have following question: Is the above mentioned execution time is
> normal for such script ?
> Also it would be very nice of You to run the script on Your SQL servers
> and inform me about execution time results

On my machine it ran for 11 minutes and 15 seconds on SQL 2000 and 15
seconds on SQL 2005.

When I put it into a stored procedure and had SET NOCOUNT ON, it ran for
19 seconds on SQL 2000.

I ran into this some time ago, and first I thought it was an issue with
SP4, but that was a false alert. I think I came to the conclusion that
parallelism was part of the plot. That is, this sort of script typically
runs slower on a multi-CPU machine. (Including hyper-threaded CPU:s).

I also found that with SET NOCOUNT ON *and* the loop in a stored
procedure, that I did not get the absymal performance.




--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация