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

From Florian G. Pflug
Subject Re: CREATE INDEX and HOT - revised design
Date
Msg-id 460AB740.8060806@phlo.org
Whole thread Raw
In response to Re: CREATE INDEX and HOT - revised design  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> "Florian G. Pflug" <fgp@phlo.org> writes:
>> Couldn't you store the creating transaction's xid in pg_index, and
>> let other transaction check that against their snapshot like they
>> would for any tuple's xmin or xmax?
> 
> What snapshot?  I keep having to remind people that system catalog
> operations are SnapshotNow.  In the particular context here, the
> place where doing something else would break down is that the planner
> has no idea when it makes a plan what snapshot(s) the plan might later
> be used with.

Sorry - now that you say it, I remember that you've said that already
multiple times...

So the question is, why did this work until now, and CREATE INDEX+HOT
just doesn't seem to fit into this scheme?

I think the answer is that  all other DDL statements manage to assure
that any database objects they create or modify are usable for everybody
else immediatly after they are committed. This usually implies pretty
strong locking requirements - for example, I think that the core reason
why TRUNCATE needs an exclusive lock is precisely that guarantee it has
to make.

Maybe this could somehow be relaxed? Could, for example, the planner
be allowed to base some of it's decisions on the SerializableSnapshot
the every transaction (even read-only ones) posseses? It seems that
this would prevent plans from living longer than a transaction,
but maybe plan invalidation could help here?

greetings, Florian Pflug



pgsql-hackers by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: CREATE INDEX and HOT - revised design
Next
From: David Fetter
Date:
Subject: Re: Arrays of Complex Types