percentile_cont
Aliases: percentilecont (deprecated).
percentile_cont(expression: numeric or duration, percentile: const numeric) -> expression
percentile_cont(expression, p) computes the continuous percentile of expression at fraction p between 0 and 1, using interpolation between neighboring order statistics when the quantile does not land exactly on a sample. Numeric inputs are generally coerced toward a floating result type; duration and timestamp inputs keep their temporal type with interpolated values. The result is deterministic for a given ordered multiset of inputs but differs from percentile_disc, which always returns an actual input value. It may be used in aggregate or inside window under the same grouping, ordering, frame, and range-bound restrictions as other percentile aggregates.
Domain
This is an aggregate function (aggregates rows over a group in aggregate verbs).
This is a window function (calculates over a group of multiple input rows using windowing).
Categories
Examples
aggregate p90:percentile_cont(queue_depth, 0.9), group_by(pool)
Continuous 0.9 quantile of queue_depth per pool, allowing interpolated values between observed depths.
make_col wcont:window(percentile_cont(cpu_util, 0.5), group_by(instance), order_by(valid_from), frame(back:1h))
Rolling median-style continuous percentile of cpu_util per instance over one hour using window.
Updated 18 days ago