• Todd Young-359443 (10/15/2012)


    I was able to work at home this weekend and found the answer. When calling

    at UDF that does not access any database table and is used more like a macro,

    the performance hit is negligible.

    The raw difference in a 20,000 row dataset was 200 milliseconds. When I removed

    the overhead of the three DateAdd functions it dropped to 100 milliseconds.

    We are keeping the function in production and have dropped this as a candidate

    for optimization.

    I guess it really depends on what you call "negligible". You're talking about a function that runs twice as fast and that's not "negligible" especially when you consider that you're only working with 20,000 rows.

    "Mind the pennies and the dollars will take care of themselves." 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)