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 1ww7Wd-001lAX-2m for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 00:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1ww7Wb-00D7sB-1s for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 00:17:54 +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 1ww7Wb-00D7s3-0u for pgsql-hackers@lists.postgresql.org; Tue, 18 Aug 2026 00:17:54 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1ww7Wa-000000018Ld-0mFl for pgsql-hackers@postgresql.org; Tue, 18 Aug 2026 00:17:53 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2d5335cf904so28091445ad.2 for ; Mon, 17 Aug 2026 17:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787012271; x=1787617071; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Gt+NQd+ff3rOakBE3bNIaPXKxLnoInuv6BgQ25nLqaY=; b=iOXaUzLae53IkPDATev/r8NXcMUJxGAsHc7qf4j89oeZB7kjvWZYjSGEHJzpr1mBHI FUW416EhsZD5uV0tIUv6Tz9ji8XjMjA5JsQV8wJgVWmVfmx+EG51Hfk6ymSoNctD0vPZ rc2Mreqb6A3RCFIhFDUDxliMFKtreUhzKAEvJGXR/jpUlwfoe8raxiP2s9qAGgYUj3Fm qBroqbTXjYLBNnqKiYTRUkghQ/KtTFmRjdbu/MWw17QMFWKqm2i8dKuCCfeNCSWMhIVe s3w0EOPV88ObpiW0+jgOGd+koI8v/rjLIjMCWaJzgyUuy/6pWXe4/ke6RzAq/kqdYVx1 Sqpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787012271; x=1787617071; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Gt+NQd+ff3rOakBE3bNIaPXKxLnoInuv6BgQ25nLqaY=; b=ser8GnDz/GkoTzT7H0TXw36VlLVsrVChQk0ypqpa4RU06VTcSp8zl9m36VXUL1VifS WNxdUrz0ZE6+IHeL4bwzPKDFSiOlrOSJYkTZWGQkxsl8sx2ipICNotoa6J4pY7+bRdsB eOhOmMIFS8bCDuOmqsIoOlll4KEeZsECTEB/VTlxiv3QavC1NGcAbRtRI89Holn8jxdX oRhcrwf8475X7VmDrfQwa5IZVb1yQxTvfrJ5NbgveawwsC/ftEPG9ceJqtGSgWlhSoTk QUBuVvZ7HfH1p4hp/EXrEM0yg+0+c8eh1KFtrTa/aYQ2XGYkcu3YteQEGzu3ljOqQDcj FR+Q== X-Forwarded-Encrypted: i=1; AHgh+RrIVBBeuxFKtypmoLJpZ2tfrKfq8VK5ejTdREvqdnfJvkyOw4GnxAcsNacQLggGB540UO8Hu0l335Z6Ojp1@postgresql.org X-Gm-Message-State: AOJu0YwfnRnYEtcE0tudt3wGNhTPxcCL6vKSocW/QT6Hx8pY926PAy/d fKMA357nTj/CSgxdAEwd+1W0Reu6HE5GPtyVGvfaD6emoedlQkseXRnG X-Gm-Gg: AR+sD11X+hgMl46UoCRlaBKwok8TpjJ5idPfScEjNGuKL4zypKEm2bQzYUjuJq9RNN+ cRis/M8Mo3R9JtCix5AaSIOINa2Zzl7KsVG9wnP52HaeWUZx4DQKVqFeNsCiK8Wa9tERUqDZkQ8 enxmB+8r/KTquDLY10XuLP9i1wHWN6bKIAqz5D/n4dWwSLgDdu4f7Hzm7NbHBxrPTKsWOn0e802 +YqHZkmyiwNBohcLFFr8s5wz7f/4tBF1lJ/r2o+6C4b5sQoXyi4IgiFD5zLx8khQz9HmBwgz4qN 7Qph5hBztwv848KTExLvAxSmEyJaGx7M4jD8VDVuEDKPGHBgXR0+bEoxTKkkP8ZInkGO5b7t7or OxI8Oj9duNFl1eDvw8jwRuqvafAV/QvbauhcIRjPfKv2tmF8U/it54pt6WKNlwcJWAwRhwNwmbr wOGOhXcn8ALGa2rCtdo2lbWWfy4UVjRIAO1DjPW4N5VBj4SbgOsdQ+bTiwexW4pLNIwDcadQ== X-Received: by 2002:a17:903:2a8b:b0:2d3:716e:e2ae with SMTP id d9443c01a7336-2d5c4f33c88mr47778605ad.6.1787012270928; Mon, 17 Aug 2026 17:17:50 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d5c1ecb1c1sm8873565ad.66.2026.08.17.17.17.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2026 17:17:50 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: Optimize UUID parse using SIMD From: Chao Li In-Reply-To: Date: Tue, 18 Aug 2026 08:17:15 +0800 Cc: Haibo Yan , PostgreSQL-development Content-Transfer-Encoding: 7bit Message-Id: <94F18ACE-15B6-43C4-88C4-F5DD98EDB11A@gmail.com> References: <93F6B685-C5DC-444D-A92D-0927A528C1B8@gmail.com> <5A6326C9-25EC-4D07-99C2-DA490A7BC7ED@gmail.com> To: Masahiko Sawada X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Aug 18, 2026, at 06:20, Masahiko Sawada wrote: > >>>> >>> >>> I don't think the scan can be really unbounded. string_to_uuid() >>> receives a cstring, so by the time it is called the caller has already >>> walked or copied the whole string to produce it. So unless the >>> unbounded scan can be reached in some path I have overlooked, I'd >>> prefer to keep strlen() here. Happy to change it if you still think it >>> is worth it. >> >> After more thoughts, while I still don't think the scan can be >> unbounded, using strlen() would add an extra scan just to determine we >> use hex_decode_safe(). I'll change it to use strnlen() instead. > > I've updated the patch accordingly. Please review it. > > Regards, > > -- > Masahiko Sawada > Amazon Web Services: https://aws.amazon.com > Thanks for updating the patch. V5 looks good to me. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/