Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frmXP-0006sV-FL for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 15:56:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1frmXM-0006CH-VS for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 15:56:12 +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 1frmXM-0006C9-5Q for pgsql-general@lists.postgresql.org; Mon, 20 Aug 2018 15:56:12 +0000 Received: from mx1.riseup.net ([198.252.153.129]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frmXH-0006xq-Py for pgsql-general@lists.postgresql.org; Mon, 20 Aug 2018 15:56:11 +0000 Received: from piha.riseup.net (piha-pn.riseup.net [10.0.1.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 5BC761A01B5 for ; Mon, 20 Aug 2018 08:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1534780564; bh=V3UqCmuoGCM6ZNAfuGCdidljE/VPco5QY89y9Zltx5o=; h=Date:From:To:Subject:References:In-Reply-To:From; b=pRl5DR8cD4y6lImeW/uSDYOfwCUFjELsvrtPKxZiBpsLdjtu9dXUs9yoAJjvaFk9d Afb0vd5f8c9IEYIvYQ0EX9fNOR0dLoBh9F4rLA29pjNl9WiZyMS3vFUaKl8qWGFHVP j9ISqMPqfj/3uXK+96OKQ0EVYskCimUcLu2r2drU= X-Riseup-User-ID: AB85DE3821FB363D5B3D09CDE53F8225749D82A468A94C5CA2DC4562F78F790F Received: from [127.0.0.1] (localhost [127.0.0.1]) by piha.riseup.net with ESMTPSA id BF7AD485AD for ; Mon, 20 Aug 2018 08:56:03 -0700 (PDT) Date: Mon, 20 Aug 2018 17:56:01 +0200 From: Nicolas Paris To: pgsql-general@lists.postgresql.org Subject: Re: Multiple COPY on the same table Message-ID: <20180820155601.kkjsvbt7hr7esyag@riseup.net> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <1497638817.10129815.1534776875333.ref@mail.yahoo.com> <1497638817.10129815.1534776875333@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497638817.10129815.1534776875333@mail.yahoo.com> Priority: normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > Can I split a large file into multiple files and then run copy using > each file. AFAIK, copy command locks the table[1] while there is no mention of this in the documentation[2]. > Will the performance boost by close to 4x?? You might be interested in the pbBulkInsert tool[3] that allows parallel copy with some succes accordingly to benchmarks. However, that tool does not handle multiline csv. Because of that limitation I have been using the standard copy command with binary format with some succes. [1] https://grokbase.com/t/postgresql/pgsql-general/01597pv3qs/copy-locking [2] https://www.postgresql.org/docs/current/static/sql-copy.html [3] https://github.com/bytefish/PgBulkInsert