Versions:
max_val() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
max_val(digest TDigest) RETURNS DOUBLE PRECISION
Get the maximum value from a tdigest
. This does not work with percentile_agg
or uddsketch
based estimators. This is provided in order to save space when
both a maximum and a percentile estimate are required as part of continuous
aggregates. You can calculate a single percentile estimator by extracting the
max_val
from the percentile estimator, without needing to specify a separate
max
aggregate.
- For more information about percentile approximation algorithms, see advanced aggregation methods.
- For more information about percentile approximation functions, see the hyperfunctions documentation.
Required arguments
Name | Type | Description |
---|---|---|
digest | TDigest | The digest to extract the max value from |
Returns
Column | Type | Description |
---|---|---|
max_val | DOUBLE PRECISION | The maximum value entered into the t-digest. |
Sample usage
SELECT max_val(tdigest(100, data))
FROM generate_series(1, 100) data;
max_val
---------
100
Found an issue on this page?
Report an issue!