Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Subject: Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()
Date: 2019-05-18 00:49:47
Message-ID: 20190518004947.pcrksmbetlisz64y@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-05-18 06:14:15 +0530, Ashutosh Sharma wrote:
> On Sat, May 18, 2019 at 1:34 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> Considering that we can have MAX_BUFFERED_TUPLES slots in each multi-insert
> buffer and we do flush the buffer after MAX_BUFFERED_TUPLES tuples have
> been stored, it seems unlikely that we would ever come across a situation
> where one partition would need to reuse the slot of another partition.

I don't think this is right. Obviously it'd not be without a bit more
changes, but we definitely *should* try to reuse slots from other
partitions (including the root partition if compatible). Creating them
isn't that cheap, compared to putting slots onto a freelist for a wihle.

> Also, from a consistency point, it seems the caller doesn't need to know
> > whether all the necessary information is in the ResultRelInfo and not in
> > CopyMultiInsertInfo for *some* of the CopyMultiInsertInfo functions.
> >
> >
> I actually feel that the function name itself is not correct here, it
> appears to be confusing and inconsistent considering the kind of work that
> it is doing. I think, the function name should have been CopyMultiInsert
> *Buffer*NextFreeSlot() instead of CopyMultiInsert*Info*NextFreeSlot(). What
> do you think, Andres, David, Alvaro ?

Unless somebody else presses back hard against doing so *soon*, I'm
going to close this open issue. I don't think it's worth spending
further time arguing about a few characters.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-05-18 00:52:18 Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Previous Message Ashutosh Sharma 2019-05-18 00:44:15 Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()