Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC4Pr-0007Uy-FP for pgsql-general@arkaria.postgresql.org; Fri, 27 Apr 2018 14:32:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fC4Pp-0005Kn-Ou for pgsql-general@arkaria.postgresql.org; Fri, 27 Apr 2018 14:32:01 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC4Pp-0005Gs-7X for pgsql-general@lists.postgresql.org; Fri, 27 Apr 2018 14:32:01 +0000 Received: from 23-25-19-49-static.hfc.comcastbusiness.net ([23.25.19.49] helo=jeeves.wrkhors.com) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fC4Pm-0006b0-Cp for pgsql-general@lists.postgresql.org; Fri, 27 Apr 2018 14:32:00 +0000 Received: from wrkhors.com (localhost [127.0.0.1]) by jeeves.wrkhors.com (Postfix) with ESMTP id 6B84B1171; Fri, 27 Apr 2018 09:42:08 -0500 (CDT) Date: Fri, 27 Apr 2018 09:30:27 -0500 From: Steven Lembark To: pgsql-general@lists.postgresql.org Cc: lembark@wrkhors.com Subject: Re: Long running INSERT+SELECT query Message-ID: <20180427093027.6959987e@wrkhors.com> In-Reply-To: <5893718d-4449-741f-671a-aea1ee654944@gmail.com> References: <11ea9b74-243d-b275-be10-1004f51a4aa6@gmail.com> <39121e73-b04a-77c4-cb5f-55530e82f0d3@aklaver.com> <320a63d9-71b5-90d1-fd2c-9ed408ae1016@aklaver.com> <5893718d-4449-741f-671a-aea1ee654944@gmail.com> Organization: Workhorse Computing MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 26 Apr 2018 23:32:33 +0300 Vitaliy Garnashevich wrote: > The aggregated table has hundreds of millions of rows, and the query > runs for many hours (which is one of the reasons why it's better not > to fail). I really doubt that row level locking would work. That > would be a lot of RAM just to hold all the locks. All the more reason to use temp tables. -- Steven Lembark 1505 National Ave Workhorse Computing Rockford, IL 61103 lembark@wrkhors.com +1 888 359 3508