min_val()

  1. min_val(digest TDigest) RETURNS DOUBLE PRECISION

Get the minimum value from a t-digest (does not work with percentile_agg or uddsketch based estimators). This is provided in order to save space when both a minimum and a percentile estimate are required as part of continuous aggregates. You can simply compute a single percentile estimator and do not need to specify a separate min aggregate, just extract the min_val from the percentile estimator.

Required Arguments

NameTypeDescription
digestTDigestThe digest to extract the min value from.

Returns

ColumnTypeDescription
min_valDOUBLE PRECISIONThe minimum value entered into the t-digest.

Sample Usages

  1. SELECT min_val(tdigest(100, data))
  2. FROM generate_series(1, 100) data;
  1. min_val
  2. -----------
  3. 1