Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 600ED475E71 for ; Wed, 29 Jan 2003 18:59:25 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 8F33E475C22 for ; Wed, 29 Jan 2003 18:59:24 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0TNxR5u005514; Wed, 29 Jan 2003 18:59:27 -0500 (EST) To: Matt Mello Cc: pgsql-performance Subject: Re: 1 char in the world In-reply-to: <3E3863F6.2020004@spaceship.com> References: <3E37733D.90205@spaceship.com> <1043842700.5008.11.camel@huli> <3E3863F6.2020004@spaceship.com> Comments: In-reply-to Matt Mello message dated "Wed, 29 Jan 2003 17:29:58 -0600" Date: Wed, 29 Jan 2003 18:59:26 -0500 Message-ID: <5513.1043884766@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/384 X-Sequence-Number: 1031 Matt Mello writes: > Is that true if I have a table that consists of lots of 1-char fields? > For example, if I have a table with 4 billion records, which consist of > (20) 1-char fields each, then the storage for the data will be something > like 5 times as large if I use TEXT than if I use "char". Probably more like 8 times as large, when you allow for alignment padding --- on most machines, TEXT fields will be aligned on 4-byte boundaries, so several TEXT fields in a row will take up 8 bytes apiece, vs one byte apiece for consecutive "char" or bool fields. regards, tom lane