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 1lAfCJ-0001p1-CY for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 20:37:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAfCG-0003pJ-UI for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 20:37:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAfCG-0003oG-Ny for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 20:37:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAfCB-0001pl-DC for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 20:37:47 +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 11CKbf5F1578690; Fri, 12 Feb 2021 15:37:41 -0500 From: Tom Lane To: Alexander Lakhin cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16863: Assert failed in set_plain_rel_size() on processing ~* with a long prefix In-reply-to: <6de0a0c3-ada9-cd0c-3e4e-2fa9964b41e3@gmail.com> References: <16863-35bf75b1b5ee4032@postgresql.org> <6de0a0c3-ada9-cd0c-3e4e-2fa9964b41e3@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Fri, 12 Feb 2021 23:00:01 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1578688.1613162261.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Feb 2021 15:37:41 -0500 Message-ID: <1578689.1613162261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Lakhin writes: > I've found a division that produces NaN: > sel /=3D pow(FIXED_CHAR_SEL, fixed_prefix_len); Hmm. I'm not getting a NaN AFAICT, but I am getting pretty darn weird estimates. I agree this needs some kind of clamp. regression=3D# create table test (t text); CREATE TABLE regression=3D# explain SELECT * FROM test WHERE t ~* ('^' || repeat('-', 5= 00)); ... Seq Scan on test (cost=3D0.00..27.00 rows=3D1000000000000000015902891109= 7599180468360808563945281389781327557747838772170381060813469985856815104 = width=3D32) ... BTW, the message you're answering hasn't shown up here, nor is it in the mailing list archives. Odd. regards, tom lane