Re: Catalog Access (was: [GENERAL] Concurrency problem building indexes)
- From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
- Cc: "Jim C. Nasby" <jnasby(at)pervasive(dot)com>, Wes <wespvp(at)syntegra(dot)com>, Zeugswetter Andreas DCP SD <ZeugswetterA(at)spardat(dot)at>, pgsql-hackers(at)postgresql(dot)org
- Subject: Re: Catalog Access (was: [GENERAL] Concurrency problem building indexes)
- Date: Tue, 25 Apr 2006 13:58:27 -0400
- Message-id: <22715(dot)1145987907(at)sss(dot)pgh(dot)pa(dot)us>
Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> I think the basic problem is that DDL can't really work within a
> transaction. If I do an ALTER TABLE, some of these changes need to show
> up to concurrent transactions (maybe creating a unique index?).
The point is that DDL can't be MVCC. If for instance you add an index
to a table, once you commit every other transaction must *immediately*
start updating that index when they modify the table. They can't use
the excuse of "not my problem because the catalog change postdates the
snapshot I'm using". The drop-index case is even worse, since a
transaction that believes the index is still present is likely to try
to access/update a disk file that's not there anymore. Adding/dropping
columns, constraints, triggers, etc all have hazards of the same ilk.
> I think it's like Tom says in that email, it could be done, but the
> cost/benefit ratio isn't very good...
It's barely possible that we could make this happen, but it would be a
huge amount of work, and probably a huge amount of instability for a
very long time until we'd gotten all the corner cases sorted. I think
there are much more productive uses for our development effort.
regards, tom lane
Home |
Main Index |
Thread Index