Re: Batch update of indexes

Поиск
Список
Период
Сортировка
От Konstantin Knizhnik
Тема Re: Batch update of indexes
Дата
Msg-id 56B22F10.90604@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Batch update of indexes  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Batch update of indexes  (David Steele <david@pgmasters.net>)
Re: Batch update of indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Attached please find patch for "ALTER INDEX ... WHERE ..." clause.
It is now able to handle all three possible situations:
1. Making index partial (add WHERE condition to the ordinary index)
2. Extend partial index range (less restricted index predicate)
3. Arbitrary change of partial index predicate

In case 2) new records are added to the index.
In other two cases index is completely reconstructed.

This patch includes src/bin/insbench utility for testing insert
performance. It can be easily excluded from the patch to reduce it size.
Also it is better to apply this patch together with "index-only scans
with partial indexes" patch:

http://www.postgresql.org/message-id/560C7213.3010203@2ndquadrant.com

only in this case regression test will produce expected output.


On 27.01.2016 23:15, Robert Haas wrote:
> On Wed, Jan 20, 2016 at 4:28 AM, Konstantin Knizhnik
> <k.knizhnik@postgrespro.ru> wrote:
>> Please notice that such alter table statement, changing condition for
>> partial index, is not supported now.
>> But I do not see any principle problems with supporting such construction.
>> We should just include in the index all records which match new condition
>> and do not match old condition:
>>
>>     ts < '21/01/2016' and not (ts < '20/01/2016')
> You'd also need to remove any rows from the index that match the old
> condition but not the new one.  In your example, that's impossible,
> but in general, it's definitely possible.
>

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: PostgreSQL Audit Extension
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [POC] FETCH limited by bytes.