Is it possible to optimize this SQL to get rid of 2 highlighted subqueries?

  • 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.

    Likes to play Chess

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply