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.96) (envelope-from ) id 1vqeCA-00F5Bp-31 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 21:25:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqeCA-00BOlS-0j for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 21:25:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqeC9-00BOlI-0c for pgsql-hackers@lists.postgresql.org; Thu, 12 Feb 2026 21:25:54 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vqeC7-00000000LZZ-1aKX for pgsql-hackers@postgresql.org; Thu, 12 Feb 2026 21:25:53 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 386D67A0116; Thu, 12 Feb 2026 16:25:51 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Thu, 12 Feb 2026 16:25:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=1770931550; x=1771017950; bh=oW+VzMnXNK isDbGvm9f8Jd1x8D8pYQk19VqOc9YZXV8=; b=CTZiYOUsrCuSLAq5zSB04zHIj4 aQCW+Vz5BGu+QU7un7UM//JdhgZbhLWhRRwfd+O33hLEXLHF7sBX02C+tTlNBqGy iF9bd4KIelDdpxrE1Jw3h0O4p9TORpJC7V4M+nxlEaVsOFRoe7OKA7IN/y7JvZSC zK0x44vrQ6oDDd/F+iizppmKJug3sc6QUPsfW0RoY7Tl6mMdWhjNnLDrT9C0PrCJ t1ZZBfCbFyr4SCNrmS2P5EoB/vPdE1JstlKQqkzoUPtLu0ZA25Fl2z44DBK9VSQc zxXHcb/sbswpq3FtKXyb1K0LjDUjC1s6LNkYVA5gaWEtg3FoCvy2PREP/O4g== 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-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1770931550; x=1771017950; bh=oW+VzMnXNKisDbGvm9f8Jd1x8D8pYQk19Vq Oc9YZXV8=; b=YO7Ssz2mM4mrfQk6exHEqZFCC598FQG/BB6n7H9rg49salmeCZ2 Rl1xOPQj+AHA85p7i3CqJUO0f2VEht+RBuMbyzTL9EpB8/zXaSPC8kQCpqck2+31 xH9SFLnBrRNhLYRy/ybNX/Is1ezICU4DLBlCPRDxBwgUZYXL6npoh80IAW9wHdBw aDpMqQygrFkFgIhTbrjym18Sh13CgAbChdllT+JWpVbonq4OsyoIfOCSLyiDqJU9 4SGZGX6AdI5eOIAj1LBBww1dF6bhEjKAy8/031pYFFJgdb/zyxPLPIhtAodCpe+b H/kxrVyPAjdBhstL0G1HcP1oIDO8EhxYsCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvtdeigeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetveduieet tddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeelpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrnhgurhgvfiesughunhhslhgrnhgvrdhnvghtpd hrtghpthhtohepmhgrnhhnihdrfihoohgusegvnhhtvghrphhrihhsvggusgdrtghomhdp rhgtphhtthhopehmrggpkhgriigrrhesvghsihdrugiipdhrtghpthhtohepsgihrghvuh iikedusehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgrrhhkfihkmhesghhmrghilhdr tghomhdprhgtphhtthhopehnrghthhgrnhgusghoshhsrghrthesghhmrghilhdrtghomh dprhgtphhtthhopehnvghilhdrtghonhifrgihsehgmhgrihhlrdgtohhmpdhrtghpthht ohepshhhihhnhigruddurdhkrghtohesghhmrghilhdrtghomhdprhgtphhtthhopehpgh hsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Feb 2026 16:25:50 -0500 (EST) Date: Thu, 12 Feb 2026 16:25:49 -0500 From: Andres Freund To: KAZAR Ayoub Cc: Pg Hackers , Nathan Bossart , Neil Conway , Manni Wood , Andrew Dunstan , Shinya Kato , Mark Wong , Nazir Bilal Yavuz Subject: Re: Speed up COPY TO text/CSV parsing using SIMD Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-02-12 22:07:52 +0100, KAZAR Ayoub wrote: > Currently optimizing COPY FROM using SIMD is still under review, but for > the case of COPY TO using the same ideas, we found that the problem is > trivial, the attached patch gives very nice speedups as confirmed by > Manni's benchmarks. I have a hard time believing that adding a strlen() to the handling of a short column won't be a measurable overhead with lots of short attributes. Particularly because the patch afaict will call it repeatedly if there are any to-be-escaped characters. I also don't think it's good how much code this repeats. I think you'd have to start with preparatory moving the exiting code into static inline helper functions and then introduce SIMD into those. Greetings, Andres Freund