pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: suganthi Sekar <suganthi@uniphore.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: constraint exclusion with ineq condition (Re: server hardware tuning.)
Date: Thu, 14 Feb 2019 04:05:33 -0600
Message-ID: <20190214100533.GA30291@telsasoft.com> (raw)
In-Reply-To: <SG2PR01MB29673BE6F7AA24424FDBFF60BC670@SG2PR01MB2967.apcprd01.prod.exchangelabs.com>
References: <SG2PR01MB29677D58E039944E76EAF4F7BC6D0@SG2PR01MB2967.apcprd01.prod.exchangelabs.com>
	<SG2PR01MB296735C008A080E986417E4EBC6D0@SG2PR01MB2967.apcprd01.prod.exchangelabs.com>
	<SG2PR01MB296746ADBB8257150C29EA7FBC6D0@SG2PR01MB2967.apcprd01.prod.exchangelabs.com>
	<SG2PR01MB29673BE6F7AA24424FDBFF60BC670@SG2PR01MB2967.apcprd01.prod.exchangelabs.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <20190214100533.GA30291@telsasoft.com>
Permalink:  ../20190214100533.GA30291@telsasoft.com/
Also on:    postgresql.org/message-id/20190214100533.GA30291@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, suganthi@uniphore.com, pgsql-performance@lists.postgresql.org
  Subject: Re: constraint exclusion with ineq condition (Re: server hardware tuning.)
  In-Reply-To: <20190214100533.GA30291@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox