Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1zIZ-0004mL-CT for pgsql-general@arkaria.postgresql.org; Mon, 17 Sep 2018 19:35:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g1zIW-0007mi-VG for pgsql-general@arkaria.postgresql.org; Mon, 17 Sep 2018 19:35:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1zI5-0005ff-HK for pgsql-general@lists.postgresql.org; Mon, 17 Sep 2018 19:34:37 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1zI1-0003iG-0P for pgsql-general@postgresql.org; Mon, 17 Sep 2018 19:34:35 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 19D932225D for ; Mon, 17 Sep 2018 15:34:32 -0400 (EDT) Received: from web2 ([10.202.2.212]) by compute2.internal (MEProxy); Mon, 17 Sep 2018 15:34:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=38zmjYZsKpRu8bgfzEcdV728lXCnB vGHm7xvK570qpo=; b=JEFxQJaKAxbSrCLJhocy6XwHK4U9nEUu6KCYJGBCI6csl 49ONuR2CTaNA1NG1RkN9NyBxfHDV/4fQNdzosuvZlr7C5dAujMAnGU7jeKmx1bfR uzSrXzKevb9VLM+Wl+sncCL6AE4fNGlBZKHMmdAMuAmGEyLq2FFNhiMORc/1LwdN T2qTBE/SlNltptTbzsMndWPGENMMQH5mnldhiTmIz+dtO9iFmSQI74MWDvsgIgC4 ffSFBgeJp3/oJnllqqHFQIsxiT/yiRoxtvRLQXAeWdWUqPyn7WEXgS2O2KWbWREz jxEvj3XpZpt4UUgEnrVtjC9Prv6dnyU7E4Ps01+PQ== X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 8A850621F6; Mon, 17 Sep 2018 15:34:31 -0400 (EDT) Message-Id: <1537212871.286640.1511233968.66591B19@webmail.messagingengine.com> From: Seamus Abshere To: pgsql-general@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-e556cd15 Date: Mon, 17 Sep 2018 16:34:31 -0300 Subject: Too many BitmapAnds in the wild List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk hey, We see a fair number of incorrectly chosen BitmapAnd plans in the wild at F= araday... enough that googling the problem ends up at our old posts to this= mailing list =F0=9F=98=80. An attractive solution was proposed by Jeff Jan= es [1] - *cost +=3D 0.1 * cpu_operator_cost * path->rows; + *cost +=3D 6 * cpu_operator_cost * path->rows; It appears this constant hasn't been changed for 7 years [2]. Is there any reason not to at least adjust this up by a factor of 2? 10? If= Jeff is right and 6 is closer to ideal, then 0.1 must be _way_ too low? Thanks, Seamus [1] https://www.postgresql.org/message-id/flat/CAMkU%3D1yV7WQLetrCVPqn%3DdT= PdNzW3JD29ZsK0zJmgzO2tdcx-Q%40mail.gmail.com#aa3b3316cbe44fb3fd913ce019a86b= b8 [2] https://github.com/postgres/postgres/blame/master/src/backend/optimizer= /path/costsize.c#L1056 -- Seamus Abshere, SCEA +598 9954 9954 https://www.faraday.io https://github.com/seamusabshere https://linkedin.com/in/seamusabshere