行和空间占用的空间压缩数据 [英] space taken by a row & compressed data

查看:62
本文介绍了行和空间占用的空间压缩数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用mysql我知道一行将占用多少空间,基于数据类型

列。我也(大约)知道索引的大小。

有没有办法知道在postgresql中?


有没有办法打包(压缩)数据,与myisampack for mysql一样?


谢谢


---------------- -----------(播出结束)---------------------------

提示8:解释分析是你的朋友

With mysql I know how much space a row will take, based on the datatype
of it columns. I also (approximately) know the size of indexes.
Is there a way to know that in postgresql?

Is there a way to pack (compress) data, as with myisampack for mysql?

Thank you

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

推荐答案

Leonardo Francalanci写道:
Leonardo Francalanci wrote:
使用mysql我知道一行将占用多少空间,基于它的数据类型列。我也(大约)知道索引的大小。
有没有办法在postgresql中知道?


我们有一个FAQ项目。

有没有办法打包(压缩)数据,就像myisampack for mysql一样?
With mysql I know how much space a row will take, based on the datatype
of it columns. I also (approximately) know the size of indexes.
Is there a way to know that in postgresql?
We have an FAQ item about this.
Is there a way to pack (compress) data, as with myisampack for mysql?




长数据值会自动压缩。


-

Bruce Momjian | http://candle.pha.pa.us
pg *** @ candle.pha.pa.us | (610)359-1001

+如果你的生活是硬盘,|罗伯茨路13号

+基督可以成为你的备份。 |宾夕法尼亚州新城广场19073年


---------------------------(播出结束) - --------------------------

提示3:如果通过Usenet发布/阅读,请发送适当的

subscribe-nomail命令 ma*******@postgresql.org ,以便你的

消息可以干净利落地到达邮件列表



Long data values are automatically compressed.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


嗨Leonardo,


Am Do,den 26.08.2004 schrieb Leonardo Francalanci 15:51:
Hi Leonardo,

Am Do, den 26.08.2004 schrieb Leonardo Francalanci um 15:51:
使用mysql我知道一行将占用多少空间,基于它的数据类型。我也(大约)知道索引的大小。
有没有办法知道在postgresql中?

有没有办法打包(压缩)数据,就像myisampack for mysql一样?
With mysql I know how much space a row will take, based on the datatype
of it columns. I also (approximately) know the size of indexes.
Is there a way to know that in postgresql?

Is there a way to pack (compress) data, as with myisampack for mysql?




在contrib目录中你会找到一些东西(dbsize左右)

来检查对象的大小(至少表格)


由于MVCC你碰巧有多个版本

同时更新了一行所以数字不是

非常精确所有的时间。


文本列等大型对象已经以压缩的

形式存储。


HTH

Tino Wildenhain

---------------------------(播出结束) ---------------------------

提示3:如果通过Usenet发布/阅读,请发送相应的

subscribe-nomail命令 ma*******@postgresql.org 所以您的

消息可以通过邮件列表清除nly



in the contrib dir you will find something (dbsize or so)
to check for sizes of objects (at least tables)

Due to the MVCC you happen to have multiple versions
of an updated row at the same time so the numbers arent
very exact all the time.

Large objects such as text columns are stored in compressed
form already.

HTH
Tino Wildenhain
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


>我们有一个关于此的常见问题项目。


该死的!我没看到那一个!对不起...
> We have an FAQ item about this.

Damn! I didn''t see that one! Sorry...
长数据值会自动压缩。




我问的原因是:

我们有一个每月存储200,000,000行的系统

(其他表每月存储10,000,000行)

每行有400列整数+ 2列(日期+整数)作为索引。


我们的系统在将行写入磁盘上的二进制文件之前压缩行。

数据通常不需要要更新/删除。

我们通常访问一行的所有列(因此每行压缩

有意义)。

有没有办法按行压缩数据?也许用

a用户自定义类型?

--------------------------- (播出结束)---------------------------

提示7:别忘了增加你的免费空间地图设置



The reason I''m asking is:
we have a system that stores 200,000,000 rows per month
(other tables store 10,000,000 rows per month)
Every row has 400 columns of integers + 2 columns (date+integer) as index.

Our system compresses rows before writing them to a binary file on disk.
Data don''t usually need to be updated/removed.
We usually access all columns of a row (hence compression on a per-row basis
makes sense).

Is there any way to compress data on a per-row basis? Maybe with
a User-Defined type?
---------------------------(end of broadcast)---------------------------
TIP 7: don''t forget to increase your free space map settings


这篇关于行和空间占用的空间压缩数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