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 1gtaCM-0002eY-Is for pgsql-performance@arkaria.postgresql.org; Tue, 12 Feb 2019 15:42:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtaCK-0005v8-N2 for pgsql-performance@arkaria.postgresql.org; Tue, 12 Feb 2019 15:42:12 +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 1gtaCK-0005uw-Fa for pgsql-performance@lists.postgresql.org; Tue, 12 Feb 2019 15:42:12 +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 1gtaCE-0006Q8-1Q for pgsql-performance@lists.postgresql.org; Tue, 12 Feb 2019 15:42:12 +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 x1CFfxed002127; Tue, 12 Feb 2019 10:41:59 -0500 From: Tom Lane To: Thomas Kellerer cc: pgsql-performance@lists.postgresql.org Subject: Re: Bloom index cost model seems to be wrong In-reply-to: References: Comments: In-reply-to Thomas Kellerer message dated "Tue, 12 Feb 2019 16:08:25 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2125.1549986118.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 12 Feb 2019 10:41:58 -0500 Message-ID: <2126.1549986118@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Kellerer writes: > The bloom index is only used if either Seq Scan is disabled or if the ra= ndom_page_cost is set to 1 (anything about 1 triggers a Seq Scan on my Win= dows laptop). = Hm. blcostestimate is using the default cost calculation, except for /* We have to visit all index tuples anyway */ costs.numIndexTuples =3D index->tuples; which essentially tells genericcostestimate to assume that every index tuple will be visited. This obviously is going to increase the cost estimate; maybe there's something wrong with that? I notice that the bloom regression test script is only testing queries where it forces the choice of plan type, so it really doesn't prove anything about whether the cost estimates are sane. regards, tom lane