From: | "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com> |
---|---|
To: | 'David Fetter' <david(at)fetter(dot)org> |
Cc: | 'Tomas Vondra' <tomas(dot)vondra(at)enterprisedb(dot)com>, 'Tomas Vondra' <tomas(dot)vondra(at)2ndquadrant(dot)com>, "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | RE: POC: postgres_fdw insert batching |
Date: | 2020-11-30 09:34:57 |
Message-ID: | TYAPR01MB299064F2876A0B9FC0EFDCD8FEF50@TYAPR01MB2990.jpnprd01.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
From: David Fetter <david(at)fetter(dot)org>
> Please pardon me for barging in late in this discussion, but if we're
> going to be using a bulk API here, wouldn't it make more sense to use
> COPY, except where RETURNING is specified, in place of INSERT?
Please do not hesitate. I mentioned earlier in this thread that I think INSERT is better because:
--------------------------------------------------
* When the user executed INSERT statements, it would look strange to the user if the remote SQL is displayed as COPY.
* COPY doesn't invoke rules unlike INSERT. (I don't think the rule is a feature what users care about, though.) Also, I'm a bit concerned that there might be, or will be, other differences between INSERT and COPY.
--------------------------------------------------
Also, COPY to foreign tables currently uses INSERTs, the improvement of using COPY instead of INSERT is in progress [1]. Keeping "COPY uses COPY, INSERT uses INSERT" correspondence seems natural, and it makes COPY's high-speed advantage stand out.
[1]
Fast COPY FROM command for the table with foreign partitions
https://www.postgresql.org/message-id/flat/3d0909dc-3691-a576-208a-90986e55489f%40postgrespro.ru
Regards
Takayuki Tsunakawa
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2020-11-30 10:04:34 | Re: [PATCH] Keeps tracking the uniqueness with UniqueKey |
Previous Message | Hou, Zhijie | 2020-11-30 09:30:43 | support IncrementalSortPath type in outNode() |