amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.14k stars 281 forks source link

Changed to trim extra latch info from waitresource #59

Closed dimitri-furman closed 2 years ago

dimitri-furman commented 2 years ago

Fixes #56

erikdarlingdata commented 2 years ago

@dimitri-furman thanks!

amachanic commented 2 years ago

@dimitri-furman It looks like this only covers the sysprocesses case. Which other DMVs are impacted? Can you make sure we handle all necessary cases here? I also made a little mod to the code to make it a touch faster and less repeated.

dimitri-furman commented 2 years ago

@amachanic two other columns where new data will appear are: wait_resource in sys.dm_exec_requests and resource_description in sys.dm_os_waiting_tasks. After a quick glance at sp_whoisactive code, I don't think that will be a problem. But I haven't looked too closely, so similar change might be needed there too.

Thanks for the mod, that's better (haven't seen this use of APPLY before, thanks).

amachanic commented 2 years ago

@dimitri-furman Can you try on an impacted build, using @get_task_info = 2 ?

dimitri-furman commented 2 years ago

Can you try on an impacted build, using @get_task_info = 2 ?

Yes, we do need a change there too:

Msg 245, Level 16, State 1, Line 339
Conversion failed when converting the nvarchar value ' 1)' to data type int.

I can try to do this, but likely not this week.

amachanic commented 2 years ago

@dimitri-furman I went ahead and plugged it in following the same pattern, assuming that the same format will be used in sys.dm_os_waiting_tasks, and that the latch info is tacked on to the end. Can you confirm? Thank you!

dimitri-furman commented 2 years ago

@amachanic yes, the format is the same. I ran the latest version on the same SQL build, no longer getting an error, so should be good to go.