qwas368
10/25/2018 - 2:10 PM

sql server的多工處理

max degree of parallelism max degree of parallelism

SELECT * FROM [T1] ORDER BY serialno DESC, c2 ASC OPTION (MAXDOP 2)
SELECT * FROM sys.configurations WHERE name = 'cost threshold for parallelism'
SELECT * FROM sys.configurations WHERE name = 'max degree of parallelism'

--sp_configure 系統預存程序來變更設定,只有當 show advanced 選項設定為 1 時,才能變更 cost threshold for parallelism。
EXEC sp_configure 'show advanced options', 1;
GO
reconfigure;
GO
EXEC sp_configure 'cost threshold for parallelism', 700;
GO
reconfigure;
GO
EXEC sp_configure 'max degree of parallelism', 0;
GO
RECONFIGURE WITH OVERRIDE; -- 不知道與reconfigure有什麼差異
GO