blocking due to long query, insert, and new queries

  • Craig,

    You're right and I don't see how I missed it:

    I moved all the conditions in the having clause to a where clause except "Sum(([ALLOCATED_AMOUNT])."

    completed in 17 seconds.

    Not only does moving it cause a ton less tempdb space, but the plan is more efficient as it weeds out rows in the proper place (where) vs HAVING clause. 'having' is designed only for conditions on aggregated columns.

Viewing post 31 (of 31 total)

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