Re: [PATCH] Simple progress reporting for COPY command

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Simple progress reporting for COPY command
Date: 2021-01-06 01:04:56
Message-ID: CAEze2WieBKh61QL=r-3DQrcdH0KgAdZfL=QUhkzqyTgrxm6qKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 1 Jan 2021 at 02:25, Josef Šimánek <josef(dot)simanek(at)gmail(dot)com> wrote:
>
> Hello,
>
> finally I had some time to revisit patch and all comments from
>
https://www.postgresql.org/message-id/CAFp7QwqMGEi4OyyaLEK9DR0%2BE%2BoK3UtA4bEjDVCa4bNkwUY2PQ%40mail.gmail.com
> and I have prepared simple version of COPY command progress reporting.

+1

> To keep the patch small as possible, I have introduced only a minimum
> set of columns. It could be extended later if needed.

Seems reasonable. One potential extention I could think of is progress
reporting of tuples processed before/after applying the COPY's WHERE
clause, when and where applicable.

> Columns are inspired by CREATE INDEX progress report system view.
>
> pid - integer - PID of backend
> datid - oid - OID of related database
> datname - name - name of related database (this seems redundant, since
> oid should be enough, but it is the same in CREATE INDEX)
> relid - oid - oid of table related to COPY command, when not known
> (for example when copying to file, it is 0)
> bytes_processed - bigint - amount of bytes processed
> bytes_total - bigint - file size in bytes if COPY FROM file (0 if not
> COPY FROM file)
> lines_processed - bigint - amount of tuples processed

Could you update the name of this column to be consistent with the
'tuples'-terminology used in the other progress reporting views, i.e.
lines_processed -> tuples_processed? That adds consistency, and also
disambiguates the meaning in case of e.g. COPY FROM (format CSV), as
multiline CSV fields do exist, and we're not necessarily counting lines
from or to a file.

With regards,

Matthias van de Meent

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-01-06 01:37:23 Re: doc review for v14
Previous Message Bruce Momjian 2021-01-06 00:57:48 Re: Context diffs