Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/development/extensions-core/stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ This algorithm was proven to be numerically stable by J.L. Barlow in
"Error analysis of a pairwise summation algorithm to compute sample variance"
Numer. Math, 58 (1991) pp. 583--590

> As with all [aggregators](../../querying/sql.md#aggregation-functions), the order of operations across segments is
> non-deterministic. This means that if this aggregator operates with an input type of "float" or "double", the result
> of the aggregation may not be precisely the same across multiple runs of the query.
>
> To produce consistent results, round the variance to a fixed number of decimal places so that the results are
> precisely the same across query runs.

### Pre-aggregating variance at ingestion time

To use this feature, an "variance" aggregator must be included at indexing time.
Expand Down
7 changes: 7 additions & 0 deletions docs/querying/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ possible for two aggregators in the same SQL query to have different filters.

Only the COUNT aggregation can accept DISTINCT.

> The order of aggregation operations across segments is not deterministic. This means that non-commutative aggregation
> functions can produce inconsistent results across the same query.
>
> Functions that operate on an input type of "float" or "double" may also see these differences in aggregation
> results across multiple query runs because of this. If precisely the same value is desired across multiple query runs,
> consider using the `ROUND` function to smooth out the inconsistencies between queries.

|Function|Notes|
|--------|-----|
|`COUNT(*)`|Counts the number of rows.|
Expand Down