I am using Microsoft SQL Server 2017 and recently we have come up with a situation where we see there is Wait Type IO_COMPLETION is contributing 60%. After performing update statistics this issue got disappeared. There is procedure using table variables for which we are observing IO_COMPLETION wait type for individual query level. Does performing update statistics on database will resolve IO_COMPLETION issue occured on that specific procedure ?
1 Answer
Does performing update statistics on database will resolve IO_COMPLETION issue occured on that specific procedure ?
It's possible. Bad stats can lead to bad plans, and one way a plan can be bad is to require buffering lots of rows, eg after sorting for a Merge Join. Buffered results can spill to disk, causing IO_COMPLETION waits.