• saum70 (12/30/2013)


    Hi all,

    Thanks for your replies. Yes Group by was missing but it was not the concern. Anyways, i figured out and got the performance. I used clustered index on table A and B and used OUTER APPLY and got the output within 10 sec. Thanks again

    Can you post up the query please? It provides a good closure of the thread. It also provides feedback to those who helped you and may be useful to others with a similar problem who stumble upon this thread.

    GROUP BY wasn't particularly relevant in this case, however it's always good practice to post up the whole query. If you aren't sure why a query isn't working, how can you be absolutely sure that a) the section you omit is irrelevant to those who wish to help you and b) isn't actually the cause of the problem?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden