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 1rSYMm-00ERsZ-5g for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jan 2024 08:12:13 +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 1rSYMl-0036MJ-8L for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jan 2024 08:12:11 +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 1rSYMj-0036MB-Lz for pgsql-hackers@lists.postgresql.org; Wed, 24 Jan 2024 08:12:10 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSYMg-003R5Z-0c for pgsql-hackers@postgresql.org; Wed, 24 Jan 2024 08:12:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 01E5B5C007C; Wed, 24 Jan 2024 03:12:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 24 Jan 2024 03:12:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706083923; x=1706170323; bh=5MZLiBlJz/ 5Ag4wvA8EgDxtLM03KMHZDI8pvSo9tfTE=; b=KXUENgAMj/YVFFrpwjlur0kYFU N6ps/H6zS8mQOW6sLszSnip77/6pJ6KQ1FC4C3ipjJkvYz28+h9hQRfshnKM/8hf E1eoUTSsiyKugg/tk8yF30CdiOckf3wBICM1YijTHcpGW+1+6Oodk53XZyzb5vFL N8vMMQjFdEEXNdETzNGmVfO5RigkLTu4VHPvpeSYNfG6Kysu9nCRlqViKoDZ6+ME 2ppxdM2DdcfoIPyb8S7vlG53LrMZP/+jOYBl5+kP2onv4c9L+4zApZmLMHzrbMGv Bde7fTFZmxbMjI7hXF5tlTjBh+7hyJXIoZsHnMIFpkuVGOoXUXGy4xO1aT8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706083923; x=1706170323; bh=5MZLiBlJz/5Ag4wvA8EgDxtLM03K MHZDI8pvSo9tfTE=; b=TaKbq3LhSLj8bA438aTe6rIDNWLhDbO0HRE6N6C3tXCL 939n8hhhbWhxCrVhuvRADg34tyI5vSD7MtkxaH0n5aKZEkncFvsLHeksK0F5RYi8 FBQBmd9nVh0Xd9E+CkMU1qqtZxLcem8D9oIyPidBFrlH5dqoFiePOBbqEjHi6MjV 5JtX1rco4k7hZukkFXe55uZgpDoalQr7gUhwL9KhpGf3wfsssf2urQNyAGofr79g w7XGFZHxmo7Kt/GUXAn4feTyTREdQSm/ACzP2NTD/UfrhrSnhRCg4aV2TsA/Rq/S HzicfHRfqeLnraDL7V26Orn7kcV281h+qVBu6+VZ8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:12:01 -0500 (EST) Date: Wed, 24 Jan 2024 17:11:49 +0900 From: Michael Paquier To: Sutou Kouhei Cc: sawada.mshk@gmail.com, zhjwpku@gmail.com, andrew@dunslane.net, nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: References: <20240111.102445.1008569098168542133.kou@clear-code.com> <20240112.144615.157925223373344229.kou@clear-code.com> <20240115.152702.2011620917962812379.kou@clear-code.com> <20240124.144936.67229716500876806.kou@clear-code.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QhkDZxO+YUYVdXfR" Content-Disposition: inline In-Reply-To: <20240124.144936.67229716500876806.kou@clear-code.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QhkDZxO+YUYVdXfR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2024 at 02:49:36PM +0900, Sutou Kouhei wrote: > For COPY TO: >=20 > 0001: This adds CopyToRoutine and use it for text/csv/binary > formats. No implementation change. This just move codes. 10M without this change: format,elapsed time (ms) text,1090.763 csv,1136.103 binary,1137.141 10M with this change: format,elapsed time (ms) text,1082.654 csv,1196.991 binary,1069.697 These numbers point out that binary is faster by 6%, csv is slower by 5%, while text stays around what looks like noise range. That's not negligible. Are these numbers reproducible? If they are, that could be a problem for anybody doing bulk-loading of large data sets. I am not sure to understand where the improvement for binary comes from by reading the patch, but perhaps perf would tell more for each format? The loss with csv could be blamed on the extra manipulations of the function pointers, likely. -- Michael --QhkDZxO+YUYVdXfR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmWwxkUACgkQnvQgOdby QH0Geg//TMxYowBZbadBzPIPzN92iWDdZFUfA32IpXt2kF6QPUESJybAvZIQucnp Lmao/l17vPPVQ/WTuZVgx6e8q3Pqz7UT1+okzKB8hwTVRYeAr4BE30h5tfR7ghgq 08FbaNi1cAPP1wksiji59mTOi/Cov975UTsMQ0kURPA9TQDaluJC97DGGRvZuLej HBZW4EnvGryBvfgtEOS7Jr4FjCMROLO7E4Qpp61P7W7duj4EO5bJiurAil1GSNmW Om+7KUhJ5OJsFzMAWZlceR7rakav/9wsTKVIKwpcbjX11CY6VXAnh+Gr9YXXZrYu JurhDV24iXAfzCo54lg0VGXuJJ2i8QjEyY0/+lfm+6lM7l6hvEBH4A/jmZgcRRAt qRrmK02vh5JCS6/2yIQIVBYwTQMnODaPo+UgR6NARyrIurCfatJqu3n6CPU6pxoq KnD3BTkdm4c+DV63Wq6t9syGd/fc6kYn7Li6694DmyTB8wfva5JpJeigaR5Qb0MK Gr4CcivT/XdE7i108VtAJFnXbLmV9LEO5DWpRuPZ/gIU8+Mze6WIQs5BybQig6sE 9alMNTehD196oFcxzQIcvuQ6Be4OuyqOWjVqJXYiONOVJg0Np+JyjQyw8XD6uyUz XZUSrXoe/DQBGMEZpCHehR9G8gvv3vtkhz3VZVZi2GMKVYhUOpk= =ZQ59 -----END PGP SIGNATURE----- --QhkDZxO+YUYVdXfR--