Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6S2-0001wZ-Pa for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 15:05:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hw6S1-000695-Ke for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 15:05:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6S1-00068c-BK for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 15:05:05 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6Ry-0006o9-NN for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 15:05:04 +0000 Received: by mail-ot1-x32b.google.com with SMTP id b7so83509898otl.11 for ; Fri, 09 Aug 2019 08:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdf-com.20150623.gappssmtp.com; s=20150623; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc:content-transfer-encoding; bh=GRz8yB+pgVEGryGyA9dUL6usOhF3tmFU8nnyfMYONW0=; b=EUJ2bdxfNjxDem+5eymgmAvsASuXTJJ6ssZn1bS7V0aMbek8eT8CEMvDRTjsNuicYV wCJrwhjpThurJv5RF/8WC4NPNHg0gK7yoIkHT5m2YX4Vkhv9A8yEBBueXuaXwyJ7UdpU lJVdPlofSqAavgV+oPEo8FPLer57/ljPA82Mk2JkEA9Cs1y8l2shkV0Y8updOVA4FMyg cEMsVg4GhFb/ZunDP78sSIfQI3DrovZKjs0KUPQzzi0gmh7Y3gZyyMiJgQo82thO16Wu XQDNKF3m/I0GHnP2uK0rIw97FHxvu5rXEngMe/zYVC1gAtfKZYEi4aUGw6yKU9wEJqiH /NyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc :content-transfer-encoding; bh=GRz8yB+pgVEGryGyA9dUL6usOhF3tmFU8nnyfMYONW0=; b=sbCkQpNMB1Tb8tWe61nTl5q3kmJ1+XQDM9brJDOfMdK1Uw77g3QiqadVszxqMUTUrT 6Xo8er9iynYWlT5of8y4aWdKDjF+FqdX8lAi99MlfhShjtqcdWUqLGSlcG6lCgJqrWGE WAPitlOP2YR6jlN9asrr9GQ57DM48skKAhko0ZbW03FWFeC9FNagGL1OPsWgxiEPZemf Wxxk/Tzy6NzwvQHwOc+/3C/f0wGshWplEHQJ7RITYctcQ5dsLsJzWjxraJ3/z528Qqf3 oxxofS+tvR47br6TNVprJXAGJINo475M4vtpYG2mtdEP2Ncg5KDJYGSrtyusdk+ZrrX/ Cu2Q== X-Gm-Message-State: APjAAAWYqC62jePMy+gcOKrplBib92qEbUEXch4Ep1dPoRh1HQ2eN2bJ g6Mez6QrD93JtSIkiW1Y0HOJyn2/dpgl/3bDxRaEJPCtnXfrs+5ZHXVT6ZEYlkl7/CcFwJnAbDh llWNG22lLhfaOlx3iePg6a1roKFFZleNMRGMHaNXaFke3 X-Google-Smtp-Source: APXvYqwd9AcI+P5OHshEkCin+qdHxmEdIptfClNVKzD0BHVpojpOMn5qMYG615vbl50E2lmskUrYnUQqZXimCH7o99Q= X-Received: by 2002:aca:5403:: with SMTP id i3mr6406514oib.132.1565363100917; Fri, 09 Aug 2019 08:05:00 -0700 (PDT) From: "Daniel Fink (PDF)" References: <4b0d1ee711c4079c0544216bb2bdff4b@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKgM4Cxw8uI2ViB6Ui4Y+Wtnzs6RQL94jchpUUxRbA= Date: Fri, 9 Aug 2019 17:04:58 +0200 Message-ID: <3e1d490628978f11f8e44f25ffe7ba14@mail.gmail.com> Subject: RE: pg_wal fills up on big update query To: Luca Ferrari Cc: pgsql-general Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Rob, Thanks, I will try. It=E2=80=99s a bit of a bummer though, because I just started to use flywa= ydb 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) Cc: pgsql-general Subject: Re: pg_wal fills up on big update query On Wed, Aug 7, 2019 at 3:34 PM Daniel Fink (PDF) wrote: > My current idea is to lock both tables completely from access (the querie= d > 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 updat= e on small chunks (after all, it's an update, so it is smething you can line up data). Luca --=20 This message may contain confidential and privileged information. If it has= =20 been sent to you in error, please reply to advise the sender of the error= =20 and then immediately permanently delete it and all attachments to it from= =20 your systems. If you are not the intended recipient, do not read, copy,=20 disclose or otherwise use this message or any attachments to it. The sender= =20 disclaims any liability for such unauthorized use. PLEASE NOTE that all=20 incoming e-mails sent to PDF e-mail accounts will be archived and may be=20 scanned by us and/or by external service providers to detect and prevent=20 threats to our systems, investigate illegal or inappropriate behavior,=20 and/or eliminate unsolicited promotional e-mails (=E2=80=9Cspam=E2=80=9D). = If you have any=20 concerns about this process, please contact us at legal.department@pdf.com= =20 .