Re: Inaccurate Rows estimate for "Bitmap And" causes Planner to choose wrong join

2020-05-13 Thread Steve Pritchard
Many thanks Justin & Jeff for your replies. Presumbly the conditions are partially redundant, so loc_id => user_id Yes you're right. I had overlooked this. I've done some further testing and this confirms what you say: if the WHERE columns are independent, then the Planner makes a reasonable es

Re: Inaccurate Rows estimate for "Bitmap And" causes Planner to choose wrong join

2020-05-06 Thread Jeff Janes
On Wed, May 6, 2020 at 12:20 PM Steve Pritchard wrote: > Version: Postgres 9.6.3 production system (but also tested on Postgres 12) > > For my query the Planner is sometimes choosing an execution plan that uses > "Bitmap And" (depending on the parameters): > > -> Bitmap Heap Scan on observation

Re: Inaccurate Rows estimate for "Bitmap And" causes Planner to choose wrong join

2020-05-06 Thread Justin Pryzby
On Wed, May 06, 2020 at 05:19:48PM +0100, Steve Pritchard wrote: > Version: Postgres 9.6.3 production system (but also tested on Postgres 12) > > For my query the Planner is sometimes choosing an execution plan that uses > "Bitmap And" (depending on the parameters): > > The Planner then carries t