July 12, 2016 at 12:17 am
Hi,
I would like to know how to get max degree of parallelism via SQL statement?
July 12, 2016 at 1:11 am
SELECT ProductID, OrderQty, SUM(LineTotal) AS Total
FROM Sales.SalesOrderDetail
WHERE UnitPrice < 4
GROUP BY ProductID, OrderQty
ORDER BY ProductID, OrderQty
OPTION (MAXDOP 2);
July 12, 2016 at 2:08 am
I mean how I can query the SQL Server settings via SQL statement, e.g. maximum degree of parallelism?
July 12, 2016 at 2:23 am
Use sp_configure. I think there's also a catalog view, called something like sys.configurations, that you can query directly.
John
July 12, 2016 at 8:51 am
what john said
July 12, 2016 at 9:00 am
My question is why? What are you looking for with maxdop?
In addition to looking at max degree of parallelism, you should also look at "cost threshold for parallelism".
Far too often, the maxdop is changed to correct a perceived problem, when it's actually the cost threshold that needs to be changed.
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
July 12, 2016 at 9:24 am
You can also look at the query plan and see how many threads are running from the outputs of parallel operations.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 12, 2016 at 10:19 am
To get the current max degree of parallelism for a specific instance of SQL Server:
SELECT value_in_use
FROM sys.configurations
WHERE name = 'max degree of parallelism'
-- Itzik Ben-Gan 2001
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply