Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uchic-00Fyc7-IY for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 09:49:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uchia-00A6nm-9n for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 09:49:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uchiZ-00A6ne-W4 for pgsql-hackers@lists.postgresql.org; Fri, 18 Jul 2025 09:49:28 +0000 Received: from mail.clear-code.com ([153.126.203.179]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uchiX-008Pp2-04 for pgsql-hackers@postgresql.org; Fri, 18 Jul 2025 09:49:28 +0000 Received: from localhost (unknown [IPv6:2404:7a80:9f01:f500:1788:74de:dc85:ea72]) by mail.clear-code.com (Postfix) with ESMTPSA id 17E6E6301BD; Fri, 18 Jul 2025 18:49:15 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.clear-code.com 17E6E6301BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clear-code.com; s=default; t=1752832155; bh=PixsQfK7r1Dc9aIaldTw+7apw7Hc4fjLQnv4cmv80bk=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=bwS23ACY+K3A+jIGlCvPK4N7mc0J1hwn46VXHExM5JjV6YhbWPjFqHYmBQZzs9iRu WC+3/LWTquzsRX9rD3p79+20TNpFKRsDXNVuNa5Z6wfE504Rwm/U6IeOkEtqmtTv2Q JlW1z9qr7dhAxVBM9W+rgZ7FeprRVzNzg6cCWcPQ= Date: Fri, 18 Jul 2025 18:49:12 +0900 (JST) Message-Id: <20250718.184912.63592412993633060.kou@clear-code.com> To: sawada.mshk@gmail.com Cc: andres@anarazel.de, michael@paquier.xyz, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us, zhjwpku@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations From: Sutou Kouhei In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 30.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 17E6E6301BD X-Rspamd-Server: mail.clear-code.com X-Spamd-Result: default: False [2.90 / 999.00]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:2518, ipnet:2404:7a80::/29, country:JP]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; FREEMAIL_CC(0.00)[anarazel.de,paquier.xyz,gmail.com,sss.pgh.pa.us,postgresql.org] X-Rspamd-Action: no action List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Thu, 17 Jul 2025 13:33:13 -0700, Masahiko Sawada wrote: >> I've not followed the development of this patch - but I continue to be >> concerned about the performance impact it has as-is and the amount of COPY >> performance improvements it forecloses. >> >> This seems to add yet another layer of indirection to a lot of hot functions >> like CopyGetData() etc. >> > > The most refactoring works have been done by commit 7717f6300 and > 2e4127b6d with a slight performance gain. At this stage, we're trying > to introduce the registration API so that extensions can provide their > callbacks to the core. Some functions required for I/O such as > CopyGetData() and CopySendEndOfRow() would be exposed but I'm not > going to add additional indirection function call layers. I think Andres is talking about any indirection not only indirection function call. In this case, "cstate->XXX" -> "cstate->edata->XXX". It's also mentioned in my e-mail. I'm not sure whether it has performance impact but it's better that we benchmark to confirm whether there is any performance impact or not with the Copy{From,To}ExecutionData approach. Thanks, -- kou