Re: Understanding how partial indexes work? - Mailing list pgsql-general

From Tom Lane
Subject Re: Understanding how partial indexes work?
Date
Msg-id 4971.1196987547@sss.pgh.pa.us
Whole thread Raw
In response to Re: Understanding how partial indexes work?  ("Chris Velevitch" <chris.velevitch@gmail.com>)
List pgsql-general
"Chris Velevitch" <chris.velevitch@gmail.com> writes:
> On Dec 7, 2007 2:39 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Is it worth the trouble?  You didn't mention the statistics involved,
>> but ordinarily I'd think a non-equal condition is too nonselective
>> to justify the cost of maintaining an extra index.

> Yes, I did neglect to mention the stats. Y is the status of the record
> which represents the life cycle of the record starting at zero and
> ending up at k3. So basically the query would retrieving and the
> partial index will indexing records which aren't at their end of life.
> So the number of records where Y <> k3 will be low and the number of
> records where Y = k3 will be growing over time.

OK, in that case the partial index might be worth trying.

            regards, tom lane

pgsql-general by date:

Previous
From: "Chris Velevitch"
Date:
Subject: Re: Understanding how partial indexes work?
Next
From: Tom Lane
Date:
Subject: Re: Continual Postgres headaches...