Re: issue partition scan

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>
Cc: Christophe Pettus <xof(at)thebuild(dot)com>, Pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: issue partition scan
Date: 2021-05-26 00:16:58
Message-ID: CAApHDvq3=UjNN5wP+z6pCxhXZAbsWXOaPLUck6DZve54KH=rOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, 26 May 2021 at 11:38, Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com> wrote:
>
> Apologies, I didn't understand you completely.
>
> > 1. Those that have sub_soc.soc = 'NFWJYW0' and sub_soc.curr_ind = 'Y'
>
> > It can use constraint exclusion on these to only scan applicable partitions.
>
> > 2. Those that have (acc.acct = 'I' AND acc.acct_sub IN ( '4', '5' ) ) OR sub.ban IN ( '00','01','02','03','04','05' )
>
> > It can't use constraint exclusion on these since results can come from any partition.
>
> Why is it not using constraint exclusion on the above two conditions(1 and 2) included in the where clause ?
>
> Both sets are pointing to different tables.

It's because of the OR condition. If it was an AND condition then the
planner wouldn't have to consider the fact that records in other
partitions might be required for the join.

David

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Christophe Pettus 2021-05-26 00:27:27 Re: issue partition scan
Previous Message Nagaraj Raj 2021-05-25 23:38:04 Re: issue partition scan