Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCqA6-0002AF-Pq for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Feb 2021 20:44:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCqA5-0002ov-B4 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Feb 2021 20:44:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCqA5-0002nj-4D for pgsql-hackers@lists.postgresql.org; Thu, 18 Feb 2021 20:44:33 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCqA3-0006aK-0M for pgsql-hackers@lists.postgresql.org; Thu, 18 Feb 2021 20:44:32 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 67BC25C00EB; Thu, 18 Feb 2021 15:44:29 -0500 (EST) Received: from imap2 ([10.202.2.52]) by compute5.internal (MEProxy); Thu, 18 Feb 2021 15:44:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=AA8NgMn4FzJzNISgyBEzjRTWdgXLIjR 76RhFVIMm8sw=; b=nsRiBlz5xIiY1FglJjhpcEheYwN6pnVuLq3mQsNUV0Kmb7n HTn13JRF+7RGXN4oujJ6xo16pitadVl35F6JUqWlGZ0F7yBT8oPi0vn3j8tEeob7 k8kx9MxWtQC3w/MAgxNENshOtC8v4EpEPlXvl9u5c3IYgwcxVl4ZOfM2lppt6zvb XLbgCyn50K3K8y16FX3+X1rRiremTz3f3Vgd+0TpoRDmZRJDcg79yGP0EV3Tao3B iiwMznDo57c+4JxZgaG9UsG0S0M0TnomoF1BnGLz9UGtLB/Y+ctVZ3PPc1x6hpUw kzWeW3Oxw5xEopIx4dJFZcEyMEzSzNbOZcpUktA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=AA8NgM n4FzJzNISgyBEzjRTWdgXLIjR76RhFVIMm8sw=; b=CTmQfhRCeJNyXoT4g74FcO YYFX/GHfhkPl0TCdFpOd4Lr2varl8G9K3QcZPxO2ZRRX7uS/v4LGqVMkOmsk+OcJ i99LuxZupvDXnTQXR2TUmR2dPsPk+j5RjDOvHatAhUMfaZlRngeFzyqgfAuWQi8F /kyC8J8VKxn5lRk1Qyzd4+2SRUz2ca55GoSPqMRaHSta06RwryxsCJOxFtG3xbLz 4faWzaRkzH9tEGDcnYgWeMejKUFcctNsRTwJm/ClTikC5QO8/bcpk73eNGDSI9+4 Rqt7alDH1z9s4ZLW5A3y6EdmNpuNTzzKts8ejUgHgaJS1sAoFWzSr9IAXtbm/6jA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeeggddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedflfhovghlucflrggtohgsshhonhdfuceojhhovghlsegt ohhmphhilhgvrhdrohhrgheqnecuggftrfgrthhtvghrnheptdeuudfftdefffejuddtte fhvdetheejheejieetgfduieffffefgffggedvheefnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepjhhovghlsegtohhmphhilhgvrhdrohhrgh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 27FB8A00060; Thu, 18 Feb 2021 15:44:28 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: In-Reply-To: References: <1340281.1613018383@sss.pgh.pa.us> <85140bfb-516c-449b-8a03-7930abb42b88@www.fastmail.com> <1813969.1613250697@sss.pgh.pa.us> <913516b8-c3d7-4dea-bf60-d735cf4673f1@www.fastmail.com> <2155152.1613358697@sss.pgh.pa.us> <99f6cbe0-6e58-4e41-add0-977271a5cf84@www.fastmail.com> <2752386.1613595636@sss.pgh.pa.us> <5deabab3-a335-4b57-a046-8a9ad8f2f142@www.fastmail.com> <12e6381c-adc1-4711-a619-864fb8df969c@www.fastmail.com> <2840118.1613671847@sss.pgh.pa.us> Date: Thu, 18 Feb 2021 21:44:07 +0100 From: "Joel Jacobson" To: "Tom Lane" Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Some regular-expression performance hacking Content-Type: multipart/alternative; boundary=cdbbcdd36abc47639ba1dc784ebd5c49 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --cdbbcdd36abc47639ba1dc784ebd5c49 Content-Type: text/plain On Thu, Feb 18, 2021, at 20:58, Joel Jacobson wrote: >Like you said earlier, perhaps the regex engine has been optimized enough for this time. >If not, you want to investigate an additional idea, In the above sentence, I meant "you _may_ want to". I'm not at all sure these idea are applicable in the PostgreSQL regex engine, so feel free to silently ignore these if you feel there is a risk for time waste. >that I think can be seen as a generalization of the optimization trick for (.*), >if I've understood how it works correctly. Actually not sure if it can be seen as a generalization, I just came to think of my ideas since they also improve the case when you have lots of (.*) or bracket expressions of large ranges. /Joel --cdbbcdd36abc47639ba1dc784ebd5c49 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, Fe= b 18, 2021, at 20:58, Joel Jacobson wrote:
>Like you sa= id earlier, perhaps the regex engine has been optimized enough for this = time.
>If not, you want to investigate an additional id= ea,

In the above sentence, I meant "you _ma= y_ want to".
I'm not at all sure these idea are applicable= in the PostgreSQL regex engine,
so feel free to silently = ignore these if you feel there is a risk for time waste.
<= br>
>that I think can be seen as a generalization of the op= timization trick for (.*),
>if I've understood how it w= orks correctly.

Actually not sure if it can= be seen as a generalization,
I just came to think of my i= deas since they also improve
the case when you have lots o= f (.*) or bracket expressions of large ranges.

<= div>/Joel --cdbbcdd36abc47639ba1dc784ebd5c49--