OLAP Aggregate Queries : Grouping Parameter : Global Aggregates: No Grouping Parameter

Global Aggregates: No Grouping Parameter
Without a grouping parameter, an aggregate query returns a single value: the metric function computed across all selected objects. Consider the following aggregate query URI REST command:
GET /Email/Message/_aggregate?m=MAX(Size)&range=0
This aggregate query returns the largest Size value among all messages in all shards. The response in XML is:
<results>
<aggregate metric="MAX(Size)"/>
<value>16796009</value>
</results>
In JSON:
{"results": {
"aggregate": {"metric": "MAX(Size)"},
"value": "16796009"
}}
As shown, an aggregate element lists the parameters used for the aggregate query. In this case, only a metric parameter was provided. For a global aggregate, the metric value is provided in the value element.
When the grouping field is multi-valued with respect to the perspective table, the metric is applied across all values for each perspective object. For example, in this query:
GET /Email/Message/_aggregate?m=COUNT(Tags)&range=0
If Tags is an MV scalar, all values for each message are counted, so the total returned may be more than the number of objects. Furthermore, an object related to a perspective object may be processed more than once. Consider this query:
GET /Email/Message/_aggregate?m=COUNT(ExternalRecipients.MessageAddress.Domain)&shards=2014-06-01
Some messages are likely to have multiple external recipients linked to the same domain. Therefore, ExternalRecipients.MessageAddress.Domain will count the same domain multiple times for those messages.