The ScalarAggOp operator keeps track of running information about an input data stream, such as the number of rows in the stream, or the maximum value of a given column in the stream.
The ScalarAggOp operator prints a list of up to 10 messages describing the scalar aggregation operations it executes. The message has the following format:
Evaluate Ungrouped <Type of Aggregate> Aggregate
<Type of Aggregate>
can
be any of the following: count, sum, average, min, max,
any, once-unique, count-unique, sum-unique, average-unique,
or once.
The following query performs a ScalarAggOp (in other words, unwrapped) aggregation on the authors table in the pubs2 database:
1> use pubs2 2> go 1> set showplan on 2> go 1> select count(*) from authors 2> go QUERY PLAN FOR STATEMENT 1 (at line 1). 2 operator(s) under root The type of query is SELECT. ROOT:EMIT Operator |SCALAR AGGREGATE Operator | Evaluate Ungrouped COUNT AGGREGATE. | | |SCAN Operator | | FROM TABLE | | authors | | Index : aunmind | | Forward Scan. | | Positioning at index start. | | Index contains all needed columns. Base table will not be read. | | Using I/O Size 4 Kbytes for index leaf pages. | | With LRU Buffer Replacement Strategy for index leaf pages. ----------- 23 (1 row affected)
The ScalarAggOp message indicates that the query to be executed is an ungrouped count aggregation.