• vsamantha35 - Thursday, December 21, 2017 12:08 PM

    Hi All,

    This is related query tuning. I have a query which is doing expensive sorting.
    Without ORDER BY clause the query is returning the result set very fast when compared with having an ORDER BY DESC clause. Is there a way to avoid sorting from db side and suppose if the developer is so adamant and not listening for remove the ORDER BY clause.  Is there an alternative way so that we can eliminate the sort operator in the execution plan.

    Attaching the plan. Please share your thoughts.

    Thanks,

    Sam

    What is the problem?  There are only seven rows of data returned.  And what do you consider very fast with out the order by versus with the order by?