We have spotted a query that has suddenly gone rogue. Over the last 5 days it went from running in under 2 seconds to taking over 12 seconds. I can see from SolarWinds Database Performance Analyzer that that this started suddenly on 8/1. The number of rows processed daily jumped from around 75,000 to now over 125,000 yesterday. Number of executions has stayed steady at around 4600 per day. Physical reads have gradually plummeted from around 500,000 per day to just under 65,000 yesterday while logical reads has skyrocketed from just under 500,000 to 1.5 million yesterday. There were no index changes on 7/31 or early on 8/1. The procedure itself was not changed. I did think about whether there were simply suddenly more rows to process so I looked at the tables involved. I am not daily tracking table growth so I had to compare row counts from about two months ago when I restored a backup of prod to Dev. There are some tables that have grown by a few million rows. I looked at stats on those tables. Some stats have not updated in 2-3 months. I have trace flag 2371 enabled to address the issue of auto update stats not updating soon enough for large tables. I manually updated the stats for a particular one that was old but it made no different in the query plan and the estimated and actual rows information did not change.I am not particularly adept at Profiler or XEvents, but I used the Query Wait Statistic template to make an XEvents session to filter on one of the sessions running the rogue query. Any ideas would be great.
↧