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 1msXs9-0007PF-JR for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Dec 2021 22:14:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msXrc-0000Op-LS for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Dec 2021 22:14:08 +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 1msXrc-0000Oe-Bu for pgsql-hackers@lists.postgresql.org; Wed, 01 Dec 2021 22:14:08 +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 1msXrZ-0003Al-Pr for pgsql-hackers@lists.postgresql.org; Wed, 01 Dec 2021 22:14:08 +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 1B1ME33O1999383; Wed, 1 Dec 2021 17:14:03 -0500 From: Tom Lane To: Alexander Korotkov cc: PostgreSQL Hackers , Alexander Law Subject: Re: BUG #17302: gist index prevents insertion of some data In-reply-to: References: <17302-dea8025c932a92f1@postgresql.org> Comments: In-reply-to Alexander Korotkov message dated "Thu, 02 Dec 2021 01:08:27 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1999381.1638396843.1@sss.pgh.pa.us> Date: Wed, 01 Dec 2021 17:14:03 -0500 Message-ID: <1999382.1638396843@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > I think losing precision in the gist penalty is generally OK. Thus, > it shouldn't be a problem to round a very small value as zero. Check. > Probably, we could even tolerate overflow in the gist penalty. As long as overflow -> infinity, yeah I think so. Seems like it was a mistake to insert the overflow-testing functions in this code at all, and we should simplify it down to plain C addition/subtraction/ multiplication. regards, tom lane