RE: Fast COPY FROM based on batch insert - Mailing list pgsql-hackers

From tsunakawa.takay@fujitsu.com
Subject RE: Fast COPY FROM based on batch insert
Date
Msg-id TYAPR01MB2990ECA064C09DD3E4A0CA27FE3B9@TYAPR01MB2990.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Fast COPY FROM based on batch insert  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Responses Re: Fast COPY FROM based on batch insert
List pgsql-hackers
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
> We still have slow 'COPY FROM' operation for foreign tables in current master.
> Now we have a foreign batch insert operation And I tried to rewrite the patch [1]
> with this machinery.

I haven't looked at the patch, but nice performance.

However, I see the following problems.  What do you think about them?

1)
No wonder why the user would think like "Why are INSERTs run on the remote server?  I ran COPY."


2)
Without the FDW API for COPY, other FDWs won't get a chance to optimize for bulk data loading.  For example, oracle_fdw
mightuse conventional path insert for the FDW batch insert, and the direct path insert for the FDW COPY.
 


3)
INSERT and COPY in Postgres differs in whether the rule is invoked:

https://www.postgresql.org/docs/devel/sql-copy.html

"COPY FROM will invoke any triggers and check constraints on the destination table. However, it will not invoke
rules."


Regards
Takayuki Tsunakawa


pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Next
From: "tsunakawa.takay@fujitsu.com"
Date:
Subject: RE: Transactions involving multiple postgres foreign servers, take 2