Help with execution Plan

  • Hi all,

    I am trying to learn Execution Plan reading. I executed the below query

    USE [AdventureWork2008]

    GO

    SELECT *

    FROM Sales.SalesOrderHeader H INNER JOIN

    Sales.SalesOrderDetail D ON H.SalesOrderID=D.SalesOrderID

    The above script is a normal Select script where as its execution plan shows that the query is performing Compute Scalar operation

    , i am not able to understand what is the need that a simple select query needs to Compute scalar operation.

  • One or both of the sales order tables has a computed column defined in it. That's your compute scalar.

    If you just select salesorderID and salesOrderDetailID you shouldn't see that operator.

    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
  • Investigate the properties of the Compute Scalar operator - right-click on the icon, choose "Properties". Expand the collapsed nodes.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Shadab Shah (3/4/2013)


    Start with this http://www.red-gate.com/community/books/sql-server-execution-plans

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

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

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