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 1kxXcr-0006O6-PY for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jan 2021 15:55:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxXcq-0003vV-OZ for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jan 2021 15:55:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxXcq-0003vO-DZ for pgsql-hackers@lists.postgresql.org; Thu, 07 Jan 2021 15:55:00 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxXcn-0003Vd-G5 for pgsql-hackers@lists.postgresql.org; Thu, 07 Jan 2021 15:54:59 +0000 Received: by mail-ej1-x62e.google.com with SMTP id 6so10360190ejz.5 for ; Thu, 07 Jan 2021 07:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=O6mdpzMPqC7mhzJ3ohbhKPW9fnYGttvDbTNIle8hreY=; b=XsuJ7MGVFzfwEQxdr3koM7bRG9W0jA7DDX6XD3BL5qkUGHqUKKU+e4zVRQSSnjK8oe pUspQ919yWacAt2BfkDsOsAtLGqaOeD6JhKq6nlaOWMzZ+qfAglNuVqognEqG/9ho2+8 A6RyRJudnEymR6GutA30Njia2oNidDGCi5iyXpuOIMMCM+J9vdq2fedy2OdJDOkx3j/i 24zd2zT6JeKvJFui5eJTXDNAnOc+RNnX+K3B6vtkd+Uphg8H0b/nJOBvtAjjd9ycM1cF ifpKMdPyEmqm+qv9cRRoZFvIsiZvTY1OC+Kv5csseZnzmx8l76ubFk4iofuTQrUG4dns G1VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=O6mdpzMPqC7mhzJ3ohbhKPW9fnYGttvDbTNIle8hreY=; b=Z4jfGSezqfKBD8fzQSmc8Qnk4GG17+9cgyiyYSULwU5YEje1jna+a4TnpFbtCWNiKv f/L/hZN8NEMC7nyLoAqfofikLz6bqjk3bgSEuUnqvvYZJT/1Oqpki0fyE1AYUH1qVuiK 4zIA9cP570AwgganFYmcpP8xcfDyBSitG5uHfK+J2iCCYvFN27rA9Me2bCNHbdrepwl5 pPiuTgpzC4f/vVK6tpXmCeanq8DYygTZUZNehrKu9Oy0Qs/Uq1AAlWMt5O1/o4XD1P2W SZf2YyXjQcPPwn64+AZu3bK30JMsjlE5jqYp3X1PhwAh9nT+amZ7IjvtLsO4utE5ccT6 YhCg== X-Gm-Message-State: AOAM532zkN6wRgLOclHMCtK4Yeh5l75Q94C1FyzMwV7n8A5qJ4wHtRic FOuGuf159U442t+oPpiAKUxqSlrj3/h/0aa2aWVvP6w1Ys8aljcNRdwJhuYYRd8mfEBwQc5PwfK 9frtn3wZ9eUqEZz21Zp+/WwhX3nWVL37HKKNnK8hBmKjMIbylH8spFycpJOhFBgtJ9xMUXrAGI+ JG4qhVbn0fkGXC89YZXPrc4JHa7QAZR9fWeWM9PwEGEmmgEEexBIK1LdJfJGeUGW1sI2t7fKYCh dRdrGxwtxS1/aMsRf6b2KyhbnSYVt4+Dwv/tq0E4uJvblW94jw4523y X-Google-Smtp-Source: ABdhPJy+qvwtotvpdCGfdMybPuCSe9xAiCxhhB4v+/lkQR/KwxKPaCNiPjZHLE1JMGAZgPxoS9QIXg== X-Received: by 2002:a17:906:48a:: with SMTP id f10mr6111832eja.33.1610034894313; Thu, 07 Jan 2021 07:54:54 -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 t12sm2800903edy.49.2021.01.07.07.54.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 07:54:53 -0800 (PST) Subject: Re: [PATCH] Simple progress reporting for COPY command To: =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= Cc: PostgreSQL Hackers References: <6e7b056e-faff-40f6-730d-3ad6d2d1b5e9@enterprisedb.com> <1562ca9b-ffb5-e5e9-0399-33db90dbe153@enterprisedb.com> From: Tomas Vondra Message-ID: <4c283c4b-bafe-2327-b41d-5caaa296dedf@enterprisedb.com> Date: Thu, 7 Jan 2021 16:54:51 +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/7/21 12:06 PM, Josef Šimánek wrote: > st 6. 1. 2021 v 22:44 odesílatel Tomas Vondra > napsal: >> >> 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. > > I think that should be fixed. It is called "lines_processed" not > "lines_inserted". I'll take a look. > So we may either rename the column to "lines_inserted", or tweak the code to count all processed lines. Or track both and have two columns. regarss -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company