Re: Speed up COPY FROM text/CSV parsing using SIMD

From: "Greg Burd" <greg(at)burd(dot)me>
To: "Nazir Bilal Yavuz" <byavuz81(at)gmail(dot)com>
Cc: "Nathan Bossart" <nathandbossart(at)gmail(dot)com>, "Manni Wood" <manni(dot)wood(at)enterprisedb(dot)com>, "KAZAR Ayoub" <ma_kazar(at)esi(dot)dz>, "Neil Conway" <neil(dot)conway(at)gmail(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Shinya Kato" <shinya11(dot)kato(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Date: 2026-03-13 17:21:38
Message-ID: b26a1cf8-335d-4054-90ad-d94457c45947@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Fri, Mar 13, 2026, at 12:14 PM, Nazir Bilal Yavuz wrote:
> Hi Greg,

Hello Nazir,

> On Fri, 13 Mar 2026 at 18:29, Greg Burd <greg(at)burd(dot)me> wrote:
>>
>> I've always been a fan of these kinds of optimization so I couldn't resist reviewing, but I know you're ready to commit so I'll just check on some systems I have. :)
>
> Thank you for the review!

Thank YOU for the work fixing this. :)

>> At first glance the implementation seems conservative, but correct and safe. Local testing on on Linux/FreeBSD x86_64, and Win11/aarch64/MSVC seem good. I also tried IllumOS/SPARCv9 and with some fixes (from another active thread) to the build system and it worked just fine too. I'm sure the 10 people care will be thrilled. ;-
>
> Yes, we can probably improve this further with heuristics, but for now
> we wanted to avoid introducing any potential regressions.
>> I also created a few tests (attached) to check boundary conditions, I might add some along with the RISC-V work.
>
> Thank you for the tests! I have checked them and the output is the
> same on both v17 and master. Do you think it would make sense to add
> them as regression tests?

If there are tests that materially add to the coverage that's a good thing to consider adding. I don't think all those tests are necessary.

best.

-greg

> --
> Regards,
> Nazir Bilal Yavuz
> Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-03-13 17:22:25 Re: Speed up COPY FROM text/CSV parsing using SIMD
Previous Message Greg Sabino Mullane 2026-03-13 17:18:09 Re: tid_blockno() and tid_offset() accessor functions