Re: Read-only connectios optimizatios - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: Read-only connectios optimizatios
Date
Msg-id d1581404ad5169663d985d78262e948ff2877c51.camel@cybertec.at
Whole thread Raw
In response to Read-only connectios optimizatios  (Edson Richter <edsonrichter@hotmail.com>)
Responses Re: Read-only connectios optimizatios
List 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



pgsql-performance by date:

Previous
From: Frits Hoogland
Date:
Subject: Re: Any risk or overhead considerations for frequently executing queries against catalog tables?
Next
From: Pavel Stehule
Date:
Subject: Re: Any risk or overhead considerations for frequently executing queries against catalog tables?