Re: CREATE INDEX and HOT - revised design - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: CREATE INDEX and HOT - revised design
Date
Msg-id 1175107739.4386.432.camel@silverbirch.site
Whole thread Raw
In response to Re: CREATE INDEX and HOT - revised design  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
List pgsql-hackers
On Wed, 2007-03-28 at 23:42 +0530, Pavan Deolasee wrote:
> 
> 
> On 3/28/07, Simon Riggs <simon@2ndquadrant.com> wrote:
>         
>         
>         Set it at the end, not the beginning.
> 
> 
> At the end of what ? It does not help to set it at the end of CREATE
> INDEX because the transaction may not commit immediately. In
> the meantime, many new transactions may start with 
> transaction id > xcreate. All these transactions can see the old
> tuple (which we did not index) and can also see the index once
> CREATE INDEX commits.

AtEOX_Reincarnate()... :-)

Set xcreate to InvalidTransactionId when we build the index

If we created an index in this transaction, as soon as we commit the top
level transaction, run another top level transaction to set xcreate
using ReadNewTransactionId().

During WAL replay, we remember any index creations and reset xcreate if
we were unlucky enough to crash between the two transactions.

(I'll be offline now for a few hours until the flames subside.)

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Arrays of Complex Types
Next
From: "Florian G. Pflug"
Date:
Subject: Re: CREATE INDEX and HOT - revised design