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 1vsDDP-00B8Mu-1X for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Feb 2026 05:01:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsDDN-007ujr-2W for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Feb 2026 05:01:37 +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 1vsDDN-007uio-1C for pgsql-hackers@lists.postgresql.org; Tue, 17 Feb 2026 05:01:37 +0000 Received: from mail-dy1-x1330.google.com ([2607:f8b0:4864:20::1330]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vsDDJ-000000010I9-0uEG for pgsql-hackers@postgresql.org; Tue, 17 Feb 2026 05:01:34 +0000 Received: by mail-dy1-x1330.google.com with SMTP id 5a478bee46e88-2b6b0500e06so4121616eec.1 for ; Mon, 16 Feb 2026 21:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771304492; cv=none; d=google.com; s=arc-20240605; b=lPk/AZO5rfqz4UyNta3RjX1rBsQLwKCEXZ9MUqZMMBPo+6FN0aUizp7BfBL17Uj50y G4YzubKCPBX8dSsSXkrCVU791ac0VCEUVGrunOSkAZgFjFJ2iNoPVMqERxPZOEZTPVLW YJhSXsuLTy8d88pDLawWKqxZC8bN5duMTaIchEGvcTBytasDBj4OKlNu3YLa7mOdJJcp VT6v12qf2ju9BM2p6zaOmLzbJazIAQ8Ezx8UV4558j+BAo1ESkvpklNCVC69Xzi7C8lW 4ogJXh+X/DmLxjaPwsHc/mtuwKeGREvw+HOy+26KjMCA1oje/kopRBiqIupkPp9e5q6S 177Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=x89ajivwVrM2JOHbqoC856bH6LvV7iodOaohO0zvhT4=; fh=sXFgyYxv2kYnzBHiIkd6+7crkMh6DDXXvaB3RP7E5oY=; b=e7UKgfgvh/WvvJefQKPMzNifjUYFxUF7mvi3G0qLtZzDOyzWBaKoGyQ6Fug/MEKSMX vwGjYmBNG/hDMnrm0tFrXI8TvQwVisZmP3+t7cB6KyBsF5wZFcQGOWKEy9jQmOGfY4jP uy8QrUu6FLhK7wMdmQ/cwgi1rhKiwRTXF0wdu7/FkKP+HNItx61Ts8hETY4xkkZ7mTLB 28cfA2dYrGjihQUBMWbTr3yNpFyHTFeWxkQLVHlKBwhEDheCNTfK8khE4xIsmXDpF7hz lJ+m08idVYbSQQYk37HJhfs6Lmvoklu93BXWILG84KFcKF7AY5LVggKObcchGmjjNfnU vgWg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1771304492; x=1771909292; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=x89ajivwVrM2JOHbqoC856bH6LvV7iodOaohO0zvhT4=; b=iJqFFrq6A5CNgaJyIaeNoLNBSUDtLlFx0dzf+ym9NmmV2zT2EZY4lYm06ts6VCfBVU gj81btVgNZia9NcXGhj3D3snwQu5c1/cvuOv971LRrf9IB8gqmGP6XfzsFG/13hV4ymH CdGFUkIJo4VqexjB3CxjCDtv3Y0sHcKncAN2J3RwlE17dN83N1PJ8vmd3VNUwF1To0Hs 1pBK8zPLfRMiNqaBWPx7Jdr9wY5L7Su071Ky6FPKNOWCx8M6r55PGfdVBsZUCeWhWHWy K1eoXE5Wzq9CGwkD4K0jqdeyUcgju8P1jGpDZUJjzOGK32v+/X6TlX81dyyiVCuJxi9U DaAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771304492; x=1771909292; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x89ajivwVrM2JOHbqoC856bH6LvV7iodOaohO0zvhT4=; b=vFBmWgqXACDMUoNJIwydHovEwukqQnGP7Z27dBZdqIU5qLt0mBivjp2fjP7dZyqiMF ypVVjXZv3JDbmH7uUffSlh+YAuPtrzp5fndSknKPOYs54MjIQj+/bOg3LuZeuGalOXlK x6SW2WIezm8CAFFi/xpanpGX3Dtkd1HV32xm8Gpg8zXkaYMjoCPQwzEIkO7JqU72BM7N 98Dasca0SHoUsv5SiS0EzTjM/bL8zrWw22o5ZEnDQA8sIys2hIlHXuEpkthHYoU5mmoO UTjBiEvl0hi9an9BNMslD8xPz5jbYON03TyrS0v+2QLVz6Ym+NPOVemwfTq7e9LqW/xl ZRbA== X-Forwarded-Encrypted: i=1; AJvYcCXwTroapOEwXVlSXDmEWnFGnQuEtOQDz9iPS2x37MBafBbiM2DwKPLQoIk4gc12dj2QBH7vbE6ByYhwumLv@postgresql.org X-Gm-Message-State: AOJu0YyP9ozziP0qA0//yBnKGWEJezDyl9NJ5MlYB9vCOH9CV1XVNjR2 tgqWGyYaToghHAAGeqo1PaFU14cmvl1tpkFAmsN6ru7sW3fG0XwKIG3C/3dvOZUETkm7ES0ip2+ QfWTaVAEta6ka27YEn00WwSMA3e/xJ7YDKSv4lb7V X-Gm-Gg: AZuq6aKV05ce2/HEaL0kFZ7YS8jL9tsYHcqZhwalttZOZVLl8yPIvOMwpkl+fL2jgKz D93gJmG24/trBGgR2nZKDXO+JZbUaGMVWstEoneoC7ctakqB4MqYtQujeXPCj+ebJJOHYfVqxIi Ky7ZQQoesh7Zz0frKrQBzD5xwt2JyywTKyIjdgJc7LujP7K/b9UeI2N6owmHZIerL2yc/HJcaRX jNO8j9UqRGpmURcd876C/Z2uSiJxwcKXJXjCNjzZJ+ulhnQaje/b4/8lzmBNVuFO/pl5Awr1DQl c1MhORRlwQ== X-Received: by 2002:a05:7300:1488:b0:2ba:9c19:bdab with SMTP id 5a478bee46e88-2baba0df38fmr5985506eec.28.1771304492359; Mon, 16 Feb 2026 21:01:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Manni Wood Date: Mon, 16 Feb 2026 23:01:21 -0600 X-Gm-Features: AaiRm51Z00IoRf0q4mTFe0ZqhvBhig_RGzlTNV5RiuvBkCDci8ABSI7BuQGav60 Message-ID: Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD To: Nathan Bossart Cc: Nazir Bilal Yavuz , KAZAR Ayoub , Neil Conway , Andrew Dunstan , Shinya Kato , PostgreSQL-development Content-Type: multipart/alternative; boundary="0000000000000e7f76064afdf7cc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000e7f76064afdf7cc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 16, 2026 at 12:15=E2=80=AFPM Nathan Bossart wrote: > On Mon, Feb 16, 2026 at 11:04:58AM -0600, Nathan Bossart wrote: > > On Fri, Feb 13, 2026 at 09:34:13PM -0600, Manni Wood wrote: > >> v7-0001 + v7-0002 applied to master certainly seems promising: nice to > see > >> speed improvements across the board on both x86 and arm! > > > > Thanks for testing. Based on these results, I think we can abandon 000= 2, > > at least for now. > > Have you tested small rows, i.e., less than 16 bytes per row? I'm > wondering if that regresses at all. > > -- > nathan > I ran some tests using narrow rows that look like this: $ head t_none.txt BB AA BB AA BB AA $ head t_none.csv BB,AA BB,AA BB,AA $ head t_escape.txt B\\B A\\A B\\B A\\A B\\B A\\A $ head t_quote.csv "B""B","A""A" "B""B","A""A" "B""B","A""A" Here are the results on my x86 tower and my arm raspberry pi 5: x86 NARROW master copy from TXT : 2477.022500 ms CSV : 2825.095500 ms TXT with 1/3 escapes: 2620.575000 ms CSV with 1/3 quotes: 3249.058750 ms x86 NARROW v70001 copy from TXT : 2475.659000 ms 0.055046% improvement CSV : 2421.976750 ms 14.269208% improvement TXT with 1/3 escapes: 2660.953750 ms -1.540836% regression CSV with 1/3 quotes: 3255.546750 ms -0.199689% regression x86 NARROW v70002 copy from TXT : 2481.372250 ms -0.175604% regression CSV : 2437.541250 ms 13.718271% improvement TXT with 1/3 escapes: 2646.300000 ms -0.981655% regression CSV with 1/3 quotes: 3202.014500 ms 1.447935% improvement arm NARROW master copy from TXT : 2294.270500 ms CSV : 2085.839000 ms TXT with 1/3 escapes: 2467.966000 ms CSV with 1/3 quotes: 2485.533000 ms arm NARROW v70001 copy from TXT : 1982.497500 ms 13.589200% improvement CSV : 2005.829500 ms 3.835843% improvement TXT with 1/3 escapes: 2111.778250 ms 14.432442% improvement CSV with 1/3 quotes: 2441.370000 ms 1.776802% improvement arm NARROW v70002 copy from TXT : 1975.982250 ms 13.873179% improvement CSV : 2022.744000 ms 3.024922% improvement TXT with 1/3 escapes: 2080.273000 ms 15.709009% improvement CSV with 1/3 quotes: 2476.819000 ms 0.350589% improvement Hope this helps! --=20 -- Manni Wood EDB: https://www.enterprisedb.com --0000000000000e7f76064afdf7cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Feb 16,= 2026 at 12:15=E2=80=AFPM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Mon, Feb 16, 2026 at 11:04:58AM -0= 600, Nathan Bossart wrote:
> On Fri, Feb 13, 2026 at 09:34:13PM -0600, Manni Wood wrote:
>> v7-0001 + v7-0002 applied to master certainly seems promising: nic= e to see
>> speed improvements across the board on both x86 and arm!
>
> Thanks for testing.=C2=A0 Based on these results, I think we can aband= on 0002,
> at least for now.

Have you tested small rows, i.e., less than 16 bytes per row?=C2=A0 I'm=
wondering if that regresses at all.

--
nathan

I ran some tests using= narrow rows that look like this:

$ head t_none.txt
BB =C2=A0 = =C2=A0 =C2=A0AA
BB =C2=A0 =C2=A0 =C2=A0AA
BB =C2=A0 =C2=A0 =C2=A0AA
$ head t_none.csv
BB,AA
BB,AA
BB,AA

$ head t_escape.= txt
B\\B =C2=A0 =C2=A0A\\A
B\\B =C2=A0 =C2=A0A\\A
B\\B =C2=A0 =C2= =A0A\\A

$ head t_quote.csv
"B""B","A&qu= ot;"A"
"B""B","A""A""B""B","A""A"

Here are the= results on my x86 tower and my arm raspberry pi 5:

x86 NARROW maste= r copy from
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 2477.022500 ms
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 2825.095500 ms
TXT with 1/3 escapes: 2620.575000 ms
CSV wi= th 1/3 quotes: =C2=A03249.058750 ms

x86 NARROW v70001 copy from
T= XT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2475.659000 ms= =C2=A00.055046% improvement
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 2421.976750 ms =C2=A014.269208% improvement
TXT wit= h 1/3 escapes: 2660.953750 ms =C2=A0-1.540836% regression
CSV with 1/3 q= uotes: =C2=A03255.546750 ms =C2=A0-0.199689% regression

x86 NARROW v= 70002 copy from
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 2481.372250 ms =C2=A0-0.175604% regression
CSV : =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2437.541250 ms =C2=A013.718271% i= mprovement
TXT with 1/3 escapes: 2646.300000 ms =C2=A0-0.981655% regress= ion
CSV with 1/3 quotes: =C2=A03202.014500 ms =C2=A01.447935% improvemen= t


arm NARROW master copy from
TXT : =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2294.270500 ms
CSV : =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2085.839000 ms
TXT with 1/3 escap= es: 2467.966000 ms
CSV with 1/3 quotes: =C2=A02485.533000 ms

arm = NARROW v70001 copy from
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 1982.497500 ms =C2=A013.589200% improvement
CSV : =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2005.829500 ms =C2=A03.835= 843% improvement
TXT with 1/3 escapes: 2111.778250 ms =C2=A014.432442% i= mprovement
CSV with 1/3 quotes: =C2=A02441.370000 ms =C2=A01.776802% imp= rovement

arm NARROW v70002 copy from
TXT : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1975.982250 ms =C2=A013.873179% improvem= ent
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2022.7= 44000 ms =C2=A03.024922% improvement
TXT with 1/3 escapes: 2080.273000 m= s =C2=A015.709009% improvement
CSV with 1/3 quotes: =C2=A02476.819000 ms= =C2=A00.350589% improvement

Hope this helps!<= /div>--
-- Manni Wood EDB: https://www.enterprisedb.com
--0000000000000e7f76064afdf7cc--