• shyam00 (7/5/2013)


    Thanks for the reply.

    Is there any way to tackle my scenario mentioned here.?

    I need to combine (UNION) two non related derived tables and create an indexed view on top of that. Since UNION operation is not allowed under indexed views, I had tried to join then using OUTER JOIN. (I need data from both the non related derived tables unconditionally)

    Please advice.

    You're experiencing difficulty in creating an indexed view. Ok, so backtrack for a moment. View indexing is a performance measure. Somewhere, you're attempting to use these two tables, JOINed or UNIONed or whatever, in another query. Can you show an example of such a query, and if possible an actual execution plan? In the event that the indexed view you would ideally like to see is impossible to create, there may well be alternative means of accelerating the queries that the view would by used by.

    “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