Afficher un message
Vieux 14/09/2006, 04h20   #6
Andrew J. Kelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

Is there an index on the column you are updating? Updates are always single
threaded. That is the act of updating the row. You can't have two threads
update one row. The WHERE clause can use parallelism. In this case you are
updating the entire table so there is nothing to search per say. If there is
an index on the column you have to update that as well and it may be easier
to do that single threaded. One thing to try is specify a tablock on the
update and remove any indexes on that column.

--
Andrew J. Kelly SQL MVP

"Tom" <mcseman@hotmail.com> wrote in message
news:%23j247py1GHA.4908@TK2MSFTNGP02.phx.gbl...
> I'm running SQL2005 SP1 on win 2003 SP1.
> I've noticed that when I'm running large updates, SQL is not using all
> processors. When I run an update statement like:
>
> UPDATE TestTable SET Price = Price + 1
>
> all the processing is done on 1 processor. The box has 2 hypherthreaded
> processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
> that means that only 1 thread is used. Testtable has over 10 million
> records so it takes more than 30 minutes to update entire table that way.
> Maximum degree of parallelism is set to 0, if I run a large select on a
> table it uses all processors and CPU time is on 100%. Log file is also on
> separate drive and there is no queue on it.
> Can I force UPDATE statement to use all processors and speed up update
> that way?
>
>
> Tom.
>
>



  Réponse avec citation
 
Page generated in 0,06050 seconds with 9 queries