Re: [PATCH] Initial progress reporting for COPY command

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>, Josef Šimánek <josef.simanek@gmail.com>
Cc: pgsql-hackers@postgresql.org, Pavel Stehule <pavel.stehule@gmail.com>
Date: 2020-06-23T18:17:13Z
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



Commits

  1. Report progress of COPY commands

  2. Doc fixup for hashagg_avoid_disk_plan GUC.

  3. Fix inconsistent markups in catalogs.sgml