Re: Add a new table for Transaction Isolation?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Add a new table for Transaction Isolation?
Date: 2015-04-24 16:57:07
Message-ID: 553A75E3.4080807@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 4/17/15 7:36 PM, David G. Johnston wrote:
> diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml
> index f88b16e..5002138 100644
> --- a/doc/src/sgml/mvcc.sgml
> +++ b/doc/src/sgml/mvcc.sgml
> @@ -100,6 +100,14 @@
> phenomena caused by interactions?)
> </para>
>
> + <para>
> + The concepts covered in this section are
> + presented without examples of the behaviors described. The internet,
> + including and espcially the <productname>PostgreSQL</productname> Wiki, is
> + an excellent resource to learn more about circumstances under which these
> + data phenomena occur, and what the results look like when they do.
> + </para>
> +

I don't think our documentation should go out of its way to say, "our
documentation is bad, look elsewhere". If we think examples are
necessary, then we should add some. Otherwise, it's implied that
improvement is always possible.

> <para>
> The phenomena which are prohibited at various levels are:
>
> @@ -150,12 +158,12 @@
> <indexterm>
> <primary>transaction isolation level</primary>
> </indexterm>
> - The four transaction isolation levels and the corresponding
> - behaviors are described in <xref linkend="mvcc-isolevel-table">.
> + The four SQL transaction isolation levels, and their corresponding
> + behaviors, are described in <xref linkend="mvcc-isolevel-table">.
> </para>

I don't think this change is good.

>
> <table tocentry="1" id="mvcc-isolevel-table">
> - <title>Standard <acronym>SQL</acronym> Transaction Isolation Levels</title>
> + <title><acronym>SQL</acronym> Standard Transaction Isolation Levels</title>
> <tgroup cols="4">
> <thead>
> <row>

Why this change?

> @@ -256,6 +264,89 @@
> </para>
>
> <para>
> + The three <productname>PostgreSQL</productname> transaction isolation levels, and their corresponding
> + behaviors, are described in <xref linkend="mvcc-pgsql-isolevel-table">.
> + </para>

This isn't really correct. The PostgreSQL isolation levels were
described in the paragraph above. The table is really just a summary of
the previous explanation.

> + <para>
> + As the table makes clear there is no difference in the potential phenomena
> + at the REPEATABLE READ and SERIALIZABLE transaction isolation levels; but
> + the phenomena listed only pertain to the data seen by the transaction.

Please adapt the existing spelling and capitalization.

> + The difference is that REPEATABLE READ will only serial-fail

This term "serial-fail" would need further explanation.

> + if two transactions attempt to modify the same record while SERIALIZABLE will
> + also serial-fail if one transaction modifies a record that another transaction
> + has only read.
> + </para>

I don't think this new table adds clarity. Users should generally have
their applications use the appropriate standard isolation level. Adding
another table that says, some of these are not actually different,
following by text that says they are different in other ways, just
repeats the point that was made earlier and will be explained in more
detail in the following subsections.

The real difference, in my mind, is that the SQL standard defines four
levels in terms of three criteria, but PostgreSQL really has four
criteria and only three different levels implemented. It might be worth
visualizing that somehow.

Note that when that section was initially written, the fourth criterion
(serializability) wasn't implemented.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2015-04-24 17:24:21 Re: ALTER TABLE documentation nitpick
Previous Message Peter Eisentraut 2015-04-24 16:01:38 Re: Typo in ddl.sgml