From: Daniel Fink (PDF) <daniel.fink@pdf.com>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: RE: pg_wal fills up on big update query
Date: Fri, 9 Aug 2019 17:04:58 +0200
Message-ID: <3e1d490628978f11f8e44f25ffe7ba14@mail.gmail.com> (raw)
In-Reply-To: <CAKoxK+4MoyYoFggQAok=AR2_+riv_yTFes1oAqLD_5FA3KZhVA@mail.gmail.com>
References: <4b0d1ee711c4079c0544216bb2bdff4b@mail.gmail.com>
<CAKoxK+4MoyYoFggQAok=AR2_+riv_yTFes1oAqLD_5FA3KZhVA@mail.gmail.com>
Hi Rob,
Thanks, I will try.
It’s a bit of a bummer though, because I just started to use flywaydb to
manage migrations, and it wraps all migrations into a single transaction.
So I have to do this outside of the tool.
I will still try to evaluate if locking has any effect, to have a better
understanding of how postgres works under the hood.
Best Regards,
Daniel
-----Original Message-----
From: Luca Ferrari [mailto:fluca1978@gmail.com]
Sent: Friday, August 9, 2019 3:58 PM
To: Daniel Fink (PDF) <daniel.fink@pdf.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pg_wal fills up on big update query
On Wed, Aug 7, 2019 at 3:34 PM Daniel Fink (PDF) <daniel.fink@pdf.com>
wrote:
> My current idea is to lock both tables completely from access (the queried
> and the updated one) so that postgresql does not have to ensure isolation
> for concurrent queries by keeping a copy of each row.
I'm not sure that locking will prevent the snapshotting and the WAL
machinery, but someone more expert on the are could clarify this.
Since the column is nullable, I would apply it outside of the transaction,
and then do the update. If that still fails, I would try to split the update
on small chunks (after all, it's an update, so it is smething you can line
up data).
Luca
--
This message may contain confidential and privileged information. If it has
been sent to you in error, please reply to advise the sender of the error
and then immediately permanently delete it and all attachments to it from
your systems. If you are not the intended recipient, do not read, copy,
disclose or otherwise use this message or any attachments to it. The sender
disclaims any liability for such unauthorized use. PLEASE NOTE that all
incoming e-mails sent to PDF e-mail accounts will be archived and may be
scanned by us and/or by external service providers to detect and prevent
threats to our systems, investigate illegal or inappropriate behavior,
and/or eliminate unsolicited promotional e-mails (“spam”). If you have any
concerns about this process, please contact us at legal.department@pdf.com
<mailto:legal.department@pdf.com>.
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: daniel.fink@pdf.com, fluca1978@gmail.com
Subject: Re: pg_wal fills up on big update query
In-Reply-To: <3e1d490628978f11f8e44f25ffe7ba14@mail.gmail.com>
References: <4b0d1ee711c4079c0544216bb2bdff4b@mail.gmail.com> <CAKoxK+4MoyYoFggQAok=AR2_+riv_yTFes1oAqLD_5FA3KZhVA@mail.gmail.com> <3e1d490628978f11f8e44f25ffe7ba14@mail.gmail.com>
* 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