Re: Read-only connectios optimizatios

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Edson Richter <edsonrichter(at)hotmail(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Read-only connectios optimizatios
Date: 2025-01-25 18:01:31
Message-ID: d1581404ad5169663d985d78262e948ff2877c51.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, 2025-01-25 at 14:55 +0000, Edson Richter wrote:
> -Connections are established using the jdbc "readonly" attribute.
>
> Does PostgreSQL perform any optimization on queries in this scenario to avoid
> establishing locks? Or are these queries treated like any other?

The only difference that I am aware of is that read-only transactions at the
SERIALIZABLE isolation level can release predicate locks earlier, which can
benefit performance.

But I don't think that you need to worry: reading transactions only take an
ACCESS SHARE lock on tables, which won't conflict with data modifications.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2025-01-25 18:18:49 Re: Any risk or overhead considerations for frequently executing queries against catalog tables?
Previous Message Frits Hoogland 2025-01-25 16:59:55 Re: Any risk or overhead considerations for frequently executing queries against catalog tables?