X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A0092329EAB for ; Thu, 9 Sep 2004 13:55:59 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16755-08 for ; Thu, 9 Sep 2004 12:55:54 +0000 (GMT) Received: from boutiquenumerique.com (gailleton-2-82-67-9-10.fbx.proxad.net [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 1D3F7329E89 for ; Thu, 9 Sep 2004 13:55:55 +0100 (BST) Received: (qmail 27330 invoked from network); 9 Sep 2004 14:56:00 +0200 Received: from unknown (HELO musicbox) (192.168.0.2) by gailleton-2-82-67-9-10.fbx.proxad.net with SMTP; 9 Sep 2004 14:56:00 +0200 To: pgsql-general@postgresql.org Subject: Byte Sizes References: <714.1094568878@sss.pgh.pa.us> <471AEDA2-00EA-11D9-B8FE-000A95CD827E@pvv.ntnu.no> <2445.1094580196@sss.pgh.pa.us> <19720.1094652023@sss.pgh.pa.us> <20040909095321.A789@bacon> <41402533.2080702@opencloud.com> <20040909114242.A1057@bacon> Message-ID: Date: Thu, 09 Sep 2004 14:56:35 +0200 From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <20040909114242.A1057@bacon> User-Agent: Opera M2/7.53 (Linux, build 737) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/385 X-Sequence-Number: 65591 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.