Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C2B93476414 for ; Wed, 29 Jan 2003 05:50:39 -0500 (EST) Received: from mail005.syd.optusnet.com.au (mail005.syd.optusnet.com.au [210.49.20.136]) by postgresql.org (Postfix) with ESMTP id 6E313477415 for ; Wed, 29 Jan 2003 05:20:14 -0500 (EST) Received: from postgresql.org (adlax2-107.dialup.optusnet.com.au [198.142.52.107]) by mail005.syd.optusnet.com.au (8.11.1/8.11.1) with ESMTP id h0TAJsc02275; Wed, 29 Jan 2003 21:19:55 +1100 Message-ID: <3E37AAD0.8010606@postgresql.org> Date: Wed, 29 Jan 2003 20:50:00 +1030 From: Justin Clift User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Mello Cc: pgsql-performance Subject: Re: 1 char in the world References: <3E37733D.90205@spaceship.com> In-Reply-To: <3E37733D.90205@spaceship.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/379 X-Sequence-Number: 1026 Matt Mello wrote: > This naturally led me to another question. How do TEXT, "char", and > BOOLEAN compare for storing t/f values. The test results I saw were > surprising. > > Test query= > "char"/TEXT: explain analyze select count(*) from table where bool='Y'; > boolean: explain analyze select count(*) from table where bool=true; > Table size (see above) > Performance averages: > TEXT 24ms > BOOLEAN 28ms > "char" 17ms Hi Matt, This is interesting. As a thought, would you be ok to run the same test using int4 and int8 as well? That would probably round out the test nicely. :) Regards and best wishes, Justin Clift -- "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi