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 1hvM5a-00054X-Cm for pgsql-general@arkaria.postgresql.org; Wed, 07 Aug 2019 13:34:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvM5Y-0001iZ-9k for pgsql-general@arkaria.postgresql.org; Wed, 07 Aug 2019 13:34:48 +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 1hvM5X-0001iK-S1 for pgsql-general@lists.postgresql.org; Wed, 07 Aug 2019 13:34:48 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvM5U-0001lP-K1 for pgsql-general@lists.postgresql.org; Wed, 07 Aug 2019 13:34:47 +0000 Received: by mail-ot1-x330.google.com with SMTP id r6so104276908oti.3 for ; Wed, 07 Aug 2019 06:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdf-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:thread-index:date:message-id:subject:to; bh=HR+KV2oWCIPKBPIfIMKbTKz089qwfEjAs0/gnjxOOLE=; b=X9GTnyn320AbaQLvbwUesPXNsgKgu63ReB9YFbO7Mj4wITDtaS/b1rafiNi5ss5/Jf cGGc+R8MFUPXaFe1GK/TTOZQrceWmdb5j/hbPbZ+3/c5SescW9uzHefRH1oKvKUdPw09 mKn01VBNZZrYkWWpERJsSreBGAlXDBmhwFiySdOxPMfPUckj+1oiimY5dOP4ghePJEv9 whDfoWYCezP+02DGjEPrU0KbWVGUUGMBusJkiRe3odOF7gNN6UlHKO19ExvTaSAQEeSP Q9wxKm54wELkb2zK+UPR2WrsE5x8ly+8gfkkaUmqO/xDdtZoZU05QHVWIEIr59+wmaLq m5Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to; bh=HR+KV2oWCIPKBPIfIMKbTKz089qwfEjAs0/gnjxOOLE=; b=qxzq761mWYbEzLYihWaNN+r8mKXWJGi57Tqco3ZShk//XQ79HE/ka893Q/u9eR1fjS GxMjlYoAVNhp/6MX0gbcV3FTauiAqLYYVK1BiwTlNG678f0G0qPZiB4UkC36dzaw64Wu 6CvNjs4N9ZnwmcV8i2IHtJ3ENU2T9LfyfSz5eUkQ+/fbMIsmDmiko++ZmogDcJJO1XUD fwTz8VFt2PRESUlE4lMA3cHa0K8jvwl4uhA53wiyxI//SLrtd5mki2Rgoeu3GP3naiLC snXvlCNfY3/BT8myS7F41JYLTkHoZboSh5PNE4dyfEUpqYW5xGqCeIO0O4YM4CUZqy/K fAjA== X-Gm-Message-State: APjAAAVhSQ08IGaM5gq8wLt8suDP/3k8yQH0/GSs6S9/KSztwXFQ6wsi EFH0SHoyKCfWUN8/S1kIS978O7Pqza/f8nHww6N++F63Ui95Zxsn0ROi7SQ6W79OY90O0sDTarH pdPXCGyZTw4W1A7CIo8AYQxZ23Dl7CG/TvjZRrUBKMocK X-Google-Smtp-Source: APXvYqyR0TeZ0bxIOjOyt4AvunRZRNGgsJfCbWczPZ3o76VcjdyjT6c7JOHTGRmKIvOIJqIZC73NAlwxqgEgzObf3qc= X-Received: by 2002:a9d:6f0e:: with SMTP id n14mr7200832otq.38.1565184882101; Wed, 07 Aug 2019 06:34:42 -0700 (PDT) From: "Daniel Fink (PDF)" MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdVNI/HPA+2x3AV7RmujM+HlucJLUQ== Date: Wed, 7 Aug 2019 15:34:39 +0200 Message-ID: <4b0d1ee711c4079c0544216bb2bdff4b@mail.gmail.com> Subject: pg_wal fills up on big update query To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e7e706058f8700be" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000e7e706058f8700be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, I have a migration where I =C2=B7 Add a new nullable column to a table =C2=B7 update almost every row in this big table (8 million rows) f= rom another table where I set this new column I have also a replication setup running. The database has a size of around 20GB. While the migration is running, it more than doubles is size and fills up all space. Then the migration fails and is rolled back. What is the best way of keeping this from happening? 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. Is my thinking here correct? Thanks in advance and Best Regards, Daniel --=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 . --000000000000e7e706058f8700be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <= div class=3D"WordSection1">

Hi all,

=C2=A0

I have a migration where I

= =C2=B7=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Add a new nullabl= e column to a table

=C2=B7=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 update almost every row in this big table (8 million rows) from anothe= r table where I set this new column

=C2=A0

I have also a replication setup running.

The database has a size of around 20GB.

While the migration is running, it more than doubles is size and fills u= p all space.

Then the migration fails and is roll= ed back.

=C2=A0

What is= the best way of keeping this from happening?

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.

Is my thinking here correct?

=C2=A0

Thanks in advance and Best Regards,

Daniel


This message may contain confidential and privileged information. If i= t has been sent to you in error, please reply to advise the sender of the e= rror and then immediately permanently delete it and all attachments to it f= rom 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 sende= r 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 sc= anned by us and/or by external service providers to detect and prevent thre= ats to our systems, investigate illegal or inappropriate behavior, and/or e= liminate unsolicited promotional e-mails (=E2=80=9Cspam=E2=80=9D). If you = have any concerns about this process, please contact us at legal.department@pdf.com. --000000000000e7e706058f8700be--