Execution Plan for Scalar Function

  • Hi,

    I wanted to look at the execution plan for a scalar function but all it returns is a 'Constant Scan' at 100%. Will the queries within a scalar function still be optimized to use indexes etc?

    Thanks.

  • See SET SHOWPLAN ON in BOL. Also in Profiler, under the Performance event, check out Execution Plan, Show Plan All, Show Plan Statistics and Show Plan Text.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • Thanks for the reply. I can already see the execution plan, my question is why doesn't it show anything useful. All it shows is that SQL Server is doing a constant scan. I want to know if the queries within the scalar function are using indexes. Is this something specific to scalar functions?

    Thanks.

  • It's how scalar functions show up in exec plans. Very irritating.

    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

Viewing 4 posts - 1 through 4 (of 4 total)

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