pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: tanghy.fnst@fujitsu.com, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: houzj.fnst@fujitsu.com
Subject: Re: Fast COPY FROM based on batch insert
Date: Thu, 13 Oct 2022 09:38:05 +0500
Message-ID: <a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru> (raw)
In-Reply-To: <CAPmGK16aE1oO-AP_rjGLc8yf_OK_eoF1mQqsHVEzFu2WptXLMQ@mail.gmail.com>
References: <TYAPR01MB2990B8451B4C725242E270F7FE979@TYAPR01MB2990.jpnprd01.prod.outlook.com>
	<CAPmGK14ov-MbQtwHuSK5ESUeL1csgCVC1MAAwZxgV=NWsBE2ZQ@mail.gmail.com>
	<57733596-5fd6-07ec-d65c-67411411f10e@postgrespro.ru>
	<CAPmGK145252jR4fygMTtJcUA4fCoKPkbykir9p9XupT6N903fQ@mail.gmail.com>
	<05bc8819-3e53-d884-a0d0-a17ffa5febef@postgrespro.ru>
	<CAPmGK15jd6gEt_XyswQ4uEG6XVdz9DNC5uqW1KK=1A_ehLTEYw@mail.gmail.com>
	<09ff35ff-291f-d9e9-a0ed-55e6bb9732fc@postgrespro.ru>
	<CAPmGK15WWjXsyBE05vDjvi37012WTiW-j=-Y8Uo=VqPRpsbOgg@mail.gmail.com>
	<CAPmGK15ZqOfE4N0PknZMzW96DRdZOA8ih_7591JMqAZu-Nhiiw@mail.gmail.com>
	<CALNJ-vQd-bMrydDzUg5+fr9w+gTnErCADhk3KSi72_RCcKJw=Q@mail.gmail.com>
	<CAPmGK17pyQgsz9zy9T4avRNw8TY74T5-v1n0vSUgSn8tmjGgVg@mail.gmail.com>
	<CAPmGK1476Smi59cszMZM7z7oeFJ5NF9MOChmHjsF2OZ48eyg-w@mail.gmail.com>
	<CAPmGK160mQENUMOjMa03-QRR77wiZrA375tiT6KY_wP-hsNu2Q@mail.gmail.com>
	<e618cae7-b421-2e1f-d777-38946a669879@postgrespro.ru>
	<CAPmGK16aE1oO-AP_rjGLc8yf_OK_eoF1mQqsHVEzFu2WptXLMQ@mail.gmail.com>

On 10/12/22 07:56, Etsuro Fujita wrote:
> On Tue, Oct 11, 2022 at 3:06 PM Andrey Lepikhov
> <a.lepikhov@postgrespro.ru> wrote:
>> I reviewed the patch one more time. Only one question: bistate and
>> ri_FdwRoutine are strongly bounded. Maybe to add some assertion on
>> (ri_FdwRoutine XOR bistate) ? Just to prevent possible errors in future.
> 
> You mean the bistate member of CopyMultiInsertBuffer?
Yes
> 
> We do not use that member at all for foreign tables, so the patch
> avoids initializing that member in CopyMultiInsertBufferInit() when
> called for a foreign table.  So we have bistate = NULL for foreign
> tables (and bistate != NULL for plain tables), as you mentioned above.
> I think it is a good idea to add such assertions.  How about adding
> them to CopyMultiInsertBufferFlush() and
> CopyMultiInsertBufferCleanup() like the attached?  In the attached I
> updated comments a bit further as well.
Yes, quite enough.

-- 
Regards
Andrey Lepikhov
Postgres Professional






view thread (39+ messages)  latest in thread

Message-ID: <a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru>
Permalink:  ../a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru/
Also on:    postgresql.org/message-id/a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru

 · 

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: a.lepikhov@postgrespro.ru, etsuro.fujita@gmail.com, zyu@yugabyte.com, pryzby@telsasoft.com, amitlangote09@gmail.com, ashutosh.bapat.oss@gmail.com, tomas.vondra@enterprisedb.com, houzj.fnst@fujitsu.com
  Subject: Re: Fast COPY FROM based on batch insert
  In-Reply-To: <a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru>

* 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