Re: issue partition scan

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: issue partition scan
Дата
Msg-id CAApHDvq3=UjNN5wP+z6pCxhXZAbsWXOaPLUck6DZve54KH=rOg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: issue partition scan  (Nagaraj Raj <nagaraj.sf@yahoo.com>)
Ответы Re: issue partition scan  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-performance
On Wed, 26 May 2021 at 11:38, Nagaraj Raj <nagaraj.sf@yahoo.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



В списке pgsql-performance по дате отправления:

Предыдущее
От: Nagaraj Raj
Дата:
Сообщение: Re: issue partition scan
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: issue partition scan