Search Postgresql Archives

Custom Data Type size - too big overhead?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux