Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK5d3-0001T4-IS for pgsql-general@arkaria.postgresql.org; Wed, 29 Nov 2017 16:54:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK5d3-0006Yn-4t for pgsql-general@arkaria.postgresql.org; Wed, 29 Nov 2017 16:54:33 +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.84_2) (envelope-from ) id 1eK5d2-0006Yc-Tp for pgsql-general@lists.postgresql.org; Wed, 29 Nov 2017 16:54:32 +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 1eK5cz-00064l-LN for pgsql-general@lists.postgresql.org; Wed, 29 Nov 2017 16:54:32 +0000 Received: from wrkhors.com (localhost [127.0.0.1]) by jeeves.wrkhors.com (Postfix) with ESMTP id 7FCE710EDE8; Wed, 29 Nov 2017 10:54:25 -0600 (CST) Date: Wed, 29 Nov 2017 11:02:10 -0600 From: Steven Lembark To: pgsql-general@lists.postgresql.org Cc: lembark@wrkhors.com Subject: Re: large numbers of inserts out of memory strategy Message-ID: <20171129110210.59a57d4d@wrkhors.com> In-Reply-To: References: <74C96E30-97C3-45D1-887F-F876602355DE@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 > > what tools / languages ate you using? > > I'm using python to read binary source files and create the text files > contains the SQL. Them I'm running psql -f . Then chunking the input should be trivial. There are a variety of techniques you can use to things like disable indexes during loading, etc. Maybe load them into temp tables and then insert the temp's into the destination tables. The point is to amortize the memory load over the entire load period. -- Steven Lembark 1505 National Ave Workhorse Computing Rockford, IL 61103 lembark@wrkhors.com +1 888 359 3508