| From: | "Greg Burd" <greg(at)burd(dot)me> |
|---|---|
| To: | "Nazir Bilal Yavuz" <byavuz81(at)gmail(dot)com>, "Nathan Bossart" <nathandbossart(at)gmail(dot)com> |
| Cc: | "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-09-09 11:14:01 |
| Message-ID: | 1ed873ef-6b95-4083-88e7-b71c362a8bc4@app.fastmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Sep 9, 2026, at 6:12 AM, Nazir Bilal Yavuz wrote:
> Hi,
>
> On Tue, 8 Sept 2026 at 23:58, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>>
>> On Tue, Sep 08, 2026 at 11:58:42AM -0400, Greg Burd wrote:
>> > The test writes one full input buffer (INPUT_BUF_SIZE, 65536 bytes) down a
>> > COPY FROM PROGRAM pipe: a 65524-byte line, then a complete \. marker, then
>> > 8 trailing bytes. That leaves 11 bytes unexamined when the SIMD path wants
>> > to refill, which is under sizeof(Vector8) and already holds the whole
>> > marker. The writer then dribbles a byte every 50ms and keeps the pipe open,
>> > so a speculative load blocks rather than seeing EOF. statement_timeout
>> > bounds the failure, so a regression fails the test instead of hanging the
>> > suite. Skipped on Windows, where the blocking pipe and SIGPIPE behavior
>> > isn't reliable.
>>
>> I'm not sure this particular corner case deserves its own TAP test.
>
> I have similar feelings.
It was just a first swing at a test, and I agree with both of you it felt
heavyweight for the issue at hand. But it does capture the issue.
>> IMHO
>> that is disproportionately expensive. It really only serves to prevent us
>> from removing the backslash scan from the SIMD path, which I don't think
>> we're likely to do.
>
> I too thought it would be expensive but it wasn't on my machine; it
> took 0.5s, which is lower than I expected.
>
>
>> Furthermore, I'm not aware of any existing examples
>> where a test writes and then invokes its own Perl script, and I can't get
>> too excited about being the first to commit something like that. So, I'd
>> prefer to leave this test out for now. If the new test fit cleanly into an
>> existing suite or was less magical, I might be more eager to include it,
>> but it's probably still unlikely to be worth the energy and maintenance
>> risk.
Yeah, that's a solid judgement call. One I should have made myself.
> Perhaps we can save this Perl script as another file and invoke that
> file. This seems better to me. However, I agree that adding this test
> might be overkill given the current circumstances.
It's overkill, let's focus and get the fix in.
> --
> Regards,
> Nazir Bilal Yavuz
> Microsoft
best.
-greg
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2026-09-09 11:19:15 | Re: CLUSTER progress: wrong index_rebuild_count for tables with TOAST |
| Previous Message | Álvaro Herrera | 2026-09-09 11:02:44 | Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views |