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

From Pavan Deolasee
Subject Re: CREATE INDEX and HOT - revised design
Date
Msg-id 2e78013d0703300959l2db69c60q9d7a74c02e8b52b9@mail.gmail.com
Whole thread Raw
In response to Re: CREATE INDEX and HOT - revised design  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers


On 3/30/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:


That might work, but it doesn't seem to address the core objection:
there's no mechanism to cause the query to be replanned once the
snapshot is new enough, because no relcache inval will happen.  So
most likely existing backends will keep using old plans that don't
consider the index.


Can't we store the snapshot (or may be the transaction id) which was
used to plan the query in CachedPlanSource if and only if at least one
index was seen unusable  ? In RevalidateCachedPlan() we then check if
the snapshot has changed and replan the query in that case.

That would make the index usable in the subsequent transactions
in the same session, though we may not be able to use the index
in the same transaction, even if its running in read-commited mode.
Would that be acceptable ?

Thanks,
Pavan


--

EnterpriseDB     http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: CREATE INDEX and HOT - revised design
Next
From: "Florian G. Pflug"
Date:
Subject: Re: CREATE INDEX and HOT - revised design