Databases Reference
In-Depth Information
A text plan can be useful to show more details about both the Stream Aggregate and the
Compute Scalar operators, so you should also run the query in Listing 2-16.
SET SHOWPLAN_TEXT ON
GO
SELECT AVG ( ListPrice ) FROM Production . Product
GO
SET SHOWPLAN_TEXT OFF
GO
Listing 2-16.
The displayed text plan is:
|--Compute Scalar(DEFINE:([Expr1003]=CASE WHEN [Expr1004]=(0) THEN NULL ELSE
[Expr1005]/CONVERT_IMPLICIT(money,[Expr1004],0) END))
|--Stream Aggregate(DEFINE:([Expr1004]=Count(*), [Expr1005]=SUM([Product].
[ListPrice])))
|--Clustered Index Scan(OBJECT:([Product].[PK_Product_ProductID]))
The same information could be obtained from the graphical plan by selecting the
Properties window (by pressing F4) of both the Stream Aggregate and Compute Scalar
operators, and expanding the Defined Values property as shown in Figure 2-13.
Search WWH ::




Custom Search