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 1ooMzU-0005vo-3t for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2022 10:53:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ooMzS-0005tk-VV for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2022 10:53:30 +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 1ooMzS-0005ta-Gj for pgsql-hackers@lists.postgresql.org; Fri, 28 Oct 2022 10:53:30 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ooMzP-00046r-01 for pgsql-hackers@postgresql.org; Fri, 28 Oct 2022 10:53:29 +0000 Received: from [192.168.28.53] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 5255621C5E3D; Fri, 28 Oct 2022 13:53:22 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1666954403; bh=ox/Q0Od7m33tNmjJHHf0TAx/8a5Dl/UlsVSoLnCJo1M=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=JRH4TKdX99FK+4TfwgNhiY8mUO9CnPkh4+1y31NkwALVp8mdk4MwOrZA0x2C+CbHM zOsoXJp0INfOPJCdIWTzblvUgk2q+qimM1+RVdPtwe9kapEI3rmkAVaFcC9x3i1wBv RYa818j3LyR6qFQoUKKF2xSXM/D+y3hLZ53x3Dac= Message-ID: Date: Fri, 28 Oct 2022 16:53:17 +0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: Fast COPY FROM based on batch insert To: Etsuro Fujita Cc: Zhihong Yu , Justin Pryzby , Amit Langote , tanghy.fnst@fujitsu.com, Ashutosh Bapat , Pg Hackers , Tomas Vondra , houzj.fnst@fujitsu.com References: <05bc8819-3e53-d884-a0d0-a17ffa5febef@postgrespro.ru> <09ff35ff-291f-d9e9-a0ed-55e6bb9732fc@postgrespro.ru> Content-Language: en-US From: Andrey Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 28/10/2022 16:12, Etsuro Fujita wrote: > On Thu, Oct 13, 2022 at 6:58 PM Etsuro Fujita wrote: >> I have committed the patch after tweaking comments a little bit further. > > I think there is another patch that improves performance of COPY FROM > for foreign tables using COPY FROM STDIN, but if Andrey (or anyone > else) want to work on it again, I think it would be better to create a > new CF entry for it (and start a new thread for it). So I plan to > close this in the November CF unless they think otherwise. > > Anyway, thanks for the patch, Andrey! Thanks for reviewing, Ian and Zhihong! Thanks, I studied performance of this code in comparison to bulk INSERTions. This patch seems to improve speed of insertion by about 20%. Also, this patch is very invasive. So, I don't have any plans to work on it now. -- regards, Andrey Lepikhov Postgres Professional