On Thu, Mar 22, 2007 at 10:21:27PM -0700, Richard Broersma Jr wrote:
> I am wondering why is 'read commited' chosen over any of the other
> isolation levels such as SERIALIZABLE?
If you use SERIALIZABLE then some transactions will need extra logic
to handle SQLSTATE 40001 SERIALIZATION FAILURE ("could not serialize
access due to concurrent update"). The documentation suggests why
SERIALIZABLE isn't the default:
"Since the cost of redoing complex transactions may be significant,
this mode is recommended only when updating transactions contain
logic sufficiently complex that they may give wrong answers in Read
> A more generalized question would be, are there any application/RDBMS
> design considerations to help determine the best default isolation level?
In addition to the above:
"Most commonly, Serializable mode is necessary when a transaction
executes several successive commands that must see identical views
of the database."
I leave READ COMMITTED as the default and use SERIALIZABLE only in
transactions that need it, such as in reporting applications that
must see consistent results across multiple queries.
In response to
pgsql-novice by date
|Next:||From: Richard Broersma Jr||Date: 2007-03-23 12:31:22|
|Subject: Re: default_transaction_isolation|
|Previous:||From: Richard Broersma Jr||Date: 2007-03-23 05:21:27|