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 1x4GG6-0072JQ-0o for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2026 11:14:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4GG5-00E6pI-0n for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2026 11:14:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4GG4-00E6pA-1u for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2026 11:14:28 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4GG1-00000003kRj-23bI for pgsql-hackers@postgresql.org; Wed, 09 Sep 2026 11:14:28 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 615371D000C3; Wed, 9 Sep 2026 07:14:22 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-02.internal (MEProxy); Wed, 09 Sep 2026 07:14:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding: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=fm1; t=1788952462; x=1789038862; bh=amUiOFTh383QQISwosHVLNiEEz6DGJZd8lNm3lBDdmo=; b= i5tkyyYC82yP9NelvbIXl5YXV31IiBLeBPcXKHoGNM6BA8fn1lgy+iKveZY9TrfU PJOCxtKsVyzU735y3ZklJcLBQU3XQ6dtlErPRU/9P5FIqSKgezyMkzDuWCtWBUrf p6lWp1KiH+cLHOJoKBsqWFKoxqBnywZl21ZxHF+0lulicRWXee2WFbdpiwKnuWJm UMBiRs5Gr7hMb3l5QCrYF9to4ExRt0UFBfioNaP3+GFUizTQFj/7/v4ODnP+JnRB eda1SEALP4fscL2V2Ddvj/3ezV91SLdeIRux5vYxV/DIkz1b7/2hxE31PpmqrEuX gkY7F/myNX8zU0oMpKlYjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm1; t=1788952462; x= 1789038862; bh=amUiOFTh383QQISwosHVLNiEEz6DGJZd8lNm3lBDdmo=; b=L F08T9VSa/tUw3//AYiinGBV9bvgMtqWjZYR6QPxQmufsAIjYT+xFUlSPFQD+3qCk VApazfo9Ro2p+067Tgy6r36TEYyU1V487gJgSPVGsIr0B6zplh673ISAMLPheYTU qVYx7EWZMfOjjxDBseoKk8MXBk1JIH05s4H/gxwUcEHNs4s0j7lUE/+1PvKzuh+F qkufLVuDEWNdWc/N1eKPGT/qM+Jwpk6981Jlhx3e9BBGBw+ydgk/LH3gmvrlsziY x9rdFgncz/54sIuTK/V7r8jOzLRctFPE+EV7VX5NMwTFxRrPh5kw5d/SgmXL/Qes GQm4I2VedrQqcM9RRIhlw== X-ME-Sender: X-ME-Proxy-Cause: dmFkZTF6QlODonuFImdbSOW1oyiCG20/pMGAhKbyZMq9wV01bgdlQSBSeyHQNv02t5QTBq h8NCreUD9jAfFm/Q8j69inZtbh4ojorDUpPB7Fm5lW/6/UyCuIIDWai3ieNvALcCmqcsSi lI+FdRSxx4SE8wAAxy07rZ3kSFGTzU9UwwSqdJ4ovT62uwYo0qwWGXrMK/VZiB1llPZt52 UBKTKsAvdRfiyfxrLWSp0U4E7kYfoaSM7UxEX0IO+4U2NToKztSh0+SJRE8/s/uyr/yjy/ Va7KxP1Gg72DiygLS+s2GZMiz1ZqB6PTtXbsjMzr2qE+1rShHEIpu14H3jtyVbFnQ+MOd4 jjUA1vazlwuKf2VKB/7C6PldXfmABkwQK8a+H/qLsssaQS6GXPgmudgGOydScKSIMf8E2z GtjSAqgJe91BheKPBY+M48iSW/iB/1xw7PMWsjjRik/iShA5n8Nvp5s7lob0ect2eVzWbl N8stkbqgwH9pQCQHRTmIQTpyo/lRaW6DcViOvJMHQ0ky9em2IfXlr61e0Qqq7jn1j5FvR4 /rGrmVOpm+u/1MkzXpa+PrAis9u8BRwNGn3rn0qI9JYIdVfeMY8U7hiOEtDtmdtXSHDONA ssr0BgtcG9RSVCem0+/E9Y6JmL8CNEIbUuNADMvfln3atW/xbpnel2z58Uvw X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 87761700065; Wed, 9 Sep 2026 07:14:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AQjVtvS5d0yk Date: Wed, 09 Sep 2026 07:14:01 -0400 From: "Greg Burd" To: "Nazir Bilal Yavuz" , "Nathan Bossart" Cc: "KAZAR Ayoub" , "Neil Conway" , "Andrew Dunstan" , "Shinya Kato" , pgsql-hackers Message-Id: <1ed873ef-6b95-4083-88e7-b71c362a8bc4@app.fastmail.com> In-Reply-To: References: <78e736c8-7f4e-46c2-9fcf-a6839e393d64@app.fastmail.com> <9434f7bb-5865-4828-9f23-1dd30e50aaac@app.fastmail.com> <633c2a60-e5b9-49d2-a93d-946d184d946d@app.fastmail.com> Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 9, 2026, at 6:12 AM, Nazir Bilal Yavuz wrote: > Hi, > > On Tue, 8 Sept 2026 at 23:58, Nathan Bossart 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