Skip to content

error()

Get the maximum relative error for a `uddsketch`

Since 1.0.0

Get the maximum relative error of a uddsketch. The correct (non-estimated) percentile falls within the range defined by approx_percentile(sketch) +/- (approx_percentile(sketch) * error(sketch)).

Calculate the maximum relative error when estimating percentiles using uddsketch.

SELECT error(uddsketch(data))
FROM generate_series(0, 100) data;
error
-------
0.001

The syntax is:

error(
sketch UddSketch
) RETURNS DOUBLE PRECISION
NameTypeDefaultRequiredDescription
sketchUddSketch-The uddsketch to determine the error of
ColumnTypeDescription
errorDOUBLE PRECISIONThe maximum relative error of any percentile estimate.