Re: Correct syntax to create partial index on a boolean column - Mailing list pgsql-general

From Craig Ringer
Subject Re: Correct syntax to create partial index on a boolean column
Date
Msg-id 4EE9FD84.4040808@ringerc.id.au
Whole thread Raw
In response to Re: Correct syntax to create partial index on a boolean column  (Alban Hertroys <haramrae@gmail.com>)
Responses Re: Correct syntax to create partial index on a boolean column
Re: Correct syntax to create partial index on a boolean column
List pgsql-general
On 12/15/2011 03:53 PM, Alban Hertroys wrote:
> Correct, but...
> That's not a particularly useful index to create. That index just contains values of true where the associated column
equalstrue - you're storing the same information twice. 
It could be very handy if you have an extremely high selectivity index
(say 1:1000 or more) where you want to keep the index tiny, fast, and
very quick to scan.

I guess ideally Pg would be able to deduce that the index value is
always the same and just store a page list rather than a b-tree, but
it's a bit of a tiny use case.

--
Craig Ringer

pgsql-general by date:

Previous
From: Bèrto ëd Sèra
Date:
Subject: Re: Server/Data Migration Advice
Next
From: Adrian Klaver
Date:
Subject: Re: Server/Data Migration Advice