We have been trying to narrow down some SQL deadlocks recently where the below query is the culprit. Does anyone know what would be running this SQL query within Forms? My first guess is a user running a report, but I need to know for sure.
(@p__linq__0 int)SELECT
[Project2].[step_id] AS [step_id],
[Project2].[C1] AS [C1],
[Project2].[history_id] AS [history_id],
[Project2].[instance_id] AS [instance_id],
[Project2].[process_id] AS [process_id],
[Project2].[step_id1] AS [step_id1],
[Project2].[start_date] AS [start_date],
[Project2].[finish_date] AS [finish_date],
[Project2].[status] AS [status],
[Project2].[submission_id] AS [submission_id],
[Project2].[external_op] AS [external_op],
[Project2].[external_op_data1] AS [external_op_data1],
[Project2].[archived_worker_instnc_to_resume] AS [archived_worker_instnc_to_resume],
[Project2].[team_id] AS [team_id],
[Project2].[owner_snapshot_id] AS [owner_snapshot_id],
[Project2].[assigned_resume_id] AS [assigned_resume_id],
[Project2].[assigned_comment] AS [assigned_comment],
[Project2].[target_snapshot_id] AS [target_snapshot_id],
[Project2].[due_date] AS [due_date],
[Project2].[current_priority] AS [current_priority],
[Project2].[task_first_assigned_date] AS [task_first_assigned_date],
[Project2].[sent_to_prediction_server] AS [sent_to_prediction_server],
[Project2].[approver_id] AS [approver_id],
[Project2].[reminder_id] AS [reminder_id]
FROM ( SELECT
[Distinct1].[step_id] AS [step_id],
[Join4].[history_id] AS [history_id],
[Join4].[instance_id1] AS [instance_id],
[Join4].[process_id1] AS [process_id],
[Join4].[step_id1] AS [step_id1],
[Join4].[start_date] AS [start_date],
[Join4].[finish_date] AS [finish_date],
[Join4].[status1] AS [status],
[Join4].[submission_id] AS [submission_id],
[Join4].[external_op] AS [external_op],
[Join4].[external_op_data1] AS [external_op_data1],
[Join4].[archived_worker_instnc_to_resume] AS [archived_worker_instnc_to_resume],
[Join4].[team_id] AS [team_id],
[Join4].[owner_snapshot_id] AS [owner_snapshot_id],
[Join4].[assigned_resume_id] AS [assigned_resume_id],
[Join4].[assigned_comment] AS [assigned_comment],
[Join4].[target_snapshot_id] AS [target_snapshot_id],
[Join4].[due_date] AS [due_date],
[Join4].[current_priority] AS [current_priority],
[Join4].[task_first_assigned_date] AS [task_first_assigned_date],
[Join4].[sent_to_prediction_server] AS [sent_to_prediction_server],
[Join4].[approver_id] AS [approver_id],
[Join4].[reminder_id] AS [reminder_id],
CASE WHEN ([Join4].[history_id] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C1]
FROM (SELECT DISTINCT
[Extent1].[step_id] AS [step_id]
FROM [dbo].[cf_bp_worker_instance_history] AS [Extent1]
INNER JOIN [dbo].[cf_bp_worker_instances] AS [Extent2] ON [Extent1].[instance_id] = [Extent2].[instance_id]
INNER JOIN [dbo].[cf_bp_steps] AS [Extent3] ON ([Extent1].[step_id] = [Extent3].[step_id]) AND ([Extent1].[process_id] = [Extent3].[process_id])
WHERE ([Extent2].[bp_instance_id] = @p__linq__0) AND ('userTask' = [Extent3].[step_type]) AND (0 = [Extent3].[is_deleted]) ) AS [Distinct1]
LEFT OUTER JOIN (SELECT [Extent4].[history_id] AS [history_id], [Extent4].[instance_id] AS [instance_id1], [Extent4].[process_id] AS [process_id1], [Extent4].[step_id] AS [step_id1], [Extent4].[start_date] AS [start_date], [Extent4].[finish_date] AS [finish_date], [Extent4].[status] AS [status1], [Extent4].[submission_id] AS [submission_id], [Extent4].[external_op] AS [external_op], [Extent4].[external_op_data1] AS [external_op_data1], [Extent4].[archived_worker_instnc_to_resume] AS [archived_worker_instnc_to_resume], [Extent4].[team_id] AS [team_id], [Extent4].[owner_snapshot_id] AS [owner_snapshot_id], [Extent4].[assigned_resume_id] AS [assigned_resume_id], [Extent4].[assigned_comment] AS [assigned_comment], [Extent4].[target_snapshot_id] AS [target_snapshot_id], [Extent4].[due_date] AS [due_date], [Extent4].[current_priority] AS [current_priority], [Extent4].[task_first_assigned_date] AS [task_first_assigned_date], [Extent4].[sent_to_prediction_server] AS [sent_to_prediction_server], [Extent4].[approver_id] AS [approver_id], [Extent4].[reminder_id] AS [reminder_id], [Extent5].[bp_instance_id] AS [bp_instance_id], [Extent6].[step_type] AS [step_type], [Extent6].[is_deleted] AS [is_deleted]
FROM [dbo].[cf_bp_worker_instance_history] AS [Extent4]
INNER JOIN [dbo].[cf_bp_worker_instances] AS [Extent5] ON [Extent4].[instance_id] = [Extent5].[instance_id]
INNER JOIN [dbo].[cf_bp_steps] AS [Extent6] ON ([Extent4].[step_id] = [Extent6].[step_id]) AND ([Extent4].[process_id] = [Extent6].[process_id]) ) AS [Join4] ON ([Distinct1].[step_id] = [Join4].[step_id1]) AND ([Join4].[bp_instance_id] = @p__linq__0) AND ('userTask' = [Join4].[step_type]) AND (0 = [Join4].[is_deleted])
) AS [Project2]
ORDER BY [Project2].[step_id] ASC, [Project2].[C1] ASC