Re: pgsql-server/doc TODO - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql-server/doc TODO
Date
Msg-id 24977.1085023298@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql-server/doc TODO  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pgsql-server/doc TODO
List pgsql-committers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> momjian@svr1.postgresql.org (Bruce Momjian) writes:
>>> Add:
>>> * Allow col IS TRUE/FALSE use an index like col = TRUE/FALSE
>>
>> They don't have the same semantics.

> Oh, they don't?  Nulls?

Right.

On second thought it might be possible to optimize this in a similar
fashion to the IN optimizations, viz only at top level of WHERE, so that
you can pretend NULL is the same as FALSE.  But it needs some careful
thought.

A possibly more relevant issue is that indexes on boolean columns are
seldom of any value anyway, and so optimizing behavior for them seems
pretty far down the priority list.  In my experience it's more useful to
create an index on another column(s) with the boolean condition as a
partial-index predicate.  In this context you can spell the condition
however you like, it just has to be the same spelling in queries as in
the index definition...

            regards, tom lane

pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql-server/doc TODO
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql-server/doc TODO