pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Andrey V. Lepikhov <a.lepikhov@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: POC: postgres_fdw insert batching
Date: Sun, 12 Jul 2020 02:11:01 +0200
Message-ID: <20200712001101.x65f3hvsanvamtgj@development> (raw)
In-Reply-To: <0300d7df-854b-6f72-1e93-dfbf98f3fc8a@postgrespro.ru>
References: <20200628151002.7x5laxwpgvkyiu3q@development>
	<0300d7df-854b-6f72-1e93-dfbf98f3fc8a@postgrespro.ru>

On Fri, Jul 10, 2020 at 09:28:44AM +0500, Andrey V. Lepikhov wrote:
>On 6/28/20 8:10 PM, Tomas Vondra wrote:
>>Now, the primary reason why the performance degrades like this is that
>>while FDW has batching for SELECT queries (i.e. we read larger chunks of
>>data from the cursors), we don't have that for INSERTs (or other DML).
>>Every time you insert a row, it has to go all the way down into the
>>partition synchronously.
>
>You added new fields into the PgFdwModifyState struct. Why you didn't 
>reused ResultRelInfo::ri_CopyMultiInsertBuffer field and 
>CopyMultiInsertBuffer machinery as storage for incoming tuples?
>

Because I was focused on speeding-up inserts, and that is not using
CopyMultiInsertBuffer I think. I agree the way the tuples are stored
may be improved, of course.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





view thread (115+ messages)  latest in thread

Message-ID: <20200712001101.x65f3hvsanvamtgj@development>
Permalink:  ../20200712001101.x65f3hvsanvamtgj@development/
Also on:    postgresql.org/message-id/20200712001101.x65f3hvsanvamtgj@development

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, a.lepikhov@postgrespro.ru
  Subject: Re: POC: postgres_fdw insert batching
  In-Reply-To: <20200712001101.x65f3hvsanvamtgj@development>

* 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