• Yeah, pretty much. The execution time and the resources used are reasonably accurate measures. The estimated costs are just that, estimates. They are the only numbers we have within execution plans, but they really can't be trusted, especially when comparing one plan to another.

    And no, instead of having a query inside the IF construct, execute a stored procedure. That separate stored proc will generate it's own plan when it gets called and not before.

    "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