This join query is extremely slow:
Select OP.* from
DPE-WorkflowsAndMessages-INT OP JOIN
DPE-WorkflowsAndMessages-INT WF ON OP.workflowId = META(WF).id where OP.type = ‘AkvOpenItemDao’ AND WF.type = ‘WorkflowDao’ and OP.userId = ‘5b96fdb4-8f15-4452-a98a-be1fe3a4435b’ and (OP.completedAt is null OR
(OP.completedAt is not null and OP.actionTaken = true and WF.completionDate is null));
Any suggestions to improve the execution time?