Skip to main content

Aggregations

All latencies are measured over AWS PrivateLink within a single availability zone (us-east-1) and include the network round trip. Each request reads the latest N rows from a randomly chosen partition.

Averages​

FAVG(x)​

DescriptionExact average of x
Formulasum(x) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, Infinity: ±Infinity, Opposite infinities: NULL
ValidationMatches Python statistics.mean on fixed and random inputs

workload vs latency

last Np99 (ms)
100.51
1000.53
1,0000.95

GEOMEAN(x)​

DescriptionGeometric mean of x
Formulaproduct(x)^(1 / count(x))
PrecisionCorrectly rounded and the same in any row order: the exact product (INTEGERs exactly) and one rounding of its n-th root
Edge casesNo values: NULL, Zero: error, Negative value: error, Infinity: Infinity
ValidationMatches DuckDB geomean within 1e-9 on fixed and random inputs; pseudo-oracle against reference.py Geomean (exact), compared exactly

workload vs latency

last Np99 (ms)
100.62
1000.66
1,0001.14

GEOMETRIC_STDDEV(x)​

DescriptionSpread of x as a ×/÷ factor around its geometric mean
Formulaexp(sqrt(sum((ln(x) - avg(ln(x)))^2) / (count(x) - 1)))
PrecisionApproximate answers with error limited to the last digits since the logarithms and the exponential are rounded
Edge casesFewer than 2 values: NULL, Zero: error, Negative value: error, Infinity: Infinity, Beyond the largest double: Infinity
ValidationMatches Python scipy.stats.gstd within 1e-12 on fixed inputs; pseudo-oracle against reference.py GeometricStddev

workload vs latency

last Np99 (ms)
100.54
1000.55
1,0000.97

HARMONIC_MEAN(x)​

