From: Niels Jespersen <NJN@dst.dk>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: SV: Possibilities for optimizing inserts across oracle_fdw foreign data wrapper
Date: Tue, 21 Sep 2021 07:22:00 +0000
Message-ID: <46197a3a49a140af99ef5753934c569d@dst.dk> (raw)
In-Reply-To: <4c3b032cbde95f53a40ffdcfd1e216309153f43b.camel@cybertec.at>
References: <ae9ab150af5a417e985e581249107853@dst.dk>
<4c3b032cbde95f53a40ffdcfd1e216309153f43b.camel@cybertec.at>
-----Oprindelig meddelelse-----
>Fra: Laurenz Albe <laurenz.albe@cybertec.at>
>Sendt: 20. september 2021 15:18
>Til: Niels Jespersen <NJN@dst.dk>; pgsql-general@postgresql.org
>Emne: Re: Possibilities for optimizing inserts across oracle_fdw foreign data wrapper
>
>On Sun, 2021-09-19 at 10:28 +0000, Niels Jespersen wrote:
>> We are often using the oracle_fdw to transfer data between 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.
>> If I could make the Oracle insert direct load, that would usually also increase throughput.
> But, is that possible here. There are no constraints defined on the destinaton tables.
>
>The cause of the bad performance for bulk data modifications is that the FDW API is built that way: each row INSERTed means a round trip between PostgreSQL and Oracle.
>
>That could be improved by collecting rows and inserting them in bulk on the Oracle side, but I don't feel like implementing that and complicating the code.>
>
>From my point of view, oracle_fdw is good for reading, but not for bulk writes.
>
>Yours,
>Laurenz Albe
Thank you for clairifying. I will use a python script for doing this, then. Read large chunks of data from Postgres and insert equally large chunks into Oracle, possibly using direct load. I know this can work.
Regards Niels
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: NJN@dst.dk, laurenz.albe@cybertec.at
Subject: Re: Possibilities for optimizing inserts across oracle_fdw foreign data wrapper
In-Reply-To: <46197a3a49a140af99ef5753934c569d@dst.dk>
References: <ae9ab150af5a417e985e581249107853@dst.dk> <4c3b032cbde95f53a40ffdcfd1e216309153f43b.camel@cybertec.at> <46197a3a49a140af99ef5753934c569d@dst.dk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox