We are seeing a lot of deadlocks with this table as well. Specifically, between the following queries:
Proc name: Workflow.dbo.insert_executing_activity
insert into search_activity (search_id, activity_name, context_id, parent_context_id, start_time, end_time)
values (@internal_id, @activity_name, @context_id, @parent_context_id, @status_time, GETUTCDATE()
Proc name: Workflow.dbo.delete_search_instance
delete from search_instance where search_id = @internal_i
and these two
Proc name: Workflow.dbo.update_exec_activity_status
update search_activity
set close_status = @status, end_time = @status_time, work_time = @work_time
where search_id = @internal_id and activity_name = @activity_name and context_id = @context_id and close_status =
Proc name: Workflow.dbo.delete_search_instance
delete from search_instance where search_id = @internal_i
It looks like the delete_search_instance proc is the common issue. Workflow is currently set to "Delete completed tasks based on a timer instead of automatically... Timeout: 300 seconds and Frequency: 1 minute.
What can we do to alleviate some of these deadlocks?