Re: In-place updates and serializable transactions

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: joshua(dot)yanovski(at)gmail(dot)com
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Kevin Grittner <kgrittn(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql(at)j-davis(dot)com, joe(dot)conway(at)crunchydata(dot)com
Subject: Re: In-place updates and serializable transactions
Date: 2018-11-15 08:41:35
Message-ID: CAGz5QCKR2epaVw4K9t6YKPoARSjiVMVJVK7ohs3KBOMA6Gd=nQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 14, 2018 at 5:13 PM Joshua Yanovski
<joshua(dot)yanovski(at)gmail(dot)com> wrote:
>
> This is only a personal anecdote, but from my own experience with serializability, this sort of blind update isn't often contended in realistic workloads. The reason is that (again, IME), most blind writes are either insertions, or "read-writes in disguise" (the client read an old value in a different transaction); in the latter case, the data in question are often logically "owned" by the client, and will therefore rarely be contended. I think there are two major exceptions to this: transactions that perform certain kinds of monotonic updates (for instance, marking a row complete in a worklist irrespective of whether it was already completed), and automatic bulk updates. However, these were exactly the classes of transactions that we already ran under a lower isolation level than serializability, since they have tightly constrained shapes and don't benefit much from the additional guarantees.
>
> So, if this only affects transactions with blind updates, I doubt it will cause much pain in real workloads (even though it might look bad in benchmarks which include a mix of blind writes and rmw operations). Particularly if it only happens if you explicitly opt into zheap storage.
>
Thanks Joshua for sharing your input on this. I'm not aware of any
realistic workloads for serializable transactions. So, it is really
helpful.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-15 08:59:36 Re: reloption to prevent VACUUM from truncating empty pages at the end of relation
Previous Message Masahiko Sawada 2018-11-15 08:33:26 Re: [Todo item] Add entry creation timestamp column to pg_stat_replication