Hi all,
I am trying to understand why the below query shows a very high plan count (around 700) on our sql server, I also suspect that it is locking the table during the update. I assume that it has something to do with the columns that get set to the value of another column from the same row (since everything else is parameterized) as indicated by "PrevUpdate=LastUpdate" and "PrevRegData=RegData" . Can anyone help with suggestions on how this query could be improved ?
Update RawDeviceData SET Timestamp=@Timestamp, PrevNumVals=NumVals, PrevUpdate=LastUpdate, NumVals=@data, LastUpdate=@LastUpdate, Msg=@Msg, PrevRegData=RegData, RegData=@RegData WHERE hid=@hid
The RawDeviceData Table currently has 2 indexes on it the HID column (this is a clustered index) and another column HardwareID (non-clustered)
Thank you