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 1rSqPd-00GHnu-Nc for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 03:28:22 +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 1rSqPc-00BRRq-4Z for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 03:28:20 +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 1rSqPb-00BRRi-R6 for pgsql-hackers@lists.postgresql.org; Thu, 25 Jan 2024 03:28:19 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSqPZ-003Zyb-7o for pgsql-hackers@postgresql.org; Thu, 25 Jan 2024 03:28:19 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 468B65C0185; Wed, 24 Jan 2024 22:28:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 24 Jan 2024 22:28:15 -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=1706153295; x=1706239695; bh=csfzwTWeZb O7UGFck7kLTXavvUvSji8i8KCm34BWUeQ=; b=ubnwfkYd82H3yGMbzsKblB8xlz O1aBHUCyB0R3jdDElcIvhRHlahp3GKJ61q8n/IrCLrta+eTYXyBGoL4Eq2VFbOLR 2FCMt4WrrMA1puD3lHmeuUFNLqQUf/n3z1nYpX6Bd6afMlEZU6bpTEzLSjxXEeiW KXwa71Z7y4YYLoWWuG7s9K7084suMqkt2CGdBZEDuGSUIAKPhJL9wbxQon33Ntoe aAgkRh2dRhjaDDBtPK1Y+ePg5zLSltXRyGWXkDaKusM2rAx/kmRHcSOtk8Osq6Ls +MYHlBKHTmBDRQRE6PbpY6MiPNZaCkW3qcieIFfXMNBoBILsc/7XEKq1Ckrg== 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=1706153295; x=1706239695; bh=csfzwTWeZbO7UGFck7kLTXavvUvS ji8i8KCm34BWUeQ=; b=U3tVBpYUgT+6jMsK8vzhLstJiKREryM+6D+YGC4q1UNX UZMAYokRJEC0if0gQOV1f20WQdG0VuzB+wmvn7VA55Dz+Nxe49HWBKxBUe+HTh9b 4GngOTWRmItTTegGitQcHsh5f0MZDIrb5Vt4S0Urc+OqKceSySksYFZlIl3rriDH BskpvPH+TsuNGplCsfL7sMYGyZCgJ2EEHioHabKSK/WK0wmcTLuzYx6kvMz1AFnl lQLw/7lKng6LY8fVR7U3u2BmKicj6T1B+DZa8XpupXXtk4TMvhn8qJOpcZFw0Aom mT14xc9FV8QQmlKl3WusfUF2XLPzOEjqIXVbppYRjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdelvddgheejucetufdoteggodetrfdotf 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 22:28:12 -0500 (EST) Date: Thu, 25 Jan 2024 12:28:01 +0900 From: Michael Paquier To: jian he Cc: Sutou Kouhei , andrew@dunslane.net, sawada.mshk@gmail.com, zhjwpku@gmail.com, nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: References: <20240124.144936.67229716500876806.kou@clear-code.com> <10025bac-158c-ffe7-fbec-32b42629121f@dunslane.net> <20240124.231726.1771099323950062661.kou@clear-code.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GWDsRtbSLBpVf9iB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --GWDsRtbSLBpVf9iB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 25, 2024 at 10:53:58AM +0800, jian he wrote: > apply your patch: > COPY data TO '/dev/null' WITH (FORMAT csv) \watch count=3D5 > Time: 668.996 ms > Time: 596.254 ms > Time: 592.723 ms > Time: 591.663 ms > Time: 590.803 ms >=20 > not apply your patch, at git 729439607ad210dbb446e31754e8627d7e3f7dda > COPY data TO '/dev/null' WITH (FORMAT csv) \watch count=3D5 > Time: 644.246 ms > Time: 583.075 ms > Time: 568.670 ms > Time: 569.463 ms > Time: 569.201 ms >=20 > I forgot to test other formats. There can be some variance in the tests, so you'd better run much more tests so as you can get a better idea of the mean. Discarding the N highest and lowest values also reduces slightly the effects of the noise you would get across single runs. -- Michael --GWDsRtbSLBpVf9iB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmWx1UEACgkQnvQgOdby QH2fMA//c/piEzeswjitV6jyjhTkpR+pzPPkp1FzRRa48jkJxlpP8m8syo1x0U5B /vKzVbdavozxB9CVcoDx3iFCQwwWvlzUORX973vjg2o8M5DwRJFfuzUAd4PgBz+3 7qJ017zIZcMS4h5LuMK/OK0BmcwDyfAIfv03fWyDzZtM6/TU3m3VNjb41ZbrNlMt K7QiabRXqZ7k8wVwhxomFFZLC1nZFAa0J4HrJ2n23ltzOV9Sfb/GEUW6iDFx7SM5 R2/w7A4BEV2e1O7dkuWKf7LSF8LRNxLkbxBxcA19DYONKYwkYXK+9f/g+sRsRCad O6P0n8NhFugPW5SZjolgfDgDVSUWQfc9bTTSD0vzTNCmKRK++533ulP/m935HlyK zVePML3EO20PVWj7rAnQwhB4x1TiLMrd/3Qk9wgzfstNpNmaUJauDm1bqYymjPGN S+iFoRwY3JimHyH5ZRe+Z2C/+bhMH6kvQzqMS3Mml/AIvLRfyV4ctzvj2lIXuTVH /unVKb90+sahCqHiKJAHJ/DX61fbXhvAnzELxELC72qXfUSIfrtmFJAt7/D5ycSz P8FpYGRC7MibEv7vXTT+R36/ihHiNs2NG0CU1cxDbkTNcgyIW+ZWpAjn4XFS/+1A kM6Cj+XnAmqN0O13cpg0rzNKmVlVu5rmFk8pF8pNR5W+6VryZbo= =uh78 -----END PGP SIGNATURE----- --GWDsRtbSLBpVf9iB--