• OK, several things:

    1. The query that you posted is not the same as the one that was used in the query plan. Leaving aside the name changes (which we expect), there is an additional WHERE..AND clause on the two halves of the UNION, testing for [..Site] = '..'. Which one of these two versions is correct?

    2. Why are you using FULL OUTER JOINS? They are a very uncommon construct, and the content of your interior WHERE clauses is reducing them to INNER and LEFT OUTER joins anyway.

    3. The two interior subqueries "(SELECT ... ) As lateTime" appear to be the same within the parenthesis. Can you confirm if that is correct?

    4. The Query Plan is only the estimated query plan, not the actual one. You probably cannot get the actuals if the query does not complete, so instead, could you please execute just the [lateTime] subquery and tell us how many rows it returns?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]