Parallelism tuning has always been one of the most challenging aspects of SQL Server performance optimization. DBAs often spend hours fine-tuning MAXDOP settings, trying to strike the perfect balance between performance and resource consumption.
With SQL Server 2025, this challenge is significantly reduced thanks to Degree of Parallelism (DOP) Feedback—a powerful Intelligent Query Processing feature that automatically optimizes parallel query execution.
In this blog, we will walk through:
- What DOP Feedback is
- How to track it using Extended Events
- A real-time demo with multiple scenarios
- How to validate whether DOP Feedback is working on your server
What is DOP Feedback?
DOP Feedback enables SQL Server to self-adjust the degree of parallelism for repeated queries. Instead of relying on static MAXDOP settings, SQL Server analyzes runtime performance (CPU usage, execution time, waits) and dynamically tunes DOP for subsequent executions.
This helps:
- Reduce excessive CPU usage
- Improve query performance
- Eliminate manual tuning effort
Tracking DOP Feedback using Extended Events
To understand how SQL Server applies DOP Feedback, we can capture internal engine decisions using Extended Events.
Setup DOP Feedback Tracking
IF EXISTS (SELECT 1 FROM sys.server_event_sessions WHERE name = 'DOPFeedbackWatch') DROP EVENT SESSION DOPFeedbackWatch ON SERVER;GOCREATE EVENT SESSION DOPFeedbackWatch ON SERVERADD EVENT sqlserver.dop_feedback_eligible_query( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_provided( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_validation( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_stabilized( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_reverted( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_analysis_stopped( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash)),ADD EVENT sqlserver.dop_feedback_reassessment_failed( ACTION(sqlserver.sql_text, sqlserver.plan_handle, sqlserver.query_hash))ADD TARGET package0.ring_buffer;GOALTER EVENT SESSION DOPFeedbackWatch ON SERVER STATE = START;GO
What this captures
This session helps us track:
- When a query becomes eligible for DOP Feedback
- When SQL Server adjusts DOP
- Whether feedback is validated or reverted
- When the system stabilizes on an optimal DOP
This gives real-time visibility into the self-tuning engine behavior.
DOP Feedback Demo (Step-by-Step)
Let’s simulate workloads to observe DOP Feedback in action.
Scenario 1: High-Volume Parallel Query (Feedback Adjusted)
CREATE DATABASE jbdbGOUSE JBDBGO--Create table and load tableCREATE TABLE [dbo].[Table1]([Col1] [int] IDENTITY(1,1) ON [PRIMARY]GOset nocount oninsert into Table1 (Col2, Col3, Col4, Col5) values (1, REPLICATE ('a',4000), 10, 100)go 999insert into Table1 (Col2, Col3, Col4, Col5) values (2, REPLICATE ('z',4000), 11, 100)go 99999insert into Table1 (Col2, Col3, Col4, Col5) values (3, REPLICATE ('f',4000), 12, 100)go 8965insert into Table1 (Col2, Col3, Col4, Col5) values (4, REPLICATE ('g',4000), 13, 100)go 7844insert into Table1 (Col2, Col3, Col4, Col5) values (5, REPLICATE ('u',4000), 14, 100)go 4567insert into Table1 (Col2, Col3, Col4, Col5) values (2, REPLICATE ('z',4000), 11, 100)go 751049-- Stored Procedure to query the tableCREATE OR ALTER PROCEDURE [dbo].[usp_GetDetails] @Col2 intASBEGINSELECT top (50000) [Col1], [Col2], [Col3], [Col4], [Col5]FROM dbo.Table1WHERE [Col2] = @Col2ORDER BY [Col3];END--EXECUTE the stored procedureEXEC [dbo].[usp_GetDetails] @Col2 = 2--OSTRESSC:\Program Files\Microsoft Corporation\RMLUtils>ostress -S"VIJANAK\IN2025" -E -Q"EXEC usp_GetDetails @Col2 = 2;" -n1 -r100 -q -dJBDB
In this scenario:
- Query executes repeatedly under load
- SQL Server identifies inefficiencies in parallelism
- DOP is adjusted for better performance
Scenario 2: Skewed Parallelism (Feedback Evaluation)
use JBBlog[dbo].[usp_SkewedParallelReport]ostress -S"VIJANAK\IN2025" -E -Q"EXEC usp_SkewedParallelReport;" -n1 -r100 -q -dJBBlog
Here:
- SQL Server evaluates skewed workloads
- Determines whether reducing DOP improves efficiency
- May validate or reject feedback
Monitoring Live Workload
To see what is actively running:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED -- What SQL Statements Are Currently Running? SELECT [Spid] = session_Id, ecid, [Database] = DB_NAME(sp.dbid), [User] = nt_username, [Status] = er.status, [Wait] = wait_type, [Individual Query] = SUBSTRING (qt.text, er.statement_start_offset/2,(CASE WHEN er.statement_end_offset = -1 THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2ELSE er.statement_end_offset END - er.statement_start_offset)/2),[Parent Query] = qt.text, Program = program_name, Hostname, nt_domain, start_time FROM sys.dm_exec_requests er INNER JOIN sys.sysprocesses sp ON er.session_id = sp.spid CROSS APPLY sys.dm_exec_sql_text(er.sql_handle)as qt where session_Id NOT IN (@@SPID) -- Ignore this current statement. ORDER BY 1, 2 go
This helps you:
- Identify active queries
- Validate parallel workloads
- Correlate with Extended Event output
Key Observations from the Demo
From the above scenarios, you will typically notice:
- DOP Feedback Applied Successfully
- SQL Server reduces or adjusts DOP
- Performance improves over repeated executions
- Optimal DOP Identified
- No change needed
- System confirms current DOP is efficient
- Query Not Eligible
- Some queries are excluded
- Depends on execution pattern and workload
Why This Matters
DOP Feedback fundamentally changes how DBAs approach tuning:
| Traditional Approach | SQL Server 2025 Approach |
|---|---|
| Manual MAXDOP tuning | Automatic per-query tuning |
| Trial and error | Data-driven decisions |
| Static configuration | Adaptive optimization |
Watch the Full Demo
I’ve recorded a complete walkthrough of this setup on my YouTube channel JBSWiki. If you’re a visual learner, go check it out!
👉 Watch here: https://www.youtube.com/watch?v=nVMeQeiUKTA
Final Thoughts
With SQL Server 2025, the database engine becomes smarter and more autonomous.
DOP Feedback:
- Eliminates guesswork
- Improves performance stability
- Reduces CPU contention
- Adapts dynamically to workload changes
For DBAs and performance engineers, this means less time tuning and more time delivering value.
If you are testing SQL Server 2025 in your environment, I highly recommend running this demo and observing the Extended Events output — it gives incredible insight into how the engine learns and adapts in real time.
Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.