Re: CREATE INDEX and HOT - revised design

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavan Deolasee <pavan(dot)deolasee(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE INDEX and HOT - revised design
Date: 2007-03-30 18:01:04
Message-ID: 460D5060.5090009@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavan Deolasee wrote:
> On 3/30/07, Florian G. Pflug <fgp(at)phlo(dot)org> wrote:
>>
>> My idea was to store a list of xid's together with the cached plan that
>> are assumed to be uncommitted accoring to the IndexSnapshot. The query
>> is replanned if upon execution the IndexSnapshot assumes that one of
>> these xid's is committed.
>>
>>
> Actually, if we are using Serializable Snapshot then there is no chance
> to replan the query before the transaction completes and the next
> transaction to start in the session must see the index and hence
> we must replan. So it would be enough just to associate a transaction
> id with the cached plan. If this xid is set and our transaction id is
> different than that, we replan.

I believe this is true for the CREATE INDEX scenario. However, comparing
either the snapshot or the result of xid checks seems like it might
be useful for other things beside CREATE INDEX. I'm specifically
thinking about TRUNCATE here - the create index + HOT problems sound
quite similar to the problems a non-exclusive-locking TRUNCATE would face.

greetings, Florian Pflug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-03-30 18:35:52 Re: CREATE INDEX and HOT - revised design
Previous Message Tom Lane 2007-03-30 17:54:01 Re: CREATE INDEX and HOT - revised design