From: | "Alexander Staubo" <alex(at)purefiction(dot)net> |
---|---|
To: | A(dot)M(dot) <agentm(at)themactionfaction(dot)com> |
Cc: | "pgsql-general general" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: why postgresql over other RDBMS |
Date: | 2007-05-24 21:16:40 |
Message-ID: | 88daf38c0705241416n35b92f48xf01d08abe364ab49@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
We're derailing the thread, but...
On 5/24/07, A.M. <agentm(at)themactionfaction(dot)com> wrote:
> 2PC requires that the modifications already be in concrete. What I
> suggest is a method for a new connection to insert itself into an
> existing (sub-)transaction SQL stream, make changes, and commit to
> the root or parent transaction.
The problem with long-running transactions is that they need to avoid
locking the resources they touch. Short-running transactions are bad
enough as they stand -- until fairly recently (8.1? 8.2?), merely
inserting or updating a row that had a foreign-key reference to
another table row would lock the referenced row until the end of the
transaction, by issuing an implicit "select ... for update".
Although a mechanism whereby multiple connections can share a single
session/transaction is probably easy to implement, using long-running
transactions to isolate DDL changes is not feasible at the moment
because PostgreSQL currently acquires an AccessExclusiveLock on the
modified table until the transaction ends, which means that concurrent
transactions would be blocked from even querying the table.
I don't know PostgreSQL's internals, so I can only postulate that this
locking occurs because PostgreSQL holds a single copy of the schema
and related bookeeping structures in memory.
Alexander.
From | Date | Subject | |
---|---|---|---|
Next Message | Kimball Bighorse | 2007-05-24 22:00:52 | |
Previous Message | novnov | 2007-05-24 20:59:24 | Return rows from function with expressions |