Versions:
min_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.
min_val(digest TDigest) RETURNS DOUBLE PRECISION
Get the minimum value from a tdigest
. This does not work with percentile_agg
or uddsketch
based estimators. This saves space when you require both a
minimum and a percentile estimate as part of a continuous aggregate. You can
compute a single percentile estimator and do not need to specify a separate
min
aggregate, by extracting the min_val
from the percentile estimator.
- 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 min value from |
Returns
Column | Type | Description |
---|---|---|
min_val | DOUBLE PRECISION | The minimum value entered into the t-digest |
Sample usage
SELECT min_val(tdigest(100, data))
FROM generate_series(1, 100) data;
min_val
-----------
1
Found an issue on this page?
Report an issue!