Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9346F47600C for ; Wed, 29 Jan 2003 18:29:57 -0500 (EST) Received: from mta4.rcsntx.swbell.net (mta4.rcsntx.swbell.net [151.164.30.28]) by postgresql.org (Postfix) with ESMTP id C8955476003 for ; Wed, 29 Jan 2003 18:29:56 -0500 (EST) Received: from spaceship.com ([65.65.110.10]) by mta4.rcsntx.swbell.net (iPlanet Messaging Server 5.1 HotFix 1.6 (built Oct 18 2002)) with ESMTP id <0H9I00DUE19YXM@mta4.rcsntx.swbell.net> for pgsql-performance@postgresql.org; Wed, 29 Jan 2003 17:29:59 -0600 (CST) Date: Wed, 29 Jan 2003 17:29:58 -0600 From: Matt Mello Subject: Re: 1 char in the world In-reply-to: <1043842700.5008.11.camel@huli> To: pgsql-performance Message-id: <3E3863F6.2020004@spaceship.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 References: <3E37733D.90205@spaceship.com> <1043842700.5008.11.camel@huli> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/383 X-Sequence-Number: 1030 > OTOH the actual storage of one-char datatype should not play so > significant role for very large tables, even if this is the only field > in that table, as most of the overhead will be in other places - storage > overhead in page/tuple headers, performance in retrieving the > pages/tuples and cache lookups, etc. 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". > Also, for very big tables you will most likely want to restrict selects > on other criteria than a 4-valued field, so that indexes could be used > in retrieving data. I do. I was just using that query for this test only. I have some very complex queries that are constrained by many foriegn-key int4 fields, but also a few of these 1-char fields. > You could also try just > > select count(*) from table where bool; > I will do this in a while and report to the list. I am going to try make a reproducable test that anyone can do, to be sure my results are "real". > Did you repeat the texts enough times to be sure that you get reliable > results ? I think so. Not so much as hundreds of times, though. -- Matt Mello 512-350-6900