public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fabrízio de Royes Mello <[email protected]>
To: Japin Li <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Remove redundant MemoryContextSwith in BeginCopyFrom
Date: Wed, 19 Jan 2022 12:34:32 -0300
Message-ID: <CAFcNs+q+1Qgq-RCL0tGerVcihyWLWAFDL9JybNZ41cN4mjgAQQ@mail.gmail.com> (raw)
In-Reply-To: <MEYP282MB16693DDABDFEC7949AC31857B6599@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
References: <MEYP282MB16693DDABDFEC7949AC31857B6599@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>

On Wed, Jan 19, 2022 at 11:21 AM Japin Li <[email protected]> wrote:
>
>
> Hi, hackers
>
> When I read the code of COPY ... FROM ..., I find there is a redundant
> MemoryContextSwith() in BeginCopyFrom().  In BeginCopyFrom, it creates
> a COPY memory context and then switches to it, in the middle of this
> function, it switches to the oldcontext and immediately switches back to
> COPY memory context, IMO, this is redundant, and can be removed safely.
>

LGTM (it passed all regression without any issue)

--
   Fabrízio de Royes Mello         Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Remove redundant MemoryContextSwith in BeginCopyFrom
  In-Reply-To: <CAFcNs+q+1Qgq-RCL0tGerVcihyWLWAFDL9JybNZ41cN4mjgAQQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox