Re: [PATCH] Partial indicies again

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Partial indicies again
Дата
Msg-id 26158.994724563@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Partial indicies again  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: [PATCH] Partial indicies again  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Matt Block"
Дата:
Сообщение: Syncing multple servers
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: Re: Backups WAS: 2 gig file size limit