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 1lEcKa-0005Zm-NW for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 18:22:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEcKZ-00007p-JT for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 18:22:43 +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 1lEcKZ-00007i-Cj for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 18:22:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEcKW-0007Qm-4l for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 18:22:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11NIMZFY3877170; Tue, 23 Feb 2021 13:22:35 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Some regular-expression performance hacking In-reply-to: <20210223180535.ebgpwkyem33xtt7d@alap3.anarazel.de> References: <1340281.1613018383@sss.pgh.pa.us> <20210223173437.b3ywijygsy6q42gq@alap3.anarazel.de> <3874948.1614101949@sss.pgh.pa.us> <3875615.1614102748@sss.pgh.pa.us> <20210223180535.ebgpwkyem33xtt7d@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 23 Feb 2021 10:05:35 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3877168.1614104555.1@sss.pgh.pa.us> Date: Tue, 23 Feb 2021 13:22:35 -0500 Message-ID: <3877169.1614104555@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2021-02-23 12:52:28 -0500, Tom Lane wrote: >> ... It is annoying to have to expend >> an always-on check for a can't-happen case, though. > Wouldn't quite work like that because of the restrictions of what pg > infrastructure we want to expose the regex engine to, but a > if (depth < 0) > pg_unreachable(); > would avoid the runtime overhead and does fix the warning. Yeah, I still have dreams of someday converting the regex engine into an independent project, so I don't want to make it depend on pg_unreachable. I'll put in the low-tech fix. regards, tom lane