Custom Data Type size - too big overhead? - Mailing list pgsql-general

From vladaman
Subject Custom Data Type size - too big overhead?
Date
Msg-id 1305190598869-4389681.post@n5.nabble.com
Whole thread Raw
List 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.

pgsql-general by date:

Previous
From: Marek Więckowski
Date:
Subject: Re: auto-reconnect: temp schemas, sequences, transactions
Next
From: Stanislav Raskin
Date:
Subject: Re: full text search to_tsquery performance with ispell dictionary