Re: Duplicate WHERE condition changes performance and plan

2020-04-19 Thread Justin Pryzby
On Wed, Apr 15, 2020 at 08:55:53PM +0100, singh...@gmail.com wrote: > We have an odd issue where specifying the same where clause twice causes PG > to pick a much more efficent plan. We would like to know why. > Query B (this is the 'fast' query): > UPDATE problem_instance SET processed = false >

Re: Duplicate WHERE condition changes performance and plan

2020-04-19 Thread singh...@gmail.com
> Starting with PostgreSQL 9.6, foreign keys are also used to help with > join selectivity estimations. I see you have a suitable foreign key > from the schema you posted. You might want to add that to the list of > reasons to upgrade. Apologies for the delay in response. I've had "PostgreSQL 9.6