Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzQS6-0003Ot-Qr for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Feb 2019 18:30:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzQS4-00023X-Dp for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Feb 2019 18:30:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzQS4-00023N-6O for pgsql-hackers@lists.postgresql.org; Thu, 28 Feb 2019 18:30:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzQRo-0001QI-DS for pgsql-hackers@postgresql.org; Thu, 28 Feb 2019 18:30:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1SIUBc9020592; Thu, 28 Feb 2019 13:30:11 -0500 From: Tom Lane To: Jeff Janes cc: Thomas Kellerer , pgsql-hackers , Teodor Sigaev , Alexander Korotkov Subject: Re: Bloom index cost model seems to be wrong In-reply-to: References: <2126.1549986118@sss.pgh.pa.us> <3997.1550006243@sss.pgh.pa.us> Comments: In-reply-to Jeff Janes message dated "Thu, 28 Feb 2019 13:11:16 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20590.1551378611.1@sss.pgh.pa.us> Date: Thu, 28 Feb 2019 13:30:11 -0500 Message-ID: <20591.1551378611@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeff Janes writes: > Should we be trying to estimate the false positive rate and charging > cpu_tuple_cost and cpu_operator_cost the IO costs for visiting the table to > recheck and reject those? I don't think other index types do that, and I'm > inclined to think the burden should be on the user not to create silly > indexes that produce an overwhelming number of false positives. Heap-access costs are added on in costsize.c, not in the index cost estimator. I don't remember at the moment whether there's any explicit accounting for lossy indexes (i.e. false positives). Up to now, there haven't been cases where we could estimate the false-positive rate with any accuracy, so we may just be ignoring the effect. But if we decide to account for it, I'd rather have costsize.c continue to add on the actual cost, perhaps based on a false-positive-rate fraction returned by the index estimator. regards, tom lane