Allow batched insert during cross-partition updates - Mailing list pgsql-hackers

From Amit Langote
Subject Allow batched insert during cross-partition updates
Date
Msg-id CA+HiwqH1Lz1yJmPs=aD-pzd_HLLynLHvq5iYeT9mB0bBV7oJ6w@mail.gmail.com
Whole thread Raw
Responses Re: Allow batched insert during cross-partition updates  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
Based on the discussion at:

https://www.postgresql.org/message-id/6929d485-2d2a-da46-3681-4a400a3d794f%40enterprisedb.com

I'm posting the patch for $subject here in this new thread and I'll
add it to the next CF per Tomas' advice.

With 927f453a94106 committed earlier today, we limit insert batching
only to the cases where the query's main command is also insert,
because allowing it to be used in other cases can hit some limitations
of the current code.

One such case is cross-partition updates of a partitioned table which
internally uses insert.  postgres_fdw supports some cases where a row
is moved from a local partition to a foreign partition.  When doing
so, the moved row is inserted into the latter, but those inserts can't
use batching due to the aforementioned commit.

As described in the thread linked above, to make batching possible for
those internal inserts, we'd need to make some changes to both the
core code and postgres_fdw, which the attached patch implements.
Details are in the commit message.

-- 
Amit Langote
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: A reloption for partitioned tables - parallel_workers
Next
From: Amit Langote
Date:
Subject: Re: Allow batched insert during cross-partition updates