DuckDB includes a reservoir_quantile()
function that allows us to compute approximate quantiles efficiently. It provides the approximate quantile using reservoir sampling. This function can be handy when working with large datasets where exact quantile computation would be too slow or resource-intensive.
In this article, we will explore how the reservoir_quantile()
function works, along with examples to demonstrate its usage.