跳转到主要内容

lower_quantile

Lower Quantile 聚合函数

lower_quantile · Lower Quantile 聚合函数

概览

ID扩展软件包版本类别许可证编程语言
4620lower_quantilelower_quantile1.0.3FUNCBSD-2-ClauseC
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-d-r否是否是是否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY1.0.319 18 17 16 15lower_quantile-
RPMPIGSTY1.0.319 18 17 16 15lower_quantile_$v-
DEBPIGSTY1.0.319 18 17 16 15postgresql-$v-lower-quantile-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el8.aarch64N/APIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el9.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el9.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el10.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el10.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d12.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d12.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d13.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d13.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u22.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u22.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u24.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u24.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u26.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u26.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
软件包版本平台仓库大小下载
lower_quantile_191.0.3el9.x86_64pigsty24.2 KiBlower_quantile_19-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_191.0.3el9.aarch64pigsty24.1 KiBlower_quantile_19-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_191.0.3el10.x86_64pigsty24.4 KiBlower_quantile_19-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_191.0.3el10.aarch64pigsty24.3 KiBlower_quantile_19-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-19-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-19-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-19-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-19-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-19-lower-quantile1.0.3u22.x86_64pigsty16.8 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-19-lower-quantile1.0.3u22.aarch64pigsty16.4 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-19-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-19-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-19-lower-quantile1.0.3u26.x86_64pigsty16.9 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-19-lower-quantile1.0.3u26.aarch64pigsty16.7 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
lower_quantile_181.0.3el8.x86_64pigsty24.1 KiBlower_quantile_18-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_181.0.3el8.aarch64pigsty23.9 KiBlower_quantile_18-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_181.0.3el9.x86_64pigsty24.2 KiBlower_quantile_18-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_181.0.3el9.aarch64pigsty24.1 KiBlower_quantile_18-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_181.0.3el10.x86_64pigsty24.4 KiBlower_quantile_18-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_181.0.3el10.aarch64pigsty24.3 KiBlower_quantile_18-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-18-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-18-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-18-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-18-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-18-lower-quantile1.0.3u22.x86_64pigsty16.8 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-18-lower-quantile1.0.3u22.aarch64pigsty16.4 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-18-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-18-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-18-lower-quantile1.0.3u26.x86_64pigsty16.9 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-18-lower-quantile1.0.3u26.aarch64pigsty16.7 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
lower_quantile_171.0.3el8.x86_64pigsty24.6 KiBlower_quantile_17-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_171.0.3el8.aarch64pigsty24.4 KiBlower_quantile_17-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_171.0.3el9.x86_64pigsty24.7 KiBlower_quantile_17-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_171.0.3el9.aarch64pigsty24.6 KiBlower_quantile_17-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_171.0.3el10.x86_64pigsty25.0 KiBlower_quantile_17-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_171.0.3el10.aarch64pigsty24.9 KiBlower_quantile_17-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-17-lower-quantile1.0.3d12.x86_64pigsty16.9 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-17-lower-quantile1.0.3d12.aarch64pigsty16.7 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-17-lower-quantile1.0.3d13.x86_64pigsty16.9 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-17-lower-quantile1.0.3d13.aarch64pigsty16.7 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-17-lower-quantile1.0.3u22.x86_64pigsty17.8 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-17-lower-quantile1.0.3u22.aarch64pigsty17.4 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-17-lower-quantile1.0.3u24.x86_64pigsty17.3 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-17-lower-quantile1.0.3u24.aarch64pigsty17.0 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-17-lower-quantile1.0.3u26.x86_64pigsty17.4 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-17-lower-quantile1.0.3u26.aarch64pigsty17.3 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
lower_quantile_161.0.3el8.x86_64pigsty24.2 KiBlower_quantile_16-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_161.0.3el8.aarch64pigsty24.0 KiBlower_quantile_16-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_161.0.3el9.x86_64pigsty24.3 KiBlower_quantile_16-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_161.0.3el9.aarch64pigsty24.1 KiBlower_quantile_16-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_161.0.3el10.x86_64pigsty24.5 KiBlower_quantile_16-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_161.0.3el10.aarch64pigsty24.4 KiBlower_quantile_16-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-16-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-16-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-16-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-16-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-16-lower-quantile1.0.3u22.x86_64pigsty17.6 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-16-lower-quantile1.0.3u22.aarch64pigsty17.2 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-16-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-16-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-16-lower-quantile1.0.3u26.x86_64pigsty17.0 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-16-lower-quantile1.0.3u26.aarch64pigsty16.8 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
lower_quantile_151.0.3el8.x86_64pigsty24.2 KiBlower_quantile_15-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_151.0.3el8.aarch64pigsty24.0 KiBlower_quantile_15-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_151.0.3el9.x86_64pigsty24.3 KiBlower_quantile_15-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_151.0.3el9.aarch64pigsty24.2 KiBlower_quantile_15-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_151.0.3el10.x86_64pigsty24.5 KiBlower_quantile_15-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_151.0.3el10.aarch64pigsty24.4 KiBlower_quantile_15-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-15-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-15-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-15-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-15-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-15-lower-quantile1.0.3u22.x86_64pigsty17.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-15-lower-quantile1.0.3u22.aarch64pigsty17.1 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-15-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-15-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-15-lower-quantile1.0.3u26.x86_64pigsty17.1 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-15-lower-quantile1.0.3u26.aarch64pigsty16.8 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb

源码

pig build pkg lower_quantile;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

pig repo add pgsql -u   # add both repo and update cache

使用 pig 安装扩展。

pig install lower_quantile;		# install by package name

pig install lower_quantile -v 19;   # install for PG 19
pig install lower_quantile -v 18;   # install for PG 18
pig install lower_quantile -v 17;   # install for PG 17
pig install lower_quantile -v 16;   # install for PG 16
pig install lower_quantile -v 15;   # install for PG 15

在数据库中创建扩展。

CREATE EXTENSION lower_quantile;

用法

lower_quantile: PostgreSQL 的下分位数聚合函数

实现了"下分位数"聚合,与 percentile_disc 略有不同,它返回在排序多重集中秩为 floor(1 + q*(n-1)) 的值。

CREATE EXTENSION lower_quantile;

函数

函数描述
lower_quantile(value, quantile float)计算给定分位数值(0 到 1)的下分位数

示例

-- 计算下分位数中位数
SELECT lower_quantile(i, 0.5)
FROM generate_series(1, 1000) s(i);

-- 计算第 95 百分位下分位数
SELECT lower_quantile(i, 0.95)
FROM generate_series(1, 1000) s(i);

该定义被部分论文(例如 DDSketch 论文)用于表述精度保证。

表格阅读器