Re: Take skip header out of a loop in COPY FROM

From: Adam Lee <ali(at)pivotal(dot)io>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Surafel Temesgen <surafel3000(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Take skip header out of a loop in COPY FROM
Date: 2019-08-22 09:54:47
Message-ID: 20190822095447.GA57367@mars.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 22, 2019 at 11:48:31AM +0300, Heikki Linnakangas wrote:
> On 22/08/2019 11:31, Surafel Temesgen wrote:
> > Hello,
> >
> > Even if skipping header is done only once its checked and skipped in a
> > loop. If I don’t miss something it can be done out side a loop like
> > attached patch
>
> You may be on to something, but if we move it to CopyFrom(), as in your
> patch, then it won't get executed e.g. from the calls in file_fdw. file_fdw
> calls BeginCopyFrom(), followed by NextCopyFrom(); it doesn't use
> CopyFrom().
>
> - Heikki

Yes.

My next thought is to call unlikely() here, but we don't have it...
https://www.postgresql.org/message-id/CABRT9RC-AUuQL6txxsoOkLxjK1iTpyexpbizRF4Zxny1GXASGg%40mail.gmail.com

--
Adam Lee

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-08-22 10:04:14 Re: Take skip header out of a loop in COPY FROM
Previous Message movead.li@highgo.ca 2019-08-22 09:46:38 Email to hackers for test coverage