Re: CREATE INDEX and HOT - revised design

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

On 3/29/07, Florian G. Pflug <fgp(at)phlo(dot)org> wrote:
>
> Pavan Deolasee wrote:
>
> > Tom, please correct me if I am wrong. But ISTM that this idea might
> > work in this context. In get_relation_info(), we would check if
> "xcreate"
> > xid stored in pg_index for the index under consideration is seen
> > committed with respect to the snapshot at that point of time.
> > Even if the snapshot changes later and index becomes valid, we
> > might not replan and hence not use index. But that doesn't seem
> > like a big problem to me.
>
> That problem are usecases like
> PREPARE my_plan .... ;
> BEGIN;
> EXECUTE my_plan .... ;
> COMMIT ;

Oh, I see.

Is that "PREPARE" even run inside a transaction? Even if it is, it
> probably won't have created a snapshot...

In this specific context, this particular case is easy to handle because
we are only concerned about the serializable transactions started before
CREATE INDEX commits. If PREPARE can see the new index, it
implies that the CI transaction is committed. So the transaction
starting after than can only see the tuple version that we have indexed.

But I don't know if this is the only case or there are more cases to
consider :-(

Thanks,
Pavan

--

EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-29 05:34:04 Re: Patch queue concern
Previous Message Carlo Florendo 2007-03-29 02:17:11 Re: Patch queue concern