Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    2

    Unanswered: Table-valued User-defined Functions

    Hello,

    I have a Multistatement Table-valued Function with mainly 3 selects in it.
    The 3 selects statements from the function, executed separatly take about 1.5'; if I want execute the function, it takes over 11' !!!!!
    Any ideea?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Try posting the code for us. We're not psychics.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    parameter sniffing maybe?

    do the query plans of the naked selects vs the function call look the same?

  4. #4
    Join Date
    Jun 2008
    Posts
    2
    Hello,

    I attach 3 files, one with the function, one with the function's query and the last with the execution plan of the main thread of the query; obviosly the execution plans of the function's query differs from the call of the function; more, the plan of the later shows only the call not the execution of function.

    I forget to put the call of the function, which is simple
    select * from fstocadhoc2(20080525)
    Attached Files Attached Files
    Last edited by raduborcan; 06-10-08 at 17:02.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •