quantile
Quantile aggregation function
quantile : Quantile aggregation function
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4610 | quantile | quantile | 1.1.8 |
FUNC | BSD-2-Clause | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | ddsketch tdigest weighted_statistics lower_quantile topn count_distinct omnisketch datasketches hll |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.8 |
18 17 16 15 14 | quantile |
- |
| RPM | PIGSTY | 1.1.8 |
18 17 16 15 14 | quantile_$v |
- |
| DEB | PIGSTY | 1.1.8 |
18 17 16 15 14 | postgresql-$v-quantile |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| el8.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| el9.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| el9.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| el10.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| el10.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| d12.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| d12.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| d13.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| d13.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u22.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u22.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u24.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u24.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u26.x86_64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
| u26.aarch64 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 | PIGSTY 1.1.8 |
Source
github.com/tvondra/quantile
quantile-1.1.8.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Provides aggregate functions to compute quantiles. Overloaded for int, bigint, double precision, and numeric.
Functions
| Function | Description |
|---|---|
quantile(value, quantile float) |
Compute a single quantile (0 to 1) |
quantile(value, quantiles float[]) |
Compute multiple quantiles at once, returns array |
Examples
Note: Since PostgreSQL 9.4, built-in percentile_cont and percentile_disc functions are available. Consider using those first and only use this extension if it provides measurably better performance for your workload.