Re: constraint exclusion with ineq condition (Re: server hardware tuning.)

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: suganthi Sekar <suganthi(at)uniphore(dot)com>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: constraint exclusion with ineq condition (Re: server hardware tuning.)
Date: 2019-02-14 10:05:33
Message-ID: 20190214100533.GA30291@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Feb 14, 2019 at 09:38:52AM +0000, suganthi Sekar wrote:
> i am using Postgresql 11, i have 2 partition table , when i joined both table in query
> a table its goes exact partition table , but other table scan all partition
>
> please clarify on this .
>
> Example :
>
> explain analyze
> select * from call_report1 as a inner join call_report2 as b on a.call_id=b.call_id
> where a.call_created_date ='2017-11-01' and '2017-11-30'

Looks like this query waas manally editted and should say:
> where a.call_created_date >='2017-11-01' AND a.call_created_date<'2017-11-30'
Right?

The issue is described well here:
https://www.postgresql.org/message-id/flat/7DF51702-0F6A-4571-80BB-188AAEF260DA%40gmail.com
https://www.postgresql.org/message-id/499.1496696552%40sss.pgh.pa.us

You can work around it by specifying the same condition on b.call_created_date:
> AND b.call_created_date >='2017-11-01' AND b.call_created_date<'2017-11-30'

Justin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message suganthi Sekar 2019-02-14 10:38:36 Re: constraint exclusion with ineq condition (Re: server hardware tuning.)
Previous Message suganthi Sekar 2019-02-14 09:38:52 Re: server hardware tuning.