| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Understanding how partial indexes work? |
| Date: | 2007-12-07 00:32:27 |
| Message-ID: | 4971.1196987547@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
"Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com> writes:
> On Dec 7, 2007 2:39 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Charles.Hou | 2007-12-07 00:55:56 | Re: autovacuum is stopping automatically.... |
| Previous Message | Chris Velevitch | 2007-12-07 00:24:49 | Re: Understanding how partial indexes work? |