Inline Table Valued Function and Scalar Function Performance difference

  • Hi,

    Recently i faced a question in an interview, which one is better regarding performance -

    Inline Table valued function or scalar function (both are returning same output).

    Can anyone help in this regard.

    Thanks

    Samrat Sen

  • Have you tried google? There are a large number of blog posts written on that exact topic.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • sam_mastermind (11/26/2010)


    Hi,

    Recently i faced a question in an interview, which one is better regarding performance -

    Inline Table valued function or scalar function (both are returning same output).

    Can anyone help in this regard.

    Thanks

    Samrat Sen

    Although you'll find a lot of posts, etc, that will tell you, there's no better replacement than to try it yourself. You'll never forget that way.

    The other thing I'll tell you is that "It Depends". There are a lot of "rules of thumb" (and the question they asked you is one of those) where one way is better than the other 95% of the time. That also means that the other 5% of the the time, the other way is actually better.

    --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)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply