Help with Query optimization - Sum of Payroll Balance Dimension
Only months into our post-implementation and our pension report query is consistently timing out.
I believe I have narrowed down the offending portion of the data model SQL code to the following and specifically the sub query at the bottom.
Looking at the line;
AND pra1.payroll_relationship_id = pra.payroll_relationship_id
If I replace "pra.payroll_relationship_id" with the hard-coded value for an employee, the query runs right away. As is, it will time out. Is there a better way to write this block or any tips you can share?
Content (please ensure you mask any confidential information):