DescriptionHarmonic mean of x: the count over the sum of reciprocals
Formulacount(x) / sum(1 / x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, Zero: 0, Negative value: error, Infinity: adds nothing to the sum (only Infinity: Infinity)
ValidationMatches Python statistics.harmonic_mean (exact Fractions) on fixed and random inputs; pseudo-oracle against reference.py HarmonicMean

workload vs latency

last Np99 (ms)
100.65
1000.77
1,0002.14

WEIGHTED_AVG(x, w)​

DescriptionAverage of x weighted by w
Formulasum(x * w) / sum(w)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, Weights summing to 0: NULL, Infinity: ±Infinity, Opposite infinities: NULL, Infinite weight: NULL, Infinity with zero weight: NULL, Overflow: ±Infinity
ValidationMatches Python numpy.average on fixed and random inputs

workload vs latency

last Np99 (ms)
100.65
1000.63
1,0000.88

Counting​

APPROX_COUNT_DISTINCT(x)​

DescriptionEstimated number of distinct values of x
PrecisionEstimated answers with small typical error since the result is computed from a summary of the data
Edge casesNo values: 0. INTEGER, REAL, TEXT, and BLOB values are different values (1, 1.0, '1', and x'31' count as four); a REAL never shares a hash with an INTEGER between -2^51 and 2^51 or near the INTEGER limits; any other collision between values of different types happens only by chance (about 1 in 2^64 for a pair), and the two then count once.
ValidationMatches DuckDB approx_count_distinct on fixed and random inputs

workload vs latency

last Np99 (ms)
100.65
1000.67
1,0001.06

AVG_COUNT_PER_UNIQUE(x)​

DescriptionAverage number of times each distinct value appears
Formulacount(x) / count(distinct x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL
ValidationMatches Python statistics.mean on fixed and random inputs

workload vs latency

last Np99 (ms)
100.65
1000.50
1,0000.91

COUNT(x)​

DescriptionNumber of values of x
PrecisionExact answer since counts are never rounded
Edge casesNo values: 0
ValidationSQLite built-in

workload vs latency

last Np99 (ms)
100.65
1000.67
1,0001.03

COUNT_ABOVE_MEAN(x)​

DescriptionNumber of values above the mean
Formulacount(x > sum(x) / count(x))
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL, Only +Infinity: 0, Only -Infinity: values other than -Infinity, Opposite infinities: NULL
ValidationMatches an equivalent DuckDB query on fixed and random inputs

workload vs latency

last Np99 (ms)
100.64
1000.52
1,0000.77

COUNT_BELOW_MEAN(x)​

DescriptionNumber of values below the mean
Formulacount(x < sum(x) / count(x))
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL, Only +Infinity: values other than +Infinity, Only -Infinity: 0, Opposite infinities: NULL
ValidationMatches an equivalent DuckDB query on fixed and random inputs

workload vs latency

last Np99 (ms)
100.50
1000.61
1,0000.88

COUNT_DISTINCT(x)​

DescriptionNumber of distinct values of x
Formulacount(distinct x)
PrecisionExact answer since counts are never rounded
Edge casesNo values: 0
ValidationMatches DuckDB count(DISTINCT x) on fixed and random inputs

workload vs latency

last Np99 (ms)
100.65
1000.68
1,0000.75

COUNT_IF(x)​

DescriptionNumber of true values of x
Formulasum(x)
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL, Values other than 0 or 1: error
ValidationMatches Python numpy.count_nonzero on fixed inputs

workload vs latency

last Np99 (ms)
100.62
1000.63
1,0000.93

HAS_NO_DUPLICATES(x)​

Description1 if no value of x repeats, else 0
Formulacount(distinct x) = count(x)
PrecisionExact answer since counts are never rounded
Edge casesNo values: 1
ValidationMatches an equivalent DuckDB query on fixed and random inputs

workload vs latency

last Np99 (ms)
100.52
1000.69
1,0000.95

PERCENT_UNIQUE(x)​

DescriptionShare of values that are distinct
Formulacount(distinct x) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL
ValidationMatches an equivalent DuckDB query on fixed and random inputs

workload vs latency

last Np99 (ms)
100.66
1000.59
1,0000.77

Dispersion​

L_SCALE(x)​

DescriptionHalf the mean absolute difference between any two values of x
Formulasum((2i - n - 1) * x(i)) / (n * (n - 1)), x(i) sorted ascending
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 values: NULL, Infinity: error, Constant values: 0
ValidationMatches Python scipy.stats.lmoment (order 2) within 1e-9 on fixed inputs; pseudo-oracle against reference.py LScale

workload vs latency

last Np99 (ms)
100.44
1000.67
1,0000.91

MAD(x)​

DescriptionMedian absolute deviation of x
Formulamedian(abs(x - median(x)))
PrecisionValues are used as doubles (an INTEGER beyond 2^53 is first rounded to its nearest double); from those doubles the MAD is computed exactly and rounded once, so answers are consistent regardless of row order
Edge casesNo values: NULL, Infinite or undefined median: NULL, Infinite middle deviation: Infinity
ValidationMatches Python scipy.stats.median_abs_deviation on fixed inputs

workload vs latency

last Np99 (ms)
100.69
1000.69
1,0000.95

SEM(x)​

DescriptionStandard error of the mean using the population standard deviation
Formulasqrt(sum((x - avg(x))^2) / count(x)) / sqrt(count(x))
PrecisionCorrectly rounded and the same in any row order: exact sums (INTEGERs exactly) and one rounding of the square root
Edge casesNo values: NULL, One value: 0, Infinity or max - min beyond range: error
ValidationMatches DuckDB sem within 1e-9 on fixed and random inputs; pseudo-oracle against reference.py Sem (exact), compared exactly

workload vs latency

last Np99 (ms)
100.69
1000.67
1,0000.98

STDDEV_POP(x)​

DescriptionPopulation standard deviation without bias correction
Formulasqrt((sum(x^2) - sum(x)^2 / count(x)) / count(x))
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, One value: 0, Infinity: error
ValidationMatches Python statistics.pstdev on fixed and random inputs

workload vs latency

last Np99 (ms)
100.60
1000.69
1,0001.12

STDDEV_SAMP(x)​

DescriptionSample standard deviation with bias correction
Formulasqrt((sum(x^2) - sum(x)^2 / count(x)) / (count(x) - 1))
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 values: NULL, Infinity or overflow: error
ValidationMatches Python statistics.stdev on fixed and random inputs

workload vs latency

last Np99 (ms)
100.63
1000.67
1,0001.12

VAR_POP(x)​

DescriptionPopulation variance without bias correction
Formula(sum(x^2) - sum(x)^2 / count(x)) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, One value: 0, Infinity or overflow: error
ValidationMatches Python statistics.pvariance on fixed and random inputs

workload vs latency

last Np99 (ms)
100.53
1000.54
1,0000.96

VAR_SAMP(x)​

DescriptionSample variance with bias correction
Formula(sum(x^2) - sum(x)^2 / count(x)) / (count(x) - 1)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 values: NULL, Infinity or overflow: error
ValidationMatches Python statistics.variance on fixed and random inputs

workload vs latency

last Np99 (ms)
100.54
1000.66
1,0001.08

Extremes​

ARG_MAX(arg, val)​

DescriptionValue of one column where another column is largest
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, Ties: smallest arg
ValidationMatches DuckDB arg_max on fixed and random inputs

workload vs latency

last Np99 (ms)
100.48
1000.60
1,0001.07

ARG_MIN(arg, val)​

DescriptionValue of one column where another column is smallest
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, Ties: smallest arg
ValidationMatches DuckDB arg_min on fixed inputs

workload vs latency

last Np99 (ms)
100.55
1000.66
1,0000.84

MAX(x)​

DescriptionLargest value of x
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL
ValidationSQLite built-in

workload vs latency

last Np99 (ms)
100.69
1000.69
1,0000.96

MAX_COUNT(x)​

DescriptionNumber of values equal to the largest
Formulacount(x = max(x))
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL
ValidationMatches Python collections.Counter on fixed and random inputs

workload vs latency

last Np99 (ms)
100.62
1000.67
1,0001.06

MAX_INTERSECTIONS_POSITION(start, end)​

DescriptionLeftmost start value where the most [start, end) intervals overlap
Formulamin p over starts with max count(start <= p < end)
PrecisionExact answers since the answer is one of the input values
Edge casesNo rows or only empty intervals: NULL, start > end: error, start = end: covers nothing, Touching intervals: do not overlap, Ties: leftmost, INTEGER/REAL compared exactly
ValidationMatches ClickHouse maxIntersectionsPosition on typed inputs; pseudo-oracle against reference.py MaxIntersectionsPosition

workload vs latency

last Np99 (ms)
100.65
1000.61
1,0001.13

MIN(x)​

DescriptionSmallest value of x
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL
ValidationSQLite built-in

workload vs latency

last Np99 (ms)
100.51
1000.55
1,0001.07

MIN_COUNT(x)​

DescriptionNumber of values equal to the smallest
Formulacount(x = min(x))
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL
ValidationMatches Python collections.Counter on fixed and random inputs

workload vs latency

last Np99 (ms)
100.61
1000.63
1,0000.99

MIN_K(x, k)​

Descriptionk smallest values, ascending, as a JSON array (duplicates kept)
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, k NULL, not an integer, or outside 1 to 999,999: error
ValidationMatches DuckDB min on fixed and random inputs

workload vs latency

last Np99 (ms)
100.51
1000.67
1,0001.10

RANGE(x)​

DescriptionLargest minus smallest value of x
Formulamax(x) - min(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, Infinity: Infinity, All values the same infinity: NULL, Overflow: Infinity, Equal INTEGER and REAL extremes: the INTEGER is kept
ValidationMatches Python numpy.ptp on fixed and random inputs

workload vs latency

last Np99 (ms)
100.64
1000.65
1,0001.10

Frequency​

APPROX_TOP_K(x, k)​

DescriptionApproximate k most frequent values of x
PrecisionEstimated answers with small typical error since the result is computed from a summary of the data
Edge casesNo values: NULL, k NULL, not an integer, or outside 1 to 999,999: error
ValidationMatches DuckDB approx_top_k on fixed and random inputs

workload vs latency

last Np99 (ms)
100.68
1000.57
1,0001.20

DISTINCT_VALUES(x)​

DescriptionDistinct values, ascending, as a JSON array
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL
ValidationMatches an equivalent DuckDB query on fixed and random inputs

workload vs latency

last Np99 (ms)
100.69
1000.59
1,0000.95

MODE(x)​

DescriptionMost frequent value of x
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL
ValidationMatches DuckDB mode on fixed and random inputs

workload vs latency

last Np99 (ms)
100.61
1000.54
1,0000.79

SINGLE_VALUE_OR_NULL(x)​

DescriptionThe one distinct non-NULL value of x, or NULL
Formulax when count(DISTINCT x) = 1, else NULL
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, Two different values: NULL, INTEGER/REAL compared exactly (1 = 1.0), Returned form: INTEGER if seen, -0.0 only when every zero is -0.0, TEXT/BLOB: error
ValidationMatches ClickHouse singleValueOrNull on typed inputs; pseudo-oracle against reference.py SingleValueOrNull

workload vs latency

last Np99 (ms)
100.63
1000.68
1,0001.09

TOP_K_FREQUENCIES(x, k)​

DescriptionCounts of the k most common values, as a JSON array
PrecisionExact answer since counts are never rounded
Edge casesNo values: NULL, k NULL, not an integer, or outside 1 to 999,999: error
ValidationMatches Python collections.Counter.most_common on fixed and random inputs

workload vs latency

last Np99 (ms)
100.63
1000.66
1,0000.91

WEIGHTED_TOP_K(x, w, k)​

DescriptionThe k values with the largest total weight, largest first, as a JSON array
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, k NULL, not an integer, or outside 1 to 999,999: error, +Infinity total weight: ranked first, -Infinity total weight: ranked last, Opposite infinite weights: ranked last
ValidationMatches ClickHouse topKWeighted on fixed inputs

workload vs latency

last Np99 (ms)
100.68
1000.59
1,0000.98

Quantiles​

APPROX_QUANTILE(x, q)​

DescriptionApproximate quantile of x at q
PrecisionEstimated answers with small typical error since the result is computed from a summary of the data
Edge casesNo values: NULL, q NULL or outside -1 to 1: error, Interpolating between opposite infinities: NULL, Equal values at q = 0 or 1: +0.0 unless every tied zero is -0.0
ValidationMatches DuckDB approx_quantile on fixed and random inputs

workload vs latency

last Np99 (ms)
100.54
1000.77
1,0001.45

EXPECTILE(x, q)​

DescriptionExpectile of x at q: a tail level that moves with how far the tail reaches
Formulat with a * sum(max(x - t, 0)) = (1 - a) * sum(max(t - x, 0)), a = q (a = 1 - |q| when q < 0)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, q NULL or outside -1 to 1: error, q = 0: minimum, q = 1: maximum, A zero minimum or maximum: +0.0 unless every zero is -0.0, Infinity: ±Infinity, Opposite infinities: NULL
ValidationMatches Python scipy.stats.expectile within 1e-9 on fixed inputs; pseudo-oracle against reference.py Expectile

workload vs latency

last Np99 (ms)
100.67
1000.64
1,0001.02

QUANTILE_CONT(x, q)​

DescriptionInterpolated quantile of x at q
Formulax[floor(r)] + (r - floor(r)) * (x[ceil(r)] - x[floor(r)]), r = (count(x) - 1) * |q|, x sorted ascending (descending when q < 0)
PrecisionExact on the values as stored (INTEGER and REAL; an INTEGER beyond 2^53 is not rounded first), only the final answer is rounded, so answers are consistent regardless of row order
Edge casesNo values: NULL, q NULL or outside -1 to 1: error, Interpolating between opposite infinities: NULL, A zero result: +0.0 unless every zero is -0.0
ValidationMatches Python numpy.quantile on fixed and random inputs

workload vs latency

last Np99 (ms)
100.67
1000.48
1,0000.86

QUANTILE_DISC(x, q)​

DescriptionValue of x at quantile q
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, q NULL or outside -1 to 1: error, Equal INTEGER and REAL: the INTEGER, -0.0 and +0.0: +0.0 unless every tied zero is -0.0
ValidationMatches Python numpy.quantile on fixed and random inputs

workload vs latency

last Np99 (ms)
100.67
1000.65
1,0000.93

RESERVOIR_QUANTILE(x, q[, sample_size])​

DescriptionValue of x at quantile q from a random sample
PrecisionEstimated answers with small typical error since the result is computed from a summary of the data
Edge casesNo values: NULL, q NULL or outside -1 to 1: error, sample_size NULL, not an integer, or outside 1 to 2,147,483,647: error, Equal INTEGER and REAL: the INTEGER, -0.0: returned as +0.0
ValidationMatches DuckDB reservoir_quantile on fixed and random inputs

workload vs latency

last Np99 (ms)
100.55
1000.70
1,0001.08

WEIGHTED_QUANTILE_CONT(x, w, q)​

DescriptionInterpolated quantile of x repeated w times, at q
Formulax[k] + (r - k) * (x[k+1] - x[k]), r = (sum(w) - 1) * |q|, k = floor(r), x[i] the i-th of the values each repeated w times, sorted ascending (descending when q < 0)
PrecisionExact on the values as stored (INTEGER and REAL; an INTEGER beyond 2^53 is not rounded first), only the final answer is rounded, so answers are consistent regardless of row order
Edge casesNo values: NULL, Weights summing to 0: NULL, Negative, infinite, or non-whole weight: error, q NULL or outside -1 to 1: error, Interpolating between opposite infinities: NULL, A zero result: +0.0 unless every zero with a weight is -0.0
ValidationMatches ClickHouse quantileExactWeightedInterpolated on fixed inputs; pseudo-oracle against reference.py WeightedQuantileCont (equal to QUANTILE_CONT on repeated values)

workload vs latency

last Np99 (ms)
100.49
1000.55
1,0001.02

WEIGHTED_QUANTILE_DISC(x, w, q)​

DescriptionSmallest value whose running weight reaches q × total weight
PrecisionExact answers since the answer is one of the input values
Edge casesNo values: NULL, Weights summing to 0: NULL, Negative or infinite weight: error, q NULL or outside -1 to 1: error, Equal INTEGER and REAL: the INTEGER, -0.0 and +0.0: +0.0 unless every tied zero is -0.0 (values with weight 0 do not count)
ValidationMatches Python numpy.quantile on fixed and random inputs

workload vs latency

last Np99 (ms)
100.53
1000.72
1,0001.08

Regression​

CORR(y, x)​

DescriptionCorrelation coefficient of y and x
Formula(sum(x * y) - sum(x) * sum(y) / count(x)) / sqrt((sum(x^2) - sum(x)^2 / count(x)) * (sum(y^2) - sum(y)^2 / count(y)))
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Constant x or y: NULL, Infinity: error
ValidationMatches DuckDB corr on fixed and random inputs

workload vs latency

last Np99 (ms)
100.55
1000.69
1,0001.17

COVAR_POP(y, x)​

DescriptionPopulation covariance of y and x
Formula(sum(x * y) - sum(x) * sum(y) / count(x)) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, One pair: 0, Infinity or result beyond range: NULL
ValidationMatches DuckDB covar_pop on fixed and random inputs

workload vs latency

last Np99 (ms)
100.50
1000.68
1,0001.16

COVAR_SAMP(y, x)​

DescriptionSample covariance of y and x
Formula(sum(x * y) - sum(x) * sum(y) / count(x)) / (count(x) - 1)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Infinity or result beyond range: NULL
ValidationMatches DuckDB covar_samp on fixed and random inputs

workload vs latency

last Np99 (ms)
100.63
1000.67
1,0001.03

RANK_CORR(y, x)​

DescriptionRank correlation of y and x (Pearson of the average ranks)
FormulaSxy / sqrt(Sxx · Syy) over the average ranks of x and y
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Constant x or y: NULL, Ties: average ranks, INTEGER/REAL compared exactly
ValidationMatches ClickHouse rankCorr on inputs without ties; pseudo-oracle against reference.py RankCorr

workload vs latency

last Np99 (ms)
100.67
1000.65
1,0001.09

REGR_AVGX(y, x)​

DescriptionAverage of x over complete (y, x) pairs
Formulasum(x) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, Infinity: ±Infinity, Opposite infinities: NULL
ValidationMatches Python statistics.mean on fixed and random inputs

workload vs latency

last Np99 (ms)
100.50
1000.66
1,0001.00

REGR_AVGY(y, x)​

DescriptionAverage of y over complete (y, x) pairs
Formulasum(y) / count(y)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, Infinity: ±Infinity, Opposite infinities: NULL
ValidationMatches Python statistics.mean on fixed and random inputs

workload vs latency

last Np99 (ms)
100.66
1000.57
1,0001.02

REGR_COUNT(y, x)​

DescriptionNumber of complete (y, x) pairs
PrecisionExact answer since counts are never rounded
Edge casesNo pairs: 0
ValidationMatches DuckDB regr_count on fixed and random inputs

workload vs latency

last Np99 (ms)
100.45
1000.57
1,0000.83

REGR_INTERCEPT(y, x)​

DescriptionIntercept of the least-squares line of y on x
Formula(sum(y) - REGR_SLOPE(y, x) * sum(x)) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Constant x: NULL, Infinite y: NULL, Infinite x: error, Intercept beyond range: NULL
ValidationMatches DuckDB regr_intercept on fixed and random inputs

workload vs latency

last Np99 (ms)
100.64
1000.67
1,0001.14

REGR_R2(y, x)​

DescriptionCoefficient of determination of the least-squares line of y on x
FormulaCORR(y, x)^2
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Constant x: NULL, Constant y: 1, Infinity: error
ValidationMatches DuckDB regr_r2 on fixed and random inputs

workload vs latency

last Np99 (ms)
100.68
1000.56
1,0000.86

REGR_SLOPE(y, x)​

DescriptionSlope of the least-squares line of y on x
Formula(sum(x * y) - sum(x) * sum(y) / count(x)) / (sum(x^2) - sum(x)^2 / count(x))
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Constant x: NULL, Infinite y: NULL, Infinite x: error, Slope beyond range: NULL
ValidationMatches DuckDB regr_slope on fixed and random inputs

workload vs latency

last Np99 (ms)
100.51
1000.58
1,0001.17

REGR_SXX(y, x)​

DescriptionSum of squared deviations of x
Formulasum(x^2) - sum(x)^2 / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, One pair: 0, Infinite x or result beyond range: error
ValidationMatches Python statistics module (exact sum of squares) on fixed and random inputs

workload vs latency

last Np99 (ms)
100.53
1000.55
1,0000.83

REGR_SXY(y, x)​

DescriptionSum of products of the deviations of y and x
Formulasum(x * y) - sum(x) * sum(y) / count(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, One pair: 0, Infinity or result beyond range: NULL
ValidationMatches DuckDB regr_sxy on fixed and random inputs

workload vs latency

last Np99 (ms)
100.52
1000.69
1,0000.83

REGR_SYY(y, x)​

DescriptionSum of squared deviations of y
Formulasum(y^2) - sum(y)^2 / count(y)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo pairs: NULL, One pair: 0, Infinite y or result beyond range: error
ValidationMatches Python statistics module (exact sum of squares) on fixed and random inputs

workload vs latency

last Np99 (ms)
100.68
1000.72
1,0000.95

THEIL_SEN_SLOPE(y, x)​

DescriptionMedian of the slopes between every two points (y, x)
Formulamedian((y_j - y_i) / (x_j - x_i)) over i < j with x_i <> x_j
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 pairs: NULL, Every x equal: NULL, Infinite x: error, Infinite y: NULL, Beyond the largest double: NULL
ValidationMatches Python scipy.stats.theilslopes within 1e-9 on fixed inputs; pseudo-oracle against reference.py TheilSenSlope

workload vs latency

last Np99 (ms)
100.62
1000.84
1,00010.05

WASSERSTEIN_DISTANCE(u, v)​

DescriptionArea between the two columns' empirical CDFs, in the values' units
Formulasum(abs(U(t) - V(t)) * (next(t) - t)) over the sorted union of u and v
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesA column with no values: NULL, NULLs skipped per value, Different shares of an infinity: Infinity, Same shares: finite, Overflow: Infinity
ValidationMatches Python scipy.stats.wasserstein_distance within 1e-9 on fixed inputs; pseudo-oracle against reference.py WassersteinDistance

workload vs latency

last Np99 (ms)
100.52
1000.69
1,0000.97

Shape​

ENTROPY(x)​

DescriptionEntropy in bits of the distribution of x's values
PrecisionApproximate answers with error limited to the last digit since intermediate logarithms are rounded
Edge casesNo values: 0
ValidationMatches DuckDB entropy on fixed and random inputs

workload vs latency

last Np99 (ms)
100.63
1000.67
1,0000.98

KURTOSIS(x)​

DescriptionSample excess kurtosis with bias correction
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 4 values: NULL, All values equal: NULL, Infinity: error
ValidationMatches DuckDB kurtosis on fixed and random inputs

workload vs latency

last Np99 (ms)
100.64
1000.68
1,0001.18

KURTOSIS_POP(x)​

DescriptionPopulation excess kurtosis without bias correction
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesFewer than 2 values: NULL, All values equal: NULL, Infinity: error
ValidationMatches DuckDB kurtosis_pop on fixed and random inputs

workload vs latency

last Np99 (ms)
100.64
1000.68
1,0001.18

SKEWNESS(x)​

DescriptionSample skewness with bias correction
PrecisionApproximate answers since intermediate square roots and divisions are rounded
Edge casesFewer than 3 values: NULL, All values equal: NULL, Infinity or max - min beyond range: error
ValidationMatches DuckDB skewness on fixed and random inputs

workload vs latency

last Np99 (ms)
100.56
1000.62
1,0001.30

SKEWNESS_POP(x)​

DescriptionPopulation skewness without bias correction
Formulam3 / m2^1.5, with m2 = Σ(x − x̄)²/n and m3 = Σ(x − x̄)³/n
PrecisionApproximate answers since intermediate square roots and divisions are rounded
Edge casesFewer than 2 values: NULL, All values equal: NULL, Infinity or max - min beyond range: error
ValidationMatches ClickHouse skewPop on fixed inputs; pseudo-oracle against reference.py SkewnessPop

workload vs latency

last Np99 (ms)
100.76
1000.73
1,0001.36

Summation​

FSUM(x)​

DescriptionExact sum of x
Formulasum(x)
PrecisionConsistent answers regardless of row order since only final answer is rounded
Edge casesNo values: NULL, Infinity: ±Infinity, Opposite infinities: NULL, Overflow: ±Infinity
ValidationMatches Python math.fsum on fixed and random inputs

workload vs latency

last Np99 (ms)
100.55
1000.56
1,0001.08

PRODUCT(x)​

DescriptionProduct of x
PrecisionCorrectly rounded and the same in any row order: the exact product (INTEGERs exactly), rounded once
Edge casesNo values: NULL, Infinity: ±Infinity, Zero times infinity: NULL, Overflow: ±Infinity
ValidationMatches Python math.prod on fixed and random inputs

workload vs latency

last Np99 (ms)
100.48
1000.56
1,0001.26