pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaime Casanova <systemguards@gmail.com>
To: Marc G. Fournier <scrappy@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Putting an INDEX on a boolean field?
Date: Fri, 17 Jun 2005 00:42:22 -0500
Message-ID: <c2d9e70e0506162242557a7e65@mail.gmail.com> (raw)
In-Reply-To: <20050617020039.P90456@ganymede.hub.org>
References: <20050617011336.Q90456@ganymede.hub.org>
	<15887.1118983309@sss.pgh.pa.us>
	<20050617020039.P90456@ganymede.hub.org>

On 6/17/05, Marc G. Fournier <scrappy@postgresql.org> wrote:
> On Fri, 17 Jun 2005, Tom Lane wrote:
> 
> > "Marc G. Fournier" <scrappy@postgresql.org> 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 ;)



view thread (7+ messages)  latest in thread

Message-ID: <c2d9e70e0506162242557a7e65@mail.gmail.com>
Permalink:  ../c2d9e70e0506162242557a7e65@mail.gmail.com/
Also on:    postgresql.org/message-id/c2d9e70e0506162242557a7e65@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: systemguards@gmail.com, scrappy@postgresql.org, tgl@sss.pgh.pa.us
  Subject: Re: Putting an INDEX on a boolean field?
  In-Reply-To: <c2d9e70e0506162242557a7e65@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox