pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Seamus Abshere <seamus@abshere.net>
To: pgsql-general@postgresql.org
Subject: Too many BitmapAnds in the wild
Date: Mon, 17 Sep 2018 16:34:31 -0300
Message-ID: <1537212871.286640.1511233968.66591B19@webmail.messagingengine.com> (raw)

hey,

We see a fair number of incorrectly chosen BitmapAnd plans in the wild at Faraday... enough that googling the problem ends up at our old posts to this mailing list 😀. An attractive solution was proposed by Jeff Janes [1]

- *cost += 0.1 * cpu_operator_cost * path->rows;
+ *cost += 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%3DdTPdNzW3JD29ZsK0zJmgzO2tdcx-Q%4...
[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




view thread (2+ messages)  latest in thread

Message-ID: <1537212871.286640.1511233968.66591B19@webmail.messagingengine.com>
Permalink:  ../1537212871.286640.1511233968.66591B19@webmail.messagingengine.com/
Also on:    postgresql.org/message-id/1537212871.286640.1511233968.66591B19@webmail.messagingengine.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: seamus@abshere.net
  Subject: Re: Too many BitmapAnds in the wild
  In-Reply-To: <1537212871.286640.1511233968.66591B19@webmail.messagingengine.com>
  References: <1537212871.286640.1511233968.66591B19@webmail.messagingengine.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox