ddsketch
Provides ddsketch aggregate function
Repository
tvondra/ddsketch
https://github.com/tvondra/ddsketch
Source
ddsketch-1.0.1.tar.gz
ddsketch-1.0.1.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
ddsketch | 1.0.1 | FUNC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4650 | ddsketch | No | Yes | No | Yes | No | Yes | - |
| Related | tdigest count_distinct topn omnisketch datasketches hll quantile lower_quantile weighted_statistics |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.1 | 1817161514 | ddsketch | - |
| RPM | PIGSTY | 1.0.1 | 1817161514 | ddsketch_$v | - |
| DEB | PIGSTY | 1.0.1 | 1817161514 | postgresql-$v-ddsketch | - |
Build
You can build the RPM / DEB packages for ddsketch using pig build:
Install
You can install ddsketch directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
Implements DDSketch, a fully-mergeable quantile sketch with relative-error guarantees. Much faster than percentile_cont and supports parallelism.
Direct Aggregation Functions
| Function | Description |
|---|---|
ddsketch_percentile(value, alpha, nbuckets, quantile) | Estimate a single percentile |
ddsketch_percentile(value, alpha, nbuckets, quantiles[]) | Estimate multiple percentiles |
ddsketch_percentile_of(value, alpha, nbuckets, value) | Estimate percentile rank of a value |
ddsketch_percentile_of(value, alpha, nbuckets, values[]) | Estimate percentile ranks of multiple values |
Pre-aggregation Functions
| Function | Description |
|---|---|
ddsketch(value, alpha, nbuckets) | Build a ddsketch from values |
ddsketch_percentile(sketch, quantile) | Estimate percentile from a pre-built sketch |
ddsketch_percentile(sketch, quantiles[]) | Estimate multiple percentiles from a pre-built sketch |
Utility Functions
| Function | Description |
|---|---|
ddsketch_count(sketch) | Return the number of items in the sketch |
ddsketch_sum(sketch, low, high) | Trimmed sum within a value range |
ddsketch_avg(sketch, low, high) | Trimmed average within a value range |
Parameters
alpha– controls accuracy and sketch size (lower = more accurate, larger)nbuckets– maximum number of buckets (each 8 bytes)
Examples
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)