Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Towards the innovative SQL ideas
Browse by Tags · View All
sql server 123
sql 122
ms sql server 119
ms sql 118
database 107
tsql 81
#SQL Server 78
t-sql 75
#sql 71
sql server general 67

Archive · View All
April 2011 14
July 2011 12
May 2011 12
August 2011 11
June 2011 10
September 2011 8
December 2011 6
November 2011 6
June 2013 5
April 2013 5

Max Degree of Parallelism and MAXDOP options in SQL Server 2005

Apr 1 2011 6:45AM by Paresh Prajapati   

 

Before few days i suffered from the performenance issue in database server, I have optimized so many stored procedures and also optimized indexes. But one option i really forgot which will affect on the performance in SQL Server, that is Max Degree of Parallelism.

This option is for the SQL server instance level and decide how SQL Server will utilize the CPUs of the server, means the value configured will use those number of the CPUs for the parallism. The default value of this option is 0 (will use all CPUs).

Another option MAXDOP , which will work functionally same as Max Degree of Parallelism. We can specify this option at query level.

These above two configuration option are depend on the value of Cost Threshold for Parallelism. The default configured value is 5 in SQL Server.

Let's see how to configure these values by scripts.

-- Changing the value of Max Degree of Parallelism to 1
-- will use 2 CPUs for the parallel plan

EXEC sp_configure 'max degree of parallelism' , 2
GO

RECONFIGURE
GO


-- We can also specify MAXDOP option at query level
-- this is specific to this query only

SELECT
*
FROM  EmpDB.dbo.Employee OPTION (MAXDOP 2)


-- Changing the value of Cost Threshold for Parallelism fom 5 to 10

EXEC sp_configure 'cost threshold for parallelism' , 10
GO

RECONFIGURE
GO

When the configure values set to above , whenever queries esimated cost to run the serial plan is more than 10 or whatever specified in Cost Threshold for Parallelism , SQL Server optimizer will use 2 CPUs for the queries parallel plans. If the query's estimated cose below 10 then it will not going to use parallel plan. SQL Server will also use serial plan if the value are configured for the Max Degree of Parallelism to 1. The cost referres to an estimated elapsed time in seconds require to run serial plan on sepcific hardware configuration.

Please whenever you change the values of all above SQL Server parameters, then review the performance of the database server and then decide the best value for the same.

 

Tags: sql, sql server 2008, tsql, sql server, ms sql, sql server errors, ms sql server, t-sql,


Paresh Prajapati
6 · 22% · 7102
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • It is not correct to consider the "cost threshold for parallelism" as seconds. When you set this to 10, queries with a cost greater 10 will be considered for parallelism.

    From BOL (http://msdn.microsoft.com/en-us/library/ms188603.aspx)

    "SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan for the same query is higher than the value set in cost threshold for parallelism. The cost refers to an estimated elapsed time in seconds required to run the serial plan on a specific hardware configuration"

    The important point here is the "specific hardware configuration" mentioned in the last sentence, which was a reference machine used at the time of SQL 7 testing. Todays machines are definitely much more powerful than that.

    commented on Apr 1 2011 6:20AM
    Roji Thomas
    793 · 0% · 36
  • Thanks for comment and suggestion,

    I have corrected my post.

    commented on Apr 1 2011 8:41AM
    Paresh Prajapati
    6 · 22% · 7102

Your Comment


Sign Up or Login to post a comment.

"Max Degree of Parallelism and MAXDOP options in SQL Server 2005" rated 5 out of 5 by 1 readers
Max Degree of Parallelism and MAXDOP options in SQL Server 2005 , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]