Re: Anyone know why PostgreSQL doesn't support 2 phase execution?

From: cbbrowne(at)cbbrowne(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Anyone know why PostgreSQL doesn't support 2 phase execution?
Date: 2003-04-07 19:44:06
Message-ID: 20030407194406.ECAD359296@cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ron Peacetree wrote
> ...and what kind of performance hit we take (and under what
> circumstances) for not having it?

Are you thinking of "two phase commit"?

There is no "performance hit for not having it."

And it does not currently apply to PostgreSQL. Two phase commit is only
needed when updates need to be applied simultaneously on multiple
databases.

That is, you'd have something like:

CREATE DISTRIBUTED TRANSACTION X1;
insert into table TBL1 in database ('db1', 'id1', 'auth1') values (1, 2, 100.00, now());
insert into table TBL2 in database ('db2', 'id2', 'auth2') values (1, 3, -100.00, now());
COMMIT DISTRIBUTED TRANSACTION X1;

where the "in database ('db1', 'id1', 'auth1')" part indicates some form
of connection parameters for the database.

There certainly is merit to having two phase commit; it allows
coordinating updates to multiple databases.

The "degradation of performance" that results from not having this is
that you can't have distributed transactions. That's not a "performance
hit;" that's a case of "you can't do distributed transactions."

And distributed transactions are probably /more/ expensive than
nondistributed ones, so it is more readily argued that by not supporting
them, you don't have the problem of performance degrading due to making
use of distributed transactions.
--
output = reverse("gro.gultn@" "enworbbc")
http://www3.sympatico.ca/cbbrowne/nonrdbms.html
Rules of the Evil Overlord #195. "I will not use hostages as bait in a
trap. Unless you're going to use them for negotiation or as human
shields, there's no point in taking them."
<http://www.eviloverlord.com/>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message cbbrowne 2003-04-07 19:48:27 Re: Anyone working on better transaction locking?
Previous Message Brian 2003-04-07 19:39:04 pg_trigger.tgtype question