• I forgot to post the EP when getting the before the IF, here it is.

    It is strange how SQL generate completely different plans for statements that actually do the same thing.