1

Can mysql-server-express compress strings? if you could give me a link to some documentation that says so it will be much appreciated as I can't seem to find this info.

I know that mysql allows this by using the compress() Function on the string. Also wondering whether this can be done automatically or do you need to use this function every time?

Also according to http://www.postgresql.org/docs/8.0/interactive/datatype-character.html - the compression is done automatically. Am I correct?

4

1 回答 1

1

PostgreSQL 自动压缩使用 TOAST 存储的任何内容,它用于大行。这种压缩是透明的,所以调用代码看起来好像没有发生压缩——读写使用未压缩的形式——但实际上它已经发生了。

因为它是透明的,所以不会影响通过值搜索的查询。

如果将 myisampack 与 MySQL 一起使用,它会压缩表,但使其只读。我不确定快速版本是否允许这样做。

对于任何数据库,您都可以进行自己的压缩并存储生成的 blob:

优点:在许多情况下可能比 PostgreSQL 的压缩要好。可能比通信协议中发生的任何压缩都要好。如果您使用的数据可以处理它的压缩,那么这项工作就为您完成了。

缺点:需要从头开始工作。破坏了在相关领域内进行搜索的能力。可能会以次优方式干扰内部压缩(尽管在那些压缩是胜利的分数中可能仍然比不压缩要好)。如果您对数据的使用无法处理压缩数据,那么在访问它之前您还有更多工作要做。

于 2011-12-09T11:57:50.037 回答