Re: constraint exclusion with ineq condition (Re: server hardwaretuning.) - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: constraint exclusion with ineq condition (Re: server hardwaretuning.)
Date
Msg-id 20190214100533.GA30291@telsasoft.com
Whole thread Raw
In response to Re: server hardware tuning.  (suganthi Sekar <suganthi@uniphore.com>)
Responses Re: constraint exclusion with ineq condition (Re: server hardwaretuning.)
List 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


pgsql-performance by date:

Previous
From: suganthi Sekar
Date:
Subject: Re: server hardware tuning.
Next
From: suganthi Sekar
Date:
Subject: Re: constraint exclusion with ineq condition (Re: server hardwaretuning.)