Re: Efficient Boolean Storage

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Chris White" <cwhite(at)at-sd(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Efficient Boolean Storage
Date: 2002-12-04 15:11:09
Message-ID: 200212041511.09660.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 04 Dec 2002 1:06 am, Chris White wrote:
> Hello,
>
> I need to store many (e.g. 30) booleans and am wondering what is the
> most efficient way to store them. I can think of four options.
>
> Option 1...Use 'bool' data type
> No good since each value will require 1 byte rather than 1 bit.

Depends what you're going to use them for. Are these 30 flags that should be
grouped together? Will the users/app want all together or one at a time? Will
they feature in WHERE clauses?

--
Richard Huxton

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message annachau 2002-12-04 15:41:27 User date_trunc function in plpgsql function
Previous Message Matthew Gabeler-Lee 2002-12-04 15:00:30 Re: 7.3 no longer using indexes for LIKE queries