Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxGc0-0001CU-SF for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jan 2021 21:45:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxGbz-0002X4-KC for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jan 2021 21:44:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxGbz-0002Wx-94 for pgsql-hackers@lists.postgresql.org; Wed, 06 Jan 2021 21:44:59 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxGbv-00080h-IA for pgsql-hackers@lists.postgresql.org; Wed, 06 Jan 2021 21:44:58 +0000 Received: by mail-ed1-x52d.google.com with SMTP id j16so5837998edr.0 for ; Wed, 06 Jan 2021 13:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=COVLEksXvVwY/FpXKxkdqX8ZF354c99NX8/ssiRNAnE=; b=B6PZhd8i54P2UZcJTv1JihnoHeUZj4sxooGwkEMH1Y/hmqK8o8YeZgXi5rRDUFtvRA kx/H8ROiwLk5o+oIakA5yqpQkL2begO5GB2sBVMsNr8UxRw5YSCvleMmds4wwWXJq2nk GiYmMdnR3o28WIzt2ByPV0iT9Jorm+GMdCiM/whLkwHNjbT9UlxwBZ00qRrsa+1SS8uS gC4zWT32YJRVDCADvkHM9EL9P7uOmxJn1Ir3+2t3jsjdqxW2QYpl28B70UmQVr4smIuj MGzMxvhkMcUMuNGMwI0l2TFF9O5QilkMXEk3T3atU0avbVo9fN+02IOfluRDkvhymNg5 Rxxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=COVLEksXvVwY/FpXKxkdqX8ZF354c99NX8/ssiRNAnE=; b=Qnhaz/befRFDdUUR6+R6YAKzMcgEA90RzfmHRCdHiJkGIECYkW9nIz80fQvQqCjF9x 2d5Cdb4agKwLBpgBMuMVDk14VRA3u9ECtJG27D38HAM3khBP8Vf0OIpHmSxCgXYZ8QPn IhH4sfl92ZqOqQIMoKp05jrYEoRgLu/nDrRq2VsPIH8wgfo+hVAggwfBMqMdw8YlFhCF kU/zFuPiMvoVfzP+T7Oj2+1Oslc+pV/wAdLz+xt/NRppNoDJ4AELCSs2wO6v5QcVJOoA nzqxn3u63qZQYCblTS4S0Apzf7UMDRPnvcwzNz0yJEsD1MZlPZUhPWrUkdNBCcXIKItD U0pg== X-Gm-Message-State: AOAM533qXwXvBDJDC820K0xlrojOd1OVb1W5QuOh/vauFUPLPuX+nkYu hNdppDUAoq0RvEBX1yjhQjfg6sYN5oB619JdHnbM3ogj0IqjWQt/YcbF97lY2zCarIJaliImNb3 wu15haVhm6kYYviAXqdmaYJZMC0Pv/xyOCuff2hF07tQFH0hNNK5OVBUXxUCpRgbBLR5o31RFBC +PC9etMvegG82lBW0tlydwYM3nlZ/qOfwzQKwjRRyqODq9HJ2Rf8+AqFAKjWNY6okofUzynUVbv 5yZqmgUdxDZA3jx9/eqc5ItWMDt8tuQiQOlF4OE6/TzfXBVIJBf268D X-Google-Smtp-Source: ABdhPJwbCyTUVY8XU8QW2M2dPIBSHxRixQGQqa5izR2Jw5GAWi0W27pA1dNwCvg2eJRx7hJdYoeTNw== X-Received: by 2002:a05:6402:1102:: with SMTP id u2mr5420057edv.18.1609969493806; Wed, 06 Jan 2021 13:44:53 -0800 (PST) Received: from [10.137.0.20] (ip-86-49-249-71.net.upcbroadband.cz. [86.49.249.71]) by smtp.gmail.com with ESMTPSA id u26sm1873166edo.37.2021.01.06.13.44.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jan 2021 13:44:52 -0800 (PST) Subject: Re: [PATCH] Simple progress reporting for COPY command To: =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= , PostgreSQL Hackers References: <6e7b056e-faff-40f6-730d-3ad6d2d1b5e9@enterprisedb.com> From: Tomas Vondra Message-ID: <1562ca9b-ffb5-e5e9-0399-33db90dbe153@enterprisedb.com> Date: Wed, 6 Jan 2021 22:44:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/5/21 11:02 AM, Josef Šimánek wrote: > I'm attaching the whole patch since commitfest failed to ingest the > last incremental on CI. > Yeah, the whole patch needs to be attached for the commitfest tester to work correctly - it can't apply pieces from multiple messages, etc. Anyway, I pushed this last version of patch, after a couple more tweaks, mainly to the docs - one place used pg_stat_copy_progress, the section was not indexed properly, and so on. I see Matthias proposed to change "lines" to "tuples" - I only saw the message after pushing, but I probably wouldn't make that change anyway. The CSV docs seem to talk about lines, newlines etc. so it seems fine. If not, we can change that. One more question, though - I now realize the lines_processed ignores rows skipped because of BEFORE INSERT triggers. I wonder if that's the right thing to do? Imagine you know the number of lines in a file. You can't really use (lines_processed / total_lines) to measure progress, because that may ignore many "skipped" rows. So maybe this should be changed to count all rows. OTOH we still have bytes_processed. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company