Re: Putting an INDEX on a boolean field? - Mailing list pgsql-sql

FromJaime Casanova
SubjectRe: Putting an INDEX on a boolean field?
Date
Msg-id[email protected]
Whole thread Raw
In response toRe: Putting an INDEX on a boolean field?  ("Marc G. Fournier" <[email protected]>)
ResponsesRe: Putting an INDEX on a boolean field?
Listpgsql-sql
On 6/17/05, Marc G. Fournier <[email protected]> wrote:
> On Fri, 17 Jun 2005, Tom Lane wrote:
>
> > "Marc G. Fournier" <[email protected]> writes:
> >> Does that make sense?  Would it ever get used?
> >
> > It could get used if one of the two values is far less frequent than the
> > other.  Personally I'd think about a partial index instead ...
>
> Hrmmmm, hadn't thought of that ... wouldn't you have to build two indexes
> (one for true, one for false) for this to be completely effective?  unless
> you know all your queries are going to search for one, but not the other?
>

I guess it will be effective only if you know wich value will be less
frequent... on the other value a sequential scan will be a win, isn't
it?

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


pgsql-sql by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Putting an INDEX on a boolean field?
Next
From: "Fatih Cerit"
Date:
Subject: substr or char_length problem