• Hmm, odd.

    Im interested in this part of the plan

    Which is pretty much the very first join between datasource and trade.

    The estimate from the hash join is 1 , the actual row count is 465,002 !

    Not much of a difference.

    2005 is getting a bit old now as is my memory of its differences over 2008/2012.

    You may be better of 'caching' the result of this join into a temp table and driving the rest from that.

    Edit:

    Just to elaborate on why this is bad :

    As it thinks that there is 1 row, it has chosen to do loop joins to the other tables in the plan.

    This would be good if there were 1 row but theres not, theres 465,000.

    If it knew there were 465,000 it would have chosen a hash (or merge) join which will be more efficient

    Dave



    Clear Sky SQL
    My Blog[/url]