Thread: Custom Data Type size - too big overhead?

Custom Data Type size - too big overhead?

From
vladaman
Date:
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.