• GilaMonster (4/11/2013)


    It won't be due to multiple executions of getdate. The function is fast, but besides that it will only be evaluated once in the query execution (otherwise you'd get multiple different dates in a long-running query, which you don;'t).

    Probably has to do with row estimations, difference between how the optimiser handles the constant values vs the parameters (or were they variables?).

    Any chance of seeing the exec plan of both?

    Hmm, I just knew that I should have kept my mouth shut on this one! 🙂

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.