Re: Duplicate WHERE condition changes performance and plan - Mailing list pgsql-performance

From singh400@gmail.com
Subject Re: Duplicate WHERE condition changes performance and plan
Date
Msg-id CAOtbvR+_tqYfHc1GtPkFsNkffXoecUusxDfj-FJ+o9-aOpZySg@mail.gmail.com
Whole thread Raw
In response to Re: Duplicate WHERE condition changes performance and plan  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Duplicate WHERE condition changes performance and plan
List pgsql-performance
> 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.3,
compiled by Visual C++ build 1800, 64-bit" setup at home for a while
and after importing the data across I'm still seeing the same
behaviour.

Even after upgrading my local install of PG to "PostgreSQL 12.2,
compiled by Visual C++ build 1914, 64-bit" and I'm still seeing the
same behaviour.

Plans for PG12:-
Query A: https://explain.depesz.com/s/zrVD
Query B: https://explain.depesz.com/s/ZLWe

The settings for my home setup are left at default, nothing special.

Indy



pgsql-performance by date:

Previous
From: Rick Vincent
Date:
Subject: RE: Postgres not using index on views
Next
From: Justin Pryzby
Date:
Subject: Re: Duplicate WHERE condition changes performance and plan