pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
To: pgsql-general@postgresql.org
Subject: Byte Sizes
Date: Thu, 09 Sep 2004 14:56:35 +0200
Message-ID: <opsd18wll2cq72hf@musicbox> (raw)
In-Reply-To: <20040909114242.A1057@bacon>
References: <CB968022-00C1-11D9-8D0A-000A95CD827E@pvv.ntnu.no>
	<714.1094568878@sss.pgh.pa.us>
	<471AEDA2-00EA-11D9-B8FE-000A95CD827E@pvv.ntnu.no>
	<2445.1094580196@sss.pgh.pa.us>
	<AF83CF68-0165-11D9-A26A-000A95CD827E@pvv.ntnu.no>
	<19720.1094652023@sss.pgh.pa.us>
	<FBD2DEDA-022F-11D9-9D99-000A95CD827E@pvv.ntnu.no>
	<20040909095321.A789@bacon>
	<41402533.2080702@opencloud.com>
	<20040909114242.A1057@bacon>


	Hello,

* On the size of arrays :

	I did not find any info in the Docs on this.
	How many bytes does an array take on disk ?

	My bet would be 4 bytes for number of dimensions, 4 per dimension for the  
length, and then the storage requirements of whatever's in the array.

	If the array contains fixed size elements like integers, it'd be 4 bytes  
per element.
	However if it contains variable length elements like text, is there a  
pointer table ? Or are the elements packed together ?

	Is there any advantage in using a smallint[] over an integer[] ?

	Does a smallint[] with 2 elements really take 12 bytes ?

* On Alignment :

	The docs say fields are aligned on 4-bytes boundaries.
	Does this mean that several consecutive smallint fields will take 4 bytes  
each ?
	What about seleral consecutive "char" fields ?

	I ask this because I'll have a lot of columns with small values to store  
in a table, and would like it to be small and to fit in the cache.


	Thanks for any info.




Message-ID: <opsd18wll2cq72hf@musicbox>
Permalink:  ../opsd18wll2cq72hf@musicbox/
Also on:    postgresql.org/message-id/opsd18wll2cq72hf@musicbox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: lists@boutiquenumerique.com, pgsql-general@postgresql.org
  Subject: Re: Byte Sizes
  In-Reply-To: <opsd18wll2cq72hf@musicbox>
  References: <CB968022-00C1-11D9-8D0A-000A95CD827E@pvv.ntnu.no> <714.1094568878@sss.pgh.pa.us> <471AEDA2-00EA-11D9-B8FE-000A95CD827E@pvv.ntnu.no> <2445.1094580196@sss.pgh.pa.us> <AF83CF68-0165-11D9-A26A-000A95CD827E@pvv.ntnu.no> <19720.1094652023@sss.pgh.pa.us> <FBD2DEDA-022F-11D9-9D99-000A95CD827E@pvv.ntnu.no> <20040909095321.A789@bacon> <41402533.2080702@opencloud.com> <20040909114242.A1057@bacon> <opsd18wll2cq72hf@musicbox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox