Custom Data Type size - too big overhead?

From: vladaman <vlach(at)seznam(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Custom Data Type size - too big overhead?
Date: 2011-05-12 08:56:38
Message-ID: 1305190598869-4389681.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

we are trying to minimize data storage size as possible. We'd like to
replace BOX and POINT datatypes with our own. We don't need double precision
- 4 bytes integer would be totally fine.
I tried following experiment in which custom data type vPointInt of 4
integers takes 28 bytes. Why is that?

Create Type vPointInt AS(
a integer,
b integer
)

CREATE TABLE rt(
id int,
pt vPointInt
);

insert into rt values(1, (4,4) );
select *, (pg_dump(pt)).* from rt limit 15;

1;"(4,4)";"vpointint";30712;28;"000,000,000,002,000,000,000,023,000,000,000,004,000,000,000,004,000,000,000,023,000,000,000,004,000,000,000,004";"\000\000\000\002\000\000\000\027\000\000\000\004\000\000\000\004\000\000\000\027\000\000\000\004\000\000\000\004"

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Custom-Data-Type-size-too-big-overhead-tp4389681p4389681.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Browse pgsql-general by date

  From Date Subject
Next Message Durumdara 2011-05-12 10:20:00 Re: Read Committed transaction with long query
Previous Message Andreas Laggner 2011-05-12 08:56:20 vacuumdb with cronjob needs password since 9.0?