From: Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
To: performance@postgresql.org
Subject: Question on Byte Sizes
Date: Fri, 10 Sep 2004 08:36:16 +0200
Message-ID: <opsd3lyqygcq72hf@musicbox> (raw)
In-Reply-To: <13334.1094785631@sss.pgh.pa.us>
References: <20040902154340.5b1a669a@kingfisher.intern.logi-track.com>
<19516.1094134957@sss.pgh.pa.us>
<4140E1EF.1040303@samurai.com>
<13334.1094785631@sss.pgh.pa.us>
Hello,
* I need information on the size of pg ARRAY[]'s :
I did not find any info in the Docs on this.
How many bytes does an array take on disk ?
Is there a difference between an array of fixed size elements like
integers, and an array of 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[] regarding
size ?
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 ? 4 bytes each too ?
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.
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: lists@boutiquenumerique.com, performance@postgresql.org
Subject: Re: Question on Byte Sizes
In-Reply-To: <opsd3lyqygcq72hf@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