Re: Speed up COPY TO text/CSV parsing using SIMD - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Speed up COPY TO text/CSV parsing using SIMD
Date
Msg-id abBuKalOno33MQFw@nathan
Whole thread Raw
In response to Re: Speed up COPY TO text/CSV parsing using SIMD  (KAZAR Ayoub <ma_kazar@esi.dz>)
List pgsql-hackers
On Sat, Feb 14, 2026 at 04:02:21PM +0100, KAZAR Ayoub wrote:
> On Thu, Feb 12, 2026 at 10:25 PM Andres Freund <andres@anarazel.de> wrote:
>> 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.
> 
> [...]
> 
> 1000 columns:
> TEXT: 17% regression
> CSV: 3.4% regression
> 
> 500 columns:
> TEXT: 17.7% regression
> CSV: 3.1% regression
> 
> 100 columns:
> TEXT: 17.3% regression
> CSV: 3% regression
> 
> A bit unstable results, but yeah the overhead for worse cases like this is
> really significant, I can't argue whether this is worth it or not, so
> thoughts on this ?

I seriously doubt we'd commit something that produces a 17% regression
here.  Perhaps we should skip the SIMD paths whenever transcoding is
required.

-- 
nathan



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Change initdb default to the builtin collation provider
Next
From: Pavel Stehule
Date:
Subject: Re: Potential security risk associated with function call