Re: BUG #1510: Indexes on boolean fields - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1510: Indexes on boolean fields
Date
Msg-id 12059.1109522974@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1510: Indexes on boolean fields  ("Sergey Koshcheyev" <sergey.p.k@gmail.com>)
List pgsql-bugs
"Sergey Koshcheyev" <sergey.p.k@gmail.com> writes:
> this is an addition to my bug report #1470. I have found that if I have a
> boolean column and create an index on it, it doesn't get picked up for
> conditions like "WHERE column" or "WHERE NOT column", only "WHERE column =
> true" or "WHERE column = false".

> Do you consider this worth fixing?

No; mainly because a btree index on a boolean column is ordinarily a
waste of disk space.

A partial index (with some non-boolean column as the nominally indexed
data) is generally a better solution.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Sergey Koshcheyev"
Date:
Subject: BUG #1510: Indexes on boolean fields
Next
From: Tom Lane
Date:
Subject: Re: BUG #1502: hash_seq_search might return removed entry