postgresql - TimescaleDB/Postgres 占用的空间远超预期

标签 postgresql timescaledb

我一直在 TimescaleDB 中保存一些刻度数据,并且对它占用了多少空间感到惊讶。我对此很陌生,但我每天将大约 1000 万行保存到具有以下列的表中:

enter image description here

这已经每天占用大约 35GB,这似乎过多。我想知道我可以采取哪些步骤来减少这个数量 - 如果我将 double 列更改为 float ,这会产生很大的影响吗?有没有其他方法可以减小这个尺寸?

编辑:

运行结果chunk_relation_size_pretty()是:

enter image description here

hypertable_relation_size_pretty() :

enter image description here

索引占用这么多空间似乎也很奇怪 - 我尝试在一定范围的数据上查询数据,结果花了很长时间才回来(一天的数据大约需要 10 分钟)。该指数目前设置为(工具、交易所、时间 DESC)之间的复合指数。

最佳答案

您应该打开 TimescaleDB 的 native 压缩:

https://docs.timescale.com/latest/using-timescaledb/compression

关于postgresql - TimescaleDB/Postgres 占用的空间远超预期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62187115/

相关文章:

postgresql - jOOQ 不使用自定义数据绑定(bind)

streaming - TimescaleDB 和 PipelineDB 集成

timescaledb - 如何获取数据库的timescaledb版本

Postgresql/Timescaledb 错误 : Deprecated trigger function should not be invoked

postgresql - 我如何将我的分钟数据分成包含 Timescaledb 中每个月的表(PostgreSQL 扩展)

django - 连接到 redshift 中默认数据库以外的数据库

sql - 在 Rails Console for PostgreSQL 的表中显示数据

mysql - 使用 pg :backups restore 恢复表

sql - 多维数组中的 pl/postgres 过滤器

database - Oracle Schema 疑问?