pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rinat Shigapov <rinatshigapov@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Too coarse predicate locks granularity for B+ tree indexes
Date: Tue, 07 Feb 2023 11:29:50 +0100
Message-ID: <f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at> (raw)
In-Reply-To: <CAJneKMX826bmGpTHyt9-oM3Qbfk1mX8-Kn1E7s2Gt2MNF=yRaQ@mail.gmail.com>
References: <CAJneKMX826bmGpTHyt9-oM3Qbfk1mX8-Kn1E7s2Gt2MNF=yRaQ@mail.gmail.com>

On Tue, 2023-02-07 at 16:23 +0600, Rinat Shigapov wrote:
> I have a concurrent testsuite that runs 14 test cases. Each test case operates
> on a disjoint set of records, doesn't retry transactions and is run under
> 'serializable' isolation level. The test data is small and likely fits within
> a single tuple page.
> 
> When I finished the test suite I was surprised that PostgreSQL 14.5 returns
> serialization failure on every test suite run.

This is no question for the hackers list; redirecting to general.

That behavior sounds perfectly normal to me: if everything is in a single
page, PostgreSQL probably won't use an index scan.  With a sequential scan,
the predicate lock will be on the whole table.  So you should expect
serialization failures.  This is well documented.

Perhaps you should use a more realistic test case with a reasonable
amount of data.

Yours,
Laurenz Albe





view thread (8+ messages)  latest in thread

Message-ID: <f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at>
Permalink:  ../f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at/
Also on:    postgresql.org/message-id/f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, rinatshigapov@gmail.com
  Subject: Re: Too coarse predicate locks granularity for B+ tree indexes
  In-Reply-To: <f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at>
  References: <CAJneKMX826bmGpTHyt9-oM3Qbfk1mX8-Kn1E7s2Gt2MNF=yRaQ@mail.gmail.com> <f5ddc5fc7ef9fc3a8469bc7e0ee68e89ea8f1e2a.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox