postgres 中的数据库压缩
Database compression in postgres
随着数据库大小的不断增长,作为业务需求的一部分,我们被要求为我们的 prod 数据库压缩数据。需要知道 postgres 中数据库压缩的一些缺点。
这太宽泛了,无法给出好的答案。首先,你想如何压缩数据?不过,我会尽量给出一个笼统的答案。
对于所有压缩,trade-off 介于大小节省和 CPU 的额外工作之间。存储 space 通常是更便宜的资源。
通常完全压缩数据库不是一个好主意。相反,考虑
增加存储空间 space。比较便宜。
正在将旧数据移动到存档数据库。
压缩列中的大数据可能是个好主意,但 PostgreSQL does that automatically anyway:
large field values are compressed and/or broken up into multiple physical rows. This happens transparently to the user, with only small impact on most of the backend code. The technique is affectionately known as TOAST (or “the best thing since sliced bread”).
随着数据库大小的不断增长,作为业务需求的一部分,我们被要求为我们的 prod 数据库压缩数据。需要知道 postgres 中数据库压缩的一些缺点。
这太宽泛了,无法给出好的答案。首先,你想如何压缩数据?不过,我会尽量给出一个笼统的答案。
对于所有压缩,trade-off 介于大小节省和 CPU 的额外工作之间。存储 space 通常是更便宜的资源。
通常完全压缩数据库不是一个好主意。相反,考虑
增加存储空间 space。比较便宜。
正在将旧数据移动到存档数据库。
压缩列中的大数据可能是个好主意,但 PostgreSQL does that automatically anyway:
large field values are compressed and/or broken up into multiple physical rows. This happens transparently to the user, with only small impact on most of the backend code. The technique is affectionately known as TOAST (or “the best thing since sliced bread”).