Re: Remove redundant MemoryContextSwith in BeginCopyFrom

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove redundant MemoryContextSwith in BeginCopyFrom
Date: 2022-01-19 15:34:32
Message-ID: CAFcNs+q+1Qgq-RCL0tGerVcihyWLWAFDL9JybNZ41cN4mjgAQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 19, 2022 at 11:21 AM Japin Li <japinli(at)hotmail(dot)com> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-01-19 15:35:09 Re: Remove redundant MemoryContextSwith in BeginCopyFrom
Previous Message Tom Lane 2022-01-19 14:57:39 Re: New developer papercut - Makefile references INSTALL