Too many BitmapAnds in the wild - Mailing list pgsql-general

From Seamus Abshere
Subject Too many BitmapAnds in the wild
Date
Msg-id 1537212871.286640.1511233968.66591B19@webmail.messagingengine.com
Whole thread Raw
Responses Re: Too many BitmapAnds in the wild  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
hey,

We see a fair number of incorrectly chosen BitmapAnd plans in the wild at Faraday... enough that googling the problem
endsup 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,
then0.1 must be _way_ too low? 

Thanks,
Seamus


[1]
https://www.postgresql.org/message-id/flat/CAMkU%3D1yV7WQLetrCVPqn%3DdTPdNzW3JD29ZsK0zJmgzO2tdcx-Q%40mail.gmail.com#aa3b3316cbe44fb3fd913ce019a86bb8
[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


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Why is JSONB field automatically cast as TEXT?
Next
From: marcelo
Date:
Subject: Re: Logical locking beyond pg_advisory