跳转到主要内容

floatfile

将浮点数组存储到文件中而不是堆表中

floatfile · 将浮点数组存储到文件中而不是堆表中

概览

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

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY1.3.119 18 17 16 15floatfile-
RPMPIGSTY1.3.119 18 17 16 15floatfile_$v-
DEBPIGSTY1.3.119 18 17 16 15postgresql-$v-floatfile-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
el8.aarch64N/APIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
el9.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
el9.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
el10.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
el10.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
d12.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
d12.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
d13.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
d13.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u22.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u22.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u24.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u24.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u26.x86_64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
u26.aarch64PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1PIGSTY 1.3.1
软件包版本平台仓库大小下载
floatfile_191.3.1el9.x86_64pigsty54.5 KiBfloatfile_19-1.3.1-1PGSTY.el9.x86_64.rpm
floatfile_191.3.1el9.aarch64pigsty53.4 KiBfloatfile_19-1.3.1-1PGSTY.el9.aarch64.rpm
floatfile_191.3.1el10.x86_64pigsty55.5 KiBfloatfile_19-1.3.1-1PGSTY.el10.x86_64.rpm
floatfile_191.3.1el10.aarch64pigsty54.3 KiBfloatfile_19-1.3.1-1PGSTY.el10.aarch64.rpm
postgresql-19-floatfile1.3.1d12.x86_64pigsty44.5 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~bookworm_amd64.deb
postgresql-19-floatfile1.3.1d12.aarch64pigsty43.1 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~bookworm_arm64.deb
postgresql-19-floatfile1.3.1d13.x86_64pigsty45.0 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~trixie_amd64.deb
postgresql-19-floatfile1.3.1d13.aarch64pigsty43.6 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~trixie_arm64.deb
postgresql-19-floatfile1.3.1u22.x86_64pigsty46.8 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~jammy_amd64.deb
postgresql-19-floatfile1.3.1u22.aarch64pigsty46.0 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~jammy_arm64.deb
postgresql-19-floatfile1.3.1u24.x86_64pigsty46.9 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~noble_amd64.deb
postgresql-19-floatfile1.3.1u24.aarch64pigsty45.7 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~noble_arm64.deb
postgresql-19-floatfile1.3.1u26.x86_64pigsty46.9 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~resolute_amd64.deb
postgresql-19-floatfile1.3.1u26.aarch64pigsty46.4 KiBpostgresql-19-floatfile_1.3.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
floatfile_181.3.1el8.x86_64pigsty53.0 KiBfloatfile_18-1.3.1-1PGSTY.el8.x86_64.rpm
floatfile_181.3.1el8.aarch64pigsty52.0 KiBfloatfile_18-1.3.1-1PGSTY.el8.aarch64.rpm
floatfile_181.3.1el9.x86_64pigsty54.5 KiBfloatfile_18-1.3.1-1PGSTY.el9.x86_64.rpm
floatfile_181.3.1el9.aarch64pigsty53.4 KiBfloatfile_18-1.3.1-1PGSTY.el9.aarch64.rpm
floatfile_181.3.1el10.x86_64pigsty55.5 KiBfloatfile_18-1.3.1-1PGSTY.el10.x86_64.rpm
floatfile_181.3.1el10.aarch64pigsty54.3 KiBfloatfile_18-1.3.1-1PGSTY.el10.aarch64.rpm
postgresql-18-floatfile1.3.1d12.x86_64pigsty44.5 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~bookworm_amd64.deb
postgresql-18-floatfile1.3.1d12.aarch64pigsty43.1 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~bookworm_arm64.deb
postgresql-18-floatfile1.3.1d13.x86_64pigsty45.0 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~trixie_amd64.deb
postgresql-18-floatfile1.3.1d13.aarch64pigsty43.6 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~trixie_arm64.deb
postgresql-18-floatfile1.3.1u22.x86_64pigsty46.8 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~jammy_amd64.deb
postgresql-18-floatfile1.3.1u22.aarch64pigsty46.0 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~jammy_arm64.deb
postgresql-18-floatfile1.3.1u24.x86_64pigsty46.9 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~noble_amd64.deb
postgresql-18-floatfile1.3.1u24.aarch64pigsty45.7 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~noble_arm64.deb
postgresql-18-floatfile1.3.1u26.x86_64pigsty46.9 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~resolute_amd64.deb
postgresql-18-floatfile1.3.1u26.aarch64pigsty46.4 KiBpostgresql-18-floatfile_1.3.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
floatfile_171.3.1el8.x86_64pigsty52.9 KiBfloatfile_17-1.3.1-1PGSTY.el8.x86_64.rpm
floatfile_171.3.1el8.aarch64pigsty52.0 KiBfloatfile_17-1.3.1-1PGSTY.el8.aarch64.rpm
floatfile_171.3.1el9.x86_64pigsty54.5 KiBfloatfile_17-1.3.1-1PGSTY.el9.x86_64.rpm
floatfile_171.3.1el9.aarch64pigsty53.4 KiBfloatfile_17-1.3.1-1PGSTY.el9.aarch64.rpm
floatfile_171.3.1el10.x86_64pigsty55.4 KiBfloatfile_17-1.3.1-1PGSTY.el10.x86_64.rpm
floatfile_171.3.1el10.aarch64pigsty54.2 KiBfloatfile_17-1.3.1-1PGSTY.el10.aarch64.rpm
postgresql-17-floatfile1.3.1d12.x86_64pigsty44.6 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~bookworm_amd64.deb
postgresql-17-floatfile1.3.1d12.aarch64pigsty43.1 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~bookworm_arm64.deb
postgresql-17-floatfile1.3.1d13.x86_64pigsty45.0 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~trixie_amd64.deb
postgresql-17-floatfile1.3.1d13.aarch64pigsty43.6 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~trixie_arm64.deb
postgresql-17-floatfile1.3.1u22.x86_64pigsty48.0 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~jammy_amd64.deb
postgresql-17-floatfile1.3.1u22.aarch64pigsty47.3 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~jammy_arm64.deb
postgresql-17-floatfile1.3.1u24.x86_64pigsty47.0 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~noble_amd64.deb
postgresql-17-floatfile1.3.1u24.aarch64pigsty45.7 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~noble_arm64.deb
postgresql-17-floatfile1.3.1u26.x86_64pigsty46.9 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~resolute_amd64.deb
postgresql-17-floatfile1.3.1u26.aarch64pigsty46.4 KiBpostgresql-17-floatfile_1.3.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
floatfile_161.3.1el8.x86_64pigsty52.9 KiBfloatfile_16-1.3.1-1PGSTY.el8.x86_64.rpm
floatfile_161.3.1el8.aarch64pigsty52.0 KiBfloatfile_16-1.3.1-1PGSTY.el8.aarch64.rpm
floatfile_161.3.1el9.x86_64pigsty54.4 KiBfloatfile_16-1.3.1-1PGSTY.el9.x86_64.rpm
floatfile_161.3.1el9.aarch64pigsty53.4 KiBfloatfile_16-1.3.1-1PGSTY.el9.aarch64.rpm
floatfile_161.3.1el10.x86_64pigsty55.4 KiBfloatfile_16-1.3.1-1PGSTY.el10.x86_64.rpm
floatfile_161.3.1el10.aarch64pigsty54.2 KiBfloatfile_16-1.3.1-1PGSTY.el10.aarch64.rpm
postgresql-16-floatfile1.3.1d12.x86_64pigsty44.6 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~bookworm_amd64.deb
postgresql-16-floatfile1.3.1d12.aarch64pigsty43.1 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~bookworm_arm64.deb
postgresql-16-floatfile1.3.1d13.x86_64pigsty45.0 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~trixie_amd64.deb
postgresql-16-floatfile1.3.1d13.aarch64pigsty43.5 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~trixie_arm64.deb
postgresql-16-floatfile1.3.1u22.x86_64pigsty48.1 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~jammy_amd64.deb
postgresql-16-floatfile1.3.1u22.aarch64pigsty47.3 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~jammy_arm64.deb
postgresql-16-floatfile1.3.1u24.x86_64pigsty46.9 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~noble_amd64.deb
postgresql-16-floatfile1.3.1u24.aarch64pigsty45.7 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~noble_arm64.deb
postgresql-16-floatfile1.3.1u26.x86_64pigsty46.9 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~resolute_amd64.deb
postgresql-16-floatfile1.3.1u26.aarch64pigsty46.4 KiBpostgresql-16-floatfile_1.3.1-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
floatfile_151.3.1el8.x86_64pigsty53.0 KiBfloatfile_15-1.3.1-1PGSTY.el8.x86_64.rpm
floatfile_151.3.1el8.aarch64pigsty52.0 KiBfloatfile_15-1.3.1-1PGSTY.el8.aarch64.rpm
floatfile_151.3.1el9.x86_64pigsty54.6 KiBfloatfile_15-1.3.1-1PGSTY.el9.x86_64.rpm
floatfile_151.3.1el9.aarch64pigsty53.5 KiBfloatfile_15-1.3.1-1PGSTY.el9.aarch64.rpm
floatfile_151.3.1el10.x86_64pigsty55.2 KiBfloatfile_15-1.3.1-1PGSTY.el10.x86_64.rpm
floatfile_151.3.1el10.aarch64pigsty54.1 KiBfloatfile_15-1.3.1-1PGSTY.el10.aarch64.rpm
postgresql-15-floatfile1.3.1d12.x86_64pigsty44.7 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~bookworm_amd64.deb
postgresql-15-floatfile1.3.1d12.aarch64pigsty43.2 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~bookworm_arm64.deb
postgresql-15-floatfile1.3.1d13.x86_64pigsty45.1 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~trixie_amd64.deb
postgresql-15-floatfile1.3.1d13.aarch64pigsty43.8 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~trixie_arm64.deb
postgresql-15-floatfile1.3.1u22.x86_64pigsty48.2 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~jammy_amd64.deb
postgresql-15-floatfile1.3.1u22.aarch64pigsty47.5 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~jammy_arm64.deb
postgresql-15-floatfile1.3.1u24.x86_64pigsty46.7 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~noble_amd64.deb
postgresql-15-floatfile1.3.1u24.aarch64pigsty45.7 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~noble_arm64.deb
postgresql-15-floatfile1.3.1u26.x86_64pigsty46.6 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~resolute_amd64.deb
postgresql-15-floatfile1.3.1u26.aarch64pigsty46.3 KiBpostgresql-15-floatfile_1.3.1-1PGSTY~resolute_arm64.deb

源码

pig build pkg floatfile;		# build rpm/deb

安装

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

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

使用 pig 安装扩展。

pig install floatfile;		# install by package name

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

在数据库中创建扩展。

CREATE EXTENSION floatfile;

用法

floatfile: PostgreSQL 的浮点数组文件 I/O

将浮点数组存储在独立文件中,无需 MVCC 开销即可实现极快的查询。非常适合需要低延迟读取和低成本追加写入的时间序列数据。

函数

将浮点数组保存到文件

SELECT save_floatfile('my_data', ARRAY[1.0, 2.0, 3.0, 4.0]::float[]);

从文件加载浮点数组

SELECT load_floatfile('my_data');
-- {1,2,3,4}

向现有文件追加数据

SELECT extend_floatfile('my_data', ARRAY[5.0, 6.0]::float[]);

删除浮点文件

SELECT drop_floatfile('my_data');

表空间变体

所有函数都接受可选的表空间名称作为第一个参数:

SELECT save_floatfile('my_ts', 'my_data', ARRAY[1.0, 2.0]::float[]);
SELECT load_floatfile('my_ts', 'my_data');
SELECT extend_floatfile('my_ts', 'my_data', ARRAY[3.0]::float[]);
SELECT drop_floatfile('my_ts', 'my_data');

直方图函数

直接从浮点文件计算直方图(当数组超过 PostgreSQL 的 1GB 限制时非常有用):

SELECT floatfile_to_hist('my_data', 0.0, 1.0, 10);
-- 返回 int[] 直方图计数

SELECT floatfile_to_hist2d('xs_file', 'ys_file', 0.0, 0.0, 1.0, 1.0, 10, 10);
-- 返回二维 int[] 直方图

并发控制

函数使用 PostgreSQL 咨询锁:load_floatfile 获取共享锁;save、extend 和 drop 获取排他锁。

表格阅读器