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 1lAfXw-0002RW-A0 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 21:00:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAfXu-0002Aw-Pc for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 21:00:10 +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 1lAfXu-0002An-HT for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 21:00:10 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lAfXo-0001I5-7m for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 21:00:10 +0000 Received: by mail-lf1-x131.google.com with SMTP id p21so1333600lfu.11 for ; Fri, 12 Feb 2021 13:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=tPnHcNGoGZk7BZtw/4nyyawpdS6hAYgzcmJD+J8jW/g=; b=cB0FHos15FD2N/wNHZrFxqHYWUv6b7eXW8lMM0rAukoa1tRWfTBrLjW2Pm6OASkKl1 qmY2w+aGfsrTDQ67wqqToZxwD/H1hBd+2K0wMwHpaKXPvOsLjpsCeVE+jGfyQ3g44p0P H2a76CCm9SVxRK4rqg0GxxwF9DfeiWJ5uI/Ru8ODlDFTHn46vsMh6y5wchHkYLtHw4fH 8OObsAYN/4nFiuQZ9JUuBebJCtrVkSiI5072b6yyHt228hEEp1M7RBe2lVcjTDgwzz6U PCze7N0rXylzW0UgQNxy9fiHc4fSfuPRqDOqmhLlpDBx3p3yMzb2L2vP7h8eEhws0V9E SgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=tPnHcNGoGZk7BZtw/4nyyawpdS6hAYgzcmJD+J8jW/g=; b=bYboYj9CALYCW+czB245DtXSBiy7/CsxVfQDSbTqpT8+kPVsc04ALGqML7fCUUhu4Z iI9kGJyqkivhq4DN9J24NNisk+ws6g6X8EcsePqoxRsZQa6LM8rQlDOegnnpxrkdBuTC jd9wXWscWu4QmeDBmp1gmHmXA5Fclm/pDPf/2h8QMio02je3+TdPfor0tINE+PkGjyRB /bC9l3D/A8PJTcfvuQ+LOyPp9ffoHXuqOHt24GV4zOUCn/cvxDCOC5U8FPvRfh3OviCH /6xi8aIfMx/RSe7Y9uwBUP7JvETm3VEo+5c2f26bas4mmanoMGeL7Bar/CZrfc64Jgcb RtUw== X-Gm-Message-State: AOAM532lZmKbqpKAsc20SrNZ+gFUmBG74Fryi8nS+BsAhqpearOkfoMC 8TX3c4NbZvSObLysjvTgraY3azt+ZNA= X-Google-Smtp-Source: ABdhPJzzNvZcLiKBFa0oLlDq8/5muwvb+aopDMGPKtwREguL24wnTdtcfggbP74bqRBuomcvUQ0akQ== X-Received: by 2002:a19:ca03:: with SMTP id a3mr2431973lfg.425.1613163602067; Fri, 12 Feb 2021 13:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.6.69]) by smtp.gmail.com with ESMTPSA id n26sm977347lfl.309.2021.02.12.13.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Feb 2021 13:00:01 -0800 (PST) Subject: Re: BUG #16863: Assert failed in set_plain_rel_size() on processing ~* with a long prefix To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <16863-35bf75b1b5ee4032@postgresql.org> <6de0a0c3-ada9-cd0c-3e4e-2fa9964b41e3@gmail.com> <1578689.1613162261@sss.pgh.pa.us> From: Alexander Lakhin Message-ID: <881ff073-daac-7946-cc66-c61dcfb5efa6@gmail.com> Date: Sat, 13 Feb 2021 00:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1578689.1613162261@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Tom, 12.02.2021 23:37, Tom Lane wrote: > Alexander Lakhin writes: >> I've found a division that produces NaN: >> sel /= 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=# create table test (t text); > CREATE TABLE > regression=# explain SELECT * FROM test WHERE t ~* ('^' || repeat('-', 500)); > ... > Seq Scan on test (cost=0.00..27.00 rows=10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104 width=32) The same number I've seen on the master branch. But on REL_13_STABLE I get a NaN and then the assertion failure. (I've chosen the version 13.2 in the bug report, but it's really delayed somewhere.) Though that division produced a NaN for me on both branches. Best regards, Alexander