• Multi-statement user defined functions & table variables are estimated based on 1 row, so their "cost" estimates are extremely low when compared to regular & temp tables that have actual statistics & therefore something approaching a "real" cost. Regardless, cost is not a real number and can only act, at best, as a guide. As you've already seen, you have to compare it to other measures, execution time & io.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning