public inbox for [email protected]
help / color / mirror / Atom feedFrom: peter plachta <[email protected]>
To: Laurenz Albe <[email protected]>
Cc: Edson Richter <[email protected]>
Cc: [email protected]
Subject: Re: Read-only connectios optimizatios
Date: Sat, 25 Jan 2025 14:12:18 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
You can still block vacuum from running if you have long running (or very aggressive) read transactions. I don’t think they are very helpful or performant from a Postgres engine perspective.
They can be helpful in application development because they will fail if devs attempt any mutations inside read only (from what I recall).
Sent from my iPhone
> On Jan 25, 2025, at 10:01 AM, Laurenz Albe <[email protected]> wrote:
>
> 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
>
>
view thread (4+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Read-only connectios optimizatios
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox