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 1tGpTv-001639-DN for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 01:07:40 +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 1tGpTs-002gtU-Ax for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 01:07:37 +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 1tGpTr-002gtM-8I for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 01:07:37 +0000 Received: from mail.clear-code.com ([2401:2500:102:3037:153:126:203:179]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGpTj-0003sa-24 for pgsql-hackers@postgresql.org; Fri, 29 Nov 2024 01:07:35 +0000 Received: from localhost (unknown [IPv6:2404:7a80:9f01:f500:af1b:fa00:91d6:aaa9]) by mail.clear-code.com (Postfix) with ESMTPSA id 6D0E3DE18B; Fri, 29 Nov 2024 10:07:15 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.clear-code.com 6D0E3DE18B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clear-code.com; s=default; t=1732842435; bh=ka60PMLmDmh9XWeuiLnYBFZaPnuceWU8KVbzXamncyo=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=Y0l3z4mfj2PurdNd2ayD7FZUCJrHtVhUqPw7GAXN+56ePbOSkd3AQH63K5l52sBTf Zr2QV+0bPxoQYMqdcYKsHbvCRRCQDIhaFglwBoxccax9y6macmTcej5nq2jKAZljMb 78294LLFcGz+4DpLQ3LEh7c7W3C8cL6jWHKS0mf0= Date: Fri, 29 Nov 2024 10:07:13 +0900 (JST) Message-Id: <20241129.100713.891341792145967125.kou@clear-code.com> To: zhjwpku@gmail.com Cc: sawada.mshk@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations From: Sutou Kouhei In-Reply-To: References: <20241128.151617.1631851448884958406.kou@clear-code.com> X-Mailer: Mew version 6.8 on Emacs 29.4 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:2518, ipnet:2404:7a80::/29, country:JP]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,paquier.xyz,postgresql.org]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Server: mail.clear-code.com X-Rspamd-Action: no action X-Rspamd-Queue-Id: 6D0E3DE18B 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, 28 Nov 2024 19:02:57 +0800, Junwang Zhao wrote: >> > I tested 3 branches: >> > >> > 1. the master branch >> > 2. all v26 patch sets applied >> > 3. Emitting JSON to file using COPY TO v13 patch set[1], this add some >> > if branch in CopyOneRowTo, so I was expecting this slower than master >> > >> > You can see the detailed results here[2], I can not upload files so I >> > just shared the google doc link, ping me if you can not open the link. >> > >> > [1]: https://www.postgresql.org/message-id/CACJufxH8J0uD-inukxAmd3TVwt-b-y7d7hLGSBdEdLXFGJLyDA%40mail.gmail.com >> > [2]: https://docs.google.com/spreadsheets/d/1wJPXZF4LHe34X9IU1pLG7rI9sCkSy2dEkdj7w7avTqM/edit?usp=sharing >> >> Thanks for sharing your numbers. >> >> 1. and 2. shows that there is at least no significant >> performance regression. > > Agreed. Can we focus on only 1. and 2. in this thread? >> I see the patch set of 3. and I think that the result >> (there is no performance difference between 1. and 3.) isn't >> strange. The patch set adds some if branches but they aren't >> used with "text" format at least in per row process. > > It is not used in "text" format, but it adds some assembly code > to the CopyOneRowTo function, so this will have some impact > on the cpu i cache I guess. > > There is difference between 1 and 3, 3 is always better than 1 > upto 4% improvement Can we discuss 1. and 3. in the [1] thread? (Anyway, we may want to confirm whether these numbers are reproducible or not as the first step.) > I forgot to mention that the comparisons > are in *sheet2*. Thanks. I missed it. Thanks, -- kou