Re: [POC] Fast COPY FROM command for the table with foreign partitions

From: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Amit Langote <amitlangote09(at)gmail(dot)com>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
Cc: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, Michael Paquier <michael(at)paquier(dot)xyz>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [POC] Fast COPY FROM command for the table with foreign partitions
Date: 2020-12-14 09:06:12
Message-ID: 9bff5ccc-8649-9699-1cdd-82b53164f9bb@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/1/20 2:02 PM, Amit Langote wrote:
> On Tue, Dec 1, 2020 at 2:40 PM tsunakawa(dot)takay(at)fujitsu(dot)com
> <tsunakawa(dot)takay(at)fujitsu(dot)com> wrote:
>> From: Amit Langote <amitlangote09(at)gmail(dot)com>
>> The code appears to require both BeginForeignCopy and EndForeignCopy,
>> while the following documentation says they are optional. Which is
>> correct? (I suppose the latter is correct just like other existing
>> Begin/End functions are optional.)

Fixed.

> Anyway, one thing we could do is rename
> ExecRelationAllowsMultiInsert() to ExecSetRelationUsesMultiInsert(

Renamed.

>> I agree with your idea of adding multi_insert argument to
ExecFindPartition() to request a multi-insert-capable partition. At
first, I thought ExecFindPartition() is used for all operations,
insert/delete/update/select, so I found it odd to add multi_insert
argument. But ExecFindPartion() is used only for insert, so
multi_insert argument seems okay.
>
> Good. Andrey, any thoughts on this?

I have no serious technical arguments against this, other than code
readability and reduce of a routine parameters. Maybe we will be
rethinking it later?

The new version rebased on commit 525e60b742 is attached.

--
regards,
Andrey Lepikhov
Postgres Professional

Attachment Content-Type Size
v13-0001-Move-multi-insert-decision-logic-into-executor.patch text/x-patch 16.4 KB
v13-0002-Fast-COPY-FROM-into-the-foreign-or-sharded-table.patch text/x-patch 36.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2020-12-14 09:14:39 Misleading comment in prologue of ReorderBufferQueueMessage
Previous Message Kyotaro Horiguchi 2020-12-14 09:04:37 Some error messages are omitted while recovery.