Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnjJz-0000fl-Bd for pgsql-general@arkaria.postgresql.org; Tue, 23 Jun 2020 13:50:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jnjJy-0000Oc-9L for pgsql-general@arkaria.postgresql.org; Tue, 23 Jun 2020 13:50:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnjJy-0000OV-1u for pgsql-general@lists.postgresql.org; Tue, 23 Jun 2020 13:50:42 +0000 Received: from mxh02aws140.mxout.inova.com.br ([34.196.109.140] helo=mxhero01.a.inova.com.br) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnjJv-0003qf-Pe for pgsql-general@lists.postgresql.org; Tue, 23 Jun 2020 13:50:41 +0000 Received: from MXHERO01.A.INOVA.COM.BR (localhost [127.0.0.1]) by mxhero01.a.inova.com.br (Postfix) with ESMTP id 319CD4C536 for ; Tue, 23 Jun 2020 13:50:38 +0000 (UTC) Received: from mxhero01.a.inova.com.br (localhost [127.0.0.1]) by mxhero01.a.inova.com.br (Postfix) with ESMTP for ; Tue, 23 Jun 2020 13:50:38 +0000 (UTC) Received: from mxhero02.a.inova.com.br (ip-10-0-4-48.ec2.internal [10.0.4.48]) by mxhero01.a.inova.com.br (Postfix) with ESMTPS id 34ACC4C776 for ; Tue, 23 Jun 2020 13:50:17 +0000 (UTC) Received: from 10.0.4.78 (localhost [127.0.0.1]) by mxhero02.a.inova.com.br (Postfix) with ESMTP id 245CD18E22F for ; Tue, 23 Jun 2020 13:50:17 +0000 (UTC) Received: from corpmoutpolicyd01.a.inova.com.br (puppetmaster.a.inova.com.br [10.0.1.88]) by mxhero02.a.inova.com.br (Postfix) with ESMTP; Tue, 23 Jun 2020 13:50:17 +0000 (UTC) Received: from corpmoutpolicyd01.a.inova.com.br (localhost [127.0.0.1]) by corpmoutpolicyd01.a.inova.com.br (Postfix) with ESMTP id 0A2A12201F5; Tue, 23 Jun 2020 10:50:13 -0300 (BRT) Received: from corpmout01.a.inova.com.br (ip-10-0-1-125.ec2.internal [10.0.1.125]) by corpmoutpolicyd01.a.inova.com.br (Postfix) with ESMTP id E9AC9AB600; Tue, 23 Jun 2020 10:50:12 -0300 (BRT) Received: from corpmbox02.a.inova.com.br (ip-10-0-4-158.ec2.internal [10.0.4.158]) by corpmout01.a.inova.com.br (Postfix) with ESMTP; Tue, 23 Jun 2020 10:50:12 -0300 (-03) Date: Tue, 23 Jun 2020 10:50:12 -0300 (BRT) From: luis.roberto@siscobra.com.br To: Jason Ralph Cc: Adrian Klaver , pgsql-general@lists.postgresql.org Message-ID: <552644140.73691855.1592920212865.JavaMail.zimbra@siscobra.com.br> In-Reply-To: References: <9c21c0a0-0897-125d-b27e-960bc357b0ef@aklaver.com> Subject: Re: UPDATE on 20 Million Records Transaction or not? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.1.247] X-Mailer: Zimbra 8.8.15_GA_3918 (ZimbraWebClient - GC83 (Win)/8.8.15_GA_3895) Thread-Topic: UPDATE on 20 Million Records Transaction or not? Thread-Index: AdZJYfCNN62E+ot+TRCO5aHYbyalFgAAZVKAAABDOcD0z4TdGw== x-mxHero-Origin-Ip: /127.0.0.1:57898 X-mxHero-AttachmentBlock: rule=48;result=false X-mxHero-AttachmentBlock: rule=48;result=false X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=S/up+MkP c=1 sm=1 tr=0 cx=a_idp_d a=aVKa9x/uM93/m3V8yChZ6A==:117 a=FKkrIqjQGGEA:10 a=_uFG4AKbl_AA:10 a=IkcTkHD0fZMA:10 a=nTHF0DUjJn0A:10 a=h2mZ7ym4DuMA:10 a=Z7tdvvPuprf68a12HI0A:9 a=QEXdDO2ut3YA:10 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thanks Adrian, > You could break it down into multiple transactions if there is way to specify ranges of records. Say I couldn't break it up, would it be faster in or out of the transaction? It depends whether you have concurrent transactions using the table. If you do, I think it would be better to split the update between smaller transactions.