• It's an interesting case where the optimizer seems to have 2 choices that seem very similar. In situations like this, minor changes in the query, plan cache, or data could push it either way.

    Were you able to try a covering index on the query, and if so, did it help with the speed and execution plan?

    Also, can you confirm that the execution plan and read stats are the same for the temp table version and the normal version of the schema?