Re: Batch update of indexes - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Batch update of indexes
Date
Msg-id CA+Tgmoa-bvTs2=Mv5OqHgAWADmn4E_2Sz7wRyvewuFfqiCgoYg@mail.gmail.com
Whole thread Raw
In response to Batch update of indexes  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: Batch update of indexes  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
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.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: james
Date:
Subject: Re: WAL Re-Writes
Next
From: Robert Haas
Date:
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive