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 1mRu4E-0001mC-Ax for pgsql-general@arkaria.postgresql.org; Sun, 19 Sep 2021 10:29:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mRu4C-0000s8-5B for pgsql-general@arkaria.postgresql.org; Sun, 19 Sep 2021 10:29:00 +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 1mRu4B-0000pv-FN for pgsql-general@lists.postgresql.org; Sun, 19 Sep 2021 10:28:59 +0000 Received: from srvimsva2.dst.dk ([91.208.143.64]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRu43-0001e2-I1 for pgsql-general@postgresql.org; Sun, 19 Sep 2021 10:28:57 +0000 Received: from srvimsva2.dst.dk (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B758D10406A for ; Sun, 19 Sep 2021 12:28:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dst.dk; s=dmz20180119; t=1632047328; bh=GoIk13/52cwKLr1em6kuhcf81SD25y/9NxWS7ipRRug=; h=From:To:Date; b=lSPFUntbb1OrEEN09KTuZZkyewCD/MD6jk1VmS+vvSW3BSD6Fx0q0iLV0+s0vdTQP Bfo52Yzdoq/Lju1RJmWwEYkC+ozDoc8b7Bw41APaBQYK10HdPJtf2WUaBDSrJeFzHw FxRzu08rElTnnyBDKk7QR2lW0M2yijxqj8KK3gWI= Received: from srvimsva2.dst.dk (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 93711104066 for ; Sun, 19 Sep 2021 12:28:48 +0200 (CEST) Received: from Sepo.dst.dk (unknown [192.168.64.12]) by srvimsva2.dst.dk (Postfix) with ESMTP for ; Sun, 19 Sep 2021 12:28:48 +0200 (CEST) Received: from srvexc9.dst.local ([172.30.32.49]) by Sepo.dst.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 903 for ; Sun, 19 Sep 2021 12:28:48 +0200 (CEST) Received: from srvexc8.dst.local (172.30.32.48) by srvexc9.dst.local (172.30.32.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Sun, 19 Sep 2021 12:28:48 +0200 Received: from srvexc8.dst.local ([fe80::9df8:5de5:1bf2:8b3b]) by srvexc8.dst.local ([fe80::9df8:5de5:1bf2:8b3b%2]) with mapi id 15.01.2242.008; Sun, 19 Sep 2021 12:28:48 +0200 From: Niels Jespersen To: "pgsql-general@postgresql.org" Subject: Possibilities for optimizing inserts across oracle_fdw foreign data wrapper Thread-Topic: Possibilities for optimizing inserts across oracle_fdw foreign data wrapper Thread-Index: AdetP1VB7h0ji6tNT/STltuTWzToYw== Date: Sun, 19 Sep 2021 10:28:48 +0000 Message-ID: Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.33.38] Content-Type: multipart/alternative; boundary="_000_ae9ab150af5a417e985e581249107853dstdk_" MIME-Version: 1.0 X-TM-AS-GCONF: 00 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_ae9ab150af5a417e985e581249107853dstdk_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello all We are often using the oracle_fdw to transfer data between Postgres (versio= n 11+) and Oracle (version 18+). It works great. However I have a task at hand that requires inserting a few billion rows in= an Oracle table from a Postgres query. insert into t_ora (a,b,c) select a,b,c from t_pg; This is driven from a plpgsql stored procedure, if that matters. I want to optimize the running time of this. But I am unsure of which, if a= ny, possibilities there actually is. Reducing the number of network roundtrips is usually a good way to increase= throughput. But, how do I do that? If I could make the Oracle insert direct load, that would usually also incr= ease throughput. But, is that possible here. There are no constraints defin= ed on the destinaton tables. Regards Niels Jespersen --_000_ae9ab150af5a417e985e581249107853dstdk_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello all

 

We are often using the oracle_fdw to transfer data betw= een Postgres (version 11+) and Oracle (version 18+). It works great= .

 

However I have a task at hand that requires inserting a= few billion rows in an Oracle table from a Postgres query.

 

insert into t_ora (a,b,c)   

select a,b,c from t_pg;

 

This is driven from a plpgsql stored procedure, if that= matters.

 

I want to optimize the running time of this. But I am u= nsure of which, if any, possibilities there actually is.

 

Reducing the number of network roundtrips is usually a = good way to increase throughput. But, how do I do that?

 

If I could make the Oracle insert direct load, that wou= ld usually also increase throughput. But, is that possible here. There are = no constraints defined on the destinaton tables.

 

Regards Niels Jespersen

--_000_ae9ab150af5a417e985e581249107853dstdk_--