Re: PGSQL Locking vs. Oracle's MVCC

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: RPK <rohitprakash123(at)indiatimes(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PGSQL Locking vs. Oracle's MVCC
Date: 2007-02-23 09:39:15
Message-ID: 45DEB643.5010708@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> How is PGSQL Locking compared with Oracle's MVCC? How PGSQL handles
> concurreny and how it differs with Oracle's Multi-Version Concurrency
> Control (MVCC)?
>
Well, I'm currently working on this comparison as we will need to port
and support some currently
Postgresql-only applications on several other rdbms in the near future,
and Oracle is among them.
I still don't have a final report, but from the point of a developer the
databases are almost the same,
especially in the field of locking, i.e.

- writer never blocks reader (and vice versa, the only exception is
distributed transaction in-doubt)
- there is 'SELECT ... FOR UPDATE' if you need to lock
- there are some 'application locks' (advisory locks in PostgreSQL)
- all the queries are consistent with respect to the beginning of the
query
- the default transaction level is READ COMMITED, it's possible to
use SERIALIZABLE

Sure, there are many differences when it comes to internals (Albe
Laurenz already pointed out the
most obvious one), as well as the Oracle is superior in many areas
(partitioning, some features in
PL/SQL, etc.).

This generally means that if you have an application architecture for
PostgreSQL, then it will usually
work fine Oracle. If the constraint is correctly enforced in PostgreSQL,
then it will be enforced in
Oracle etc.

There is no exact definition of MVCC, especially when it comes to
implementation - there are many
ways to do that, PostgreSQL uses one of them, Oracle uses another one.
MVCC generally means
that the DB is able to serve various versions of the same row (block).
PostgreSQL does not overwrite
the updated rows, Oracle uses undo log.

Tomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2007-02-23 10:14:57 Re: Writing oracle/postgress generic SQL
Previous Message Ben Edwards 2007-02-23 09:23:56 Writing oracle/postgress generic SQL