Re: [PATCH] Partial indicies again

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: [PATCH] Partial indicies again
Date: 2001-07-10 00:22:43
Message-ID: 26158.994724563@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
>> I suspect you need to run cnfify after and-ing together the predicate
>> and index quals. clauselist_selectivity assumes it's working on
>> cnf'ified expressions.

> OK. Do I need to worry about that function destroying either of the input
> lists?

AFAIR, cnfify doesn't modify its inputs. But watch out for the
difference between explicit and implicit ANDing.

> I'll have to check again, but I thought that the VACUUM code only had the
> OID of the index, so how it is supposed to work out if it's a partial index.

You'll need to look it up.

In practice, I seem to recall that VACUUM is broken for partial indexes
anyway, specifically because it does not pay attention to partial-ness:
when it moves a tuple it shouldn't make an index entry for the new copy
if the index is partial and the tuple fails the predicate check. The
correct fix for this is not to add code, but to remove it. VACUUM
should never have had its own index-entry-making code in the first
place; it should be using ExecOpenIndices and friends from the main
executor. Once you do that, the info returned by ExecOpenIndices will
include the predicate, and you can just look there.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2001-07-10 00:51:47 Re: Re: Backups WAS: 2 gig file size limit
Previous Message Nils Zonneveld 2001-07-10 00:15:38 Re: Postgresql revisited. Some questions about the product