Comments on: SQL University – Parallelism Week https://thomaslarock.com/2010/05/sql-university-parallelism-week/ Thomas LaRock is an author, speaker, data expert, and SQLRockstar. He helps people connect, learn, and share. Along the way he solves data problems, too. Thu, 27 May 2010 14:29:18 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: Thomas LaRock https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1519 Thu, 27 May 2010 14:29:18 +0000 http://thomaslarock.com/?p=4334#comment-1519 In reply to Shekhar.

Shekhar,

Thanks for the well wishes.

As for the default setting for max degree of parallelism, the answer is: it depends. I would recommend that you examine the queries that are experiencing that particular wait type and see if they can be tuned.

]]>
By: Shekhar https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1518 Thu, 27 May 2010 09:01:02 +0000 http://thomaslarock.com/?p=4334#comment-1518 Tom,
Recently one of my SQL server was showing the wait CXPACKET 1757062.70 wait time in ms.
what i did was changed the ‘max degree of parallelism’ to 4.I have taken value 4 cause the processor count was 8. Now my question is whether the above calculation is correct and also can we make default setting while building new SQL Server.

]]>
By: Thomas LaRock https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1517 Wed, 26 May 2010 18:14:39 +0000 http://thomaslarock.com/?p=4334#comment-1517 In reply to Paul White NZ.

Paul,

Thanks for the clarifications. I have only rarely needed to configure a system to be a specified number. I try to let the optimizer do the work for me instead.

]]>
By: Paul White NZ https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1516 Wed, 26 May 2010 17:54:37 +0000 http://thomaslarock.com/?p=4334#comment-1516 Thomas,

Thanks for that. Server MAXDOP is controversial I know. My thoughts are that SQL Server generally load-balances between concurrent requests very well (co-operative scheduling) so cores-1 is not necessarily a good rule of thumb. Diminishing returns and NUMA concerns are so I tend to set MAXDOP 4 and tune on a case-by-case basis, except heavily-OLTP systems which get server MAXDOP 1 and OPTION overrides to that as required.

Fragmentation. The optimiser does not *directly* consider fragmentation at all – but it might make a different cost-based decision if an index happens to have more pages than it needs due to wasted space (page splits, low fillfactor etc).

Paul

]]>
By: Thomas LaRock https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1515 Wed, 26 May 2010 17:37:05 +0000 http://thomaslarock.com/?p=4334#comment-1515 In reply to Adam Machanic.

Thanks Adam, I will add that to my original post.

]]>
By: Thomas LaRock https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1514 Wed, 26 May 2010 17:36:48 +0000 http://thomaslarock.com/?p=4334#comment-1514 In reply to Paul White NZ.

Paul,

Great questions. I’ll start with number two first.

It only makes sense (to me, at least) if you have been seeing problems with queries that are consuming all CPU’s as a result of parallelism *and* your instance still needs to service other requests at the same time. If you have a batch process that takes up 32 cores but no one else needs to use that box then you really don’t have an issue. But if you take all 32 cores and someone else is locked out as a result then chances are your phone will ring. To avoid that problem it *may* make sense for you to configure your instance to be N-1 by default.

My understanding of that is you could be fragmented to the point that the plan decides to do a scan rather than a seek, and the scan could also be kicked off in parallel. Now, the optimizer is always going to choose the plan with the least cost, so it is trying to do you what it thinks is a favor. So, you could see evidence of parallelism which is only there as a result of some fragmentation. If you clean up the fragmentation, you should get a different plan, and the optimizer may even decide that parallelism is not needed. So, it is not necessarily a direct correlation (fragmentation implies parallelism), but more of a cause and effect (fragmentation implies a less than optimal plan which implies parallelism is used). I guess you could look at this as a warning sign for you to look to a root cause rather than just changing some config options.

]]>
By: Paul White NZ https://thomaslarock.com/2010/05/sql-university-parallelism-week/#comment-1513 Wed, 26 May 2010 17:29:07 +0000 http://thomaslarock.com/?p=4334#comment-1513 Adam,

Yes! Craig’s blog is resourcedb for so many things. I particularly like his PDF presentation http://blogs.msdn.com/b/craigfr/archive/2007/04/17/parallel-query-execution-presentation.aspx

I was fortunate enough to make a small contribution to that.

His chapters in Inside SQL 2005 Query Tuning & Optimisation are also excellent.

Paul

]]>