// sql server · parallelism & workers

MAXDOP

Per-database MAXDOP that overrides the instance setting for queries in this database.

默认
0
Range
0 to 32767
Restart needed
否
Default checked on
SQL Server 2025

作用

0 means use the instance value. Available from SQL Server 2016; on Azure SQL Database it is the only way to set MAXDOP. A secondary replica can have its own value (FOR SECONDARY).

默认值

0. 0, use the instance setting (SQL Server 2025). Azure SQL Database sets 8 for new databases.

Check the current value

-- run in the database you want to check
SELECT name, value, value_for_secondary, is_value_default
FROM sys.database_scoped_configurations
WHERE name = 'MAXDOP';

Change it

-- run in the database to change
ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 8;

No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.

When to change it

When one database (an analytics or reporting DB) needs different parallelism from the rest of the instance.

What can go wrong

Same as the instance setting: too high starves concurrent queries, 1 makes big queries slow.

Questions about MAXDOP

What is the default value of MAXDOP in SQL Server?

0. 0, use the instance setting (SQL Server 2025). Azure SQL Database sets 8 for new databases.

Does changing MAXDOP require a restart?

No. No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.

When should I change MAXDOP?

When one database (an analytics or reporting DB) needs different parallelism from the rest of the instance.

Back to all SQL Server settings, or check the SQL Server manual for every option.

// one client for every engine

Check MAXDOP on your own server

SQLly runs the query above against SQL Server and the other engines in this reference, from one desktop app on macOS, Windows and Linux.