X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1147C329DD0 for ; Fri, 10 Sep 2004 14:22:41 +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 64521-04 for ; Fri, 10 Sep 2004 13:22:32 +0000 (GMT) Received: from ganymede.hub.org (blk-222-46-91.eastlink.ca [24.222.46.91]) by svr1.postgresql.org (Postfix) with ESMTP id 537BB329DBF for ; Fri, 10 Sep 2004 14:22:34 +0100 (BST) Received: by ganymede.hub.org (Postfix, from userid 1000) id CC0DF36D4D; Fri, 10 Sep 2004 10:22:36 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id CB14435325 for ; Fri, 10 Sep 2004 10:22:36 -0300 (ADT) X-Return-Path: X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.8) with LMTPA; Fri, 10 Sep 2004 03:36:11 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost.hub.org [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 357513A362 for ; Fri, 10 Sep 2004 03:35:47 -0300 (ADT) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Fri, 10 Sep 2004 03:35:47 -0300 (ADT) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.8) with LMTPA; Fri, 10 Sep 2004 07:35:42 +0100 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 31507329D18 for ; Fri, 10 Sep 2004 07:35:42 +0100 (BST) X-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 39156-08 for ; Fri, 10 Sep 2004 06:35:36 +0000 (GMT) X-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 853AE329D03 for ; Fri, 10 Sep 2004 07:35:34 +0100 (BST) X-Received: (qmail 8234 invoked from network); 10 Sep 2004 08:35:39 +0200 X-Received: from unknown (HELO musicbox) (192.168.0.2) by gailleton-2-82-67-9-10.fbx.proxad.net with SMTP; 10 Sep 2004 08:35:39 +0200 To: performance@postgresql.org Subject: Question on Byte Sizes References: <20040902154340.5b1a669a@kingfisher.intern.logi-track.com> <19516.1094134957@sss.pgh.pa.us> <4140E1EF.1040303@samurai.com> <13334.1094785631@sss.pgh.pa.us> Message-ID: Date: Fri, 10 Sep 2004 08:36:16 +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: <13334.1094785631@sss.pgh.pa.us> User-Agent: Opera M2/7.53 (Linux, build 737) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-DCC: : X-Spam-Pyzor: ReSent-Date: Fri, 10 Sep 2004 10:22:32 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-performance@postgresql.org ReSent-Subject: Question on Byte Sizes ReSent-Message-ID: <20040910102232.T47328@ganymede.hub.org> 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/61 X-Sequence-Number: 8189 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.