Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"

From: radiodiversion <radiodiversion(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"
Date: 2021-08-18 06:18:28
Message-ID: CAP7bpbDbieo4qkzVm+7Uk=Bx+zFnh5m6eYh-kZJaLuC8sTDAXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

David, I have some suggestions.

but first i want to show how the current version of doc may look like for
new readers. and why.
I am sure that it looks pretty logical if you KNOW how it works, but it is
not so clear if you WANT to learn that from documentation.

explanation:

first sentence: "they will only find target rows that were committed as of
the command start time."
how a naive user (me) read that: "okay. at the start of command we find
only committed rows. LETS SEE WHAT HAPPENS NEXT!".

second sentence: "The search condition of the command (the WHERE clause) is
re-evaluated to see if the updated version of the row still matches the
search condition."
how it looks: "The command will be RE-EVALUATED for all rows in the current
snapshot (i.e. against new state of db after first updater commits) to
RE-CHECK the WHERE condition. AT THE SAME TIME (AS AN EFFECT) we see if the
updated version of the row still matches the search condition."
For me RE-evaluating is an ACTION and "to see..that still matches" is ONE
of the accompanying options.
As if I said: "I mowed all the grass to avoid seeing the dandelions again."

suggestion:

change sentence: "The search condition of the command (the WHERE clause) is
re-evaluated to see if the updated version of the row still matches the
search condition."
with sentence: "The search condition of the command (the WHERE clause) is
re-evaluated only for updated versions of rows to see if they still match
the search condition. Note that this is different from re-executing the
command."

I tried to explain as best I could.
Of course, I dare not insist on anything.

thanks!

On Wed, 18 Aug 2021 at 03:47, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Tue, Aug 17, 2021 at 4:17 PM radiodiversion <radiodiversion(at)gmail(dot)com>
> wrote:
>
>> I still think it would be great if this doc point was worded a little
>> differently in new editions.
>>
>>
> Suggestions are welcome.
>
> Without some idea of why you seemed to miss the two seemingly obvious
> references that I pointed out (including a fragment you quoted) it's hard
> to decide what might be an improvement. It's unappealing to consider
> rewriting the documentation based upon the experiences of a sample size of
> one without a clear rationale.
>
> David J.
>
>

--
with best regards,
radiodiversion

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2021-08-18 11:06:05 Re: Clarify how triggers relate to transactions
Previous Message David G. Johnston 2021-08-18 00:47:32 Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"