Re: [PATCH] Initial progress reporting for COPY command

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: [PATCH] Initial progress reporting for COPY command
Date: 2020-06-23 18:17:13
Message-ID: 8530185d-4112-0c95-58c2-85b978752009@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/06/22 21:14, Tomas Vondra wrote:
> On Sun, Jun 21, 2020 at 01:40:34PM +0200, Josef Šimánek wrote:
>> Thanks for all comments. I have updated code to support more options
>> (including STDIN/STDOUT) and added some documentation.
>>
>> Patch is attached and can be found also at
>> https://github.com/simi/postgres/pull/5.
>>
>> Diff version: https://github.com/simi/postgres/pull/5.diff
>> Patch version: https://github.com/simi/postgres/pull/5.patch
>>
>> I'm also attaching screenshot of HTML documentation and html documentation
>> file.
>>
>> I'll do my best to get this to commitfest now.
>>
>
> I see we're not showing the total number of bytes the COPY is expected
> to process, which makes it hard to estimate how far we actually are.
> Clearly there are cases when we really don't know that (exports, import
> from stdin/program), but why not to show file size for imports from a
> file? I'd expect that to be the most common case.

+1

I like using \copy psql meta command. So I feel better if the total size
is reported even when using \copy (i.e., COPY STDIN).

As just idea, what about adding new option into COPY command,
allowing users (including \copy command) to specify the estimated size
of input file in that option, and making pg_stat_progress_copy view
display it as the total size? If we implement this mechanism, we can
change \copy command so that it calculate the actual size of input file
and specify it in that option.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-06-23 18:19:48 Re: Backpatch b61d161c14 (Introduce vacuum errcontext ...)
Previous Message Fujii Masao 2020-06-23 17:57:31 Re: [PATCH] Initial progress reporting for COPY command