From: | "Wong, Kam Fook (TR Technology)" <kamfook(dot)wong(at)thomsonreuters(dot)com> |
---|---|
To: | peter plachta <pplachta(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
Cc: | 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: [EXT] Re: Read-only connectios optimizatios |
Date: | 2025-01-27 17:41:51 |
Message-ID: | CH0PR03MB610064480D9B8B083095A98EFEEC2@CH0PR03MB6100.namprd03.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Just a thought if you are moving to AWS Aurora Postgres. You can point the read queries/transaction/long running read queries to the reader node. That will not block the autovacuum process.
-----Original Message-----
From: peter plachta <pplachta(at)gmail(dot)com>
Sent: Saturday, January 25, 2025 4:12 PM
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Edson Richter <edsonrichter(at)hotmail(dot)com>; pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: [EXT] Re: Read-only connectios optimizatios
External Email: Use caution with links and attachments.
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 <laurenz(dot)albe(at)cybertec(dot)at> 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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Clemens Eisserer | 2025-01-28 14:58:08 | Why ORing with a false one-time filter turns an Index-Lookup into a SeqScan |
Previous Message | Laurenz Albe | 2025-01-27 15:06:21 | Re: [EXTERNAL] - Re: Reg pg_restore taking more time in windows compare to linux |