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 1175273469.4386.799.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 Fri, 2007-03-30 at 11:44 +0530, Pavan Deolasee wrote:
> ISTM that the run-another-transaction-afterwards idea would have same
> problem with plan invalidation. When the second transaction commits,
> the relcache invalidation event is generated. The event may get
> consumed 
> by other backends, but the index may still not be usable to them
> because
> their xid < xcreat. If no more relcache invalidation events are
> generated
> after that, the backends would continue to use the cached plan, even 
> if index becomes usable to them later. 

Sounds like we need to allow create index invalidation events to be
processed at the the end of the current transaction in the *receiving*
backend. That way we don't need to do the run-another-transaction thing
and seems a helluva lot cleaner way of doing this.

Messages of SHAREDINVALRELCACHE_ID, would be augmented by a boolean
deferred flag on the SharedInvalRelcacheMsg struct. Received messages
would be stored in a third kind of InvalidationList, then processed
during AtEOXact_Inval() whether the receiving transaction commits or
not. (see src/backend/utils/cache/inval.c)

Not sure how we'd know to *send* the message marked as deferred, but
seems like we can work that out also.

That seems to allow CCI to not have to wait until the end of time
either.

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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE INDEX and HOT - revised design
Next
From: "Pavan Deolasee"
Date:
Subject: Re: CREATE INDEX and HOT - revised design