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 1fpTVc-0007mB-Ng for pgsql-admin@arkaria.postgresql.org; Tue, 14 Aug 2018 07:12:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpTVa-0001aU-QU for pgsql-admin@arkaria.postgresql.org; Tue, 14 Aug 2018 07:12:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpTVa-0001aN-FJ for pgsql-admin@lists.postgresql.org; Tue, 14 Aug 2018 07:12:50 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fpTVX-0001jk-3T for pgsql-admin@lists.postgresql.org; Tue, 14 Aug 2018 07:12:49 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id A614F48A98; Tue, 14 Aug 2018 09:12:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id DotG0XsreHXR; Tue, 14 Aug 2018 09:12:41 +0200 (CEST) Message-ID: <1534230760.2379.6.camel@cybertec.at> Subject: Re: increase insert into local table from remote oracle table preformance From: Laurenz Albe To: Mariel Cherkassky , pgsql-admin@lists.postgresql.org Date: Tue, 14 Aug 2018 09:12:40 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mariel Cherkassky wrote: > Hi, > I'm using postgresql v10.4. I have a local partitioned table (by range - data, every day has its own table). > I'm using the oracle_fdw extension to bring data from the oracle partitioned table into my local postgresql > (insert into local select * from remote_oracle). Currently, I dont have any indexes on the postgresql`s table. > It takes me 10 hours to copy 200G over the network and it is very slow. > Any recommandations what can I change or improve ? Hard to say anything with so little data. You could try a bigger value for the "prefetch" option. One known reason for slow performance is if there are LOBs in the Oracle table. You could parallelize processing by running several such INSERTs in parallel, perhaps one per partition, and inserting directly into the partitions. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com