Troubleshooting Guide: SQL Server Error 13137 (Cumulative Execution Time Anomaly)
Why This Error Happens
Error 13137 in SQL Server 2025 typically occurs when the Query Store or Extended Events telemetry subsystem detects that cumulative execution time (ms) per second has exceeded the internal threshold configured for resource governance. This is often triggered by a misconfigured Query Store capture policy, insufficient I/O throughput on the underlying storage subsystem, or a runaway query plan that is consuming excessive CPU cycles without being throttled by Resource Governor. In some cases, this is also caused by corrupted statistics or outdated cardinality estimator data causing the optimizer to generate inefficient execution plans repeatedly.
Step-by-Step Resolution Guide
Step 1: Verify Query Store Configuration and Capture Mode
- Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
- Run
SELECT * FROM sys.database_query_store_options;to check the currentQUERY_CAPTURE_MODE. - If set to
ALL, change it toAUTOto reduce overhead:ALTER DATABASE [YourDB] SET QUERY_STORE (QUERY_CAPTURE_MODE = AUTO); - Check the
MAX_STORAGE_SIZE_MBsetting to ensure Query Store isn’t hitting capacity limits that trigger error flushes.
Step 2: Inspect Resource Governor Workload Groups
- Navigate to
Management > Resource Governorin SSMS Object Explorer. - Run
SELECT * FROM sys.dm_resource_governor_workload_groups;to identify groups exceeding CPU time thresholds. - Adjust the
REQUEST_MAX_CPU_TIME_SECparameter for the affected workload group if queries are legitimately long-running. - Apply changes using
ALTER RESOURCE GOVERNOR RECONFIGURE;
Step 3: Update Statistics and Rebuild Fragmented Indexes
- Run
EXEC sp_updatestats;on the affected database to refresh outdated statistics. - Identify fragmented indexes using:
SELECT * FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'LIMITED'); - Rebuild indexes with fragmentation above 30% using
ALTER INDEX ALL ON [TableName] REBUILD;
Step 4: Check Windows Server Performance Counters
- On Windows Server 2025, open
Performance Monitor (perfmon.exe). - Add the counter
SQLServer:SQL Statistics > Batch Requests/secandSQLServer:Workload Group Stats > CPU usage %. - Confirm whether CPU saturation at the OS level correlates with the Error 13137 timestamps found in the SQL Server error log located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
Step 5: Restart the SQL Server Service to Clear Cached Plan Anomalies
- Open
services.mscon Windows Server 2025 / Windows 11. - Locate
SQL Server (MSSQLSERVER)and select Restart. - Alternatively, run
DBCC FREEPROCCACHE;in SSMS if a full restart is not feasible in production.
Alternative or Verification Steps
- After applying the fixes, monitor the Query Store reports under
Database > Query Store > Top Resource Consuming Queriesin SSMS for 24 hours to confirm execution time metrics have stabilized. - If the error persists, run
DBCC CHECKDBto rule out underlying corruption as an alternative root cause, and review the Windows Event Viewer underApplications and Services Logs > MSSQLSERVERfor correlating hardware-level I/O warnings.