Is it possible to optimize this statement to get rid of the case named [aging]?
specifically, the two highlighted statements that cause 90% of all waits in the entire select statement.
4 attachments: entire SP, the CULPRIT SQL, and the full Stored Proc where it is called +screenshot that shows fully confirmed problem statements that cause 90 % of all waits here. That subquery is executed 300K times (number of resultset rows). both tables are over 100 000 000 rows and 300 columns.
THANK YOU!
Attachments:
You must be
logged in to view attached files.