I noticed a big uptick in tempdb read/write. This was during the same period of time that someone ran Alter Index
and I noticed that the biggest wait at that time was LCK_M_SCH_S
.
I'm trying to track down what caused the uptick in read/write latency. All four tempdb files had the uptick, so I'm thinking it was either the schema lock from LCK_M_SCH_S
or maybe a network connectivity issue.
It has since cleared and gone back to normal so I'm thinking more towards the lock issue. The wait type was not I/O according to the SQL monitor we use, but I can't find anything online that makes the connection between LCK_M_SCH_S
and tempdb. Thoughts?
Best Answer
The LCK_M_SCH_S was most likely related to the index/table from your
ALTER INDEX
and not totempdb
.About the spike you see on the
tempdb
during theALTER INDEX
operation it might be caused by the SORT_IN_TEMPDB Option For Indexes:An index rebuild can also cause increased
tempdb
usage if theONLINE = ON
option is used, as modifications during the rebuild are maintained in a special version store intempdb
. See Temporary Disk Space for Online Index Operations for the details: