Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guDtk-0002TY-PV for pgsql-performance@arkaria.postgresql.org; Thu, 14 Feb 2019 10:05:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1guDtj-0007Zq-Ha for pgsql-performance@arkaria.postgresql.org; Thu, 14 Feb 2019 10:05:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guDtj-0007RT-2C for pgsql-performance@lists.postgresql.org; Thu, 14 Feb 2019 10:05:39 +0000 Received: from mail-it1-x12a.google.com ([2607:f8b0:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guDtg-0002ME-0l for pgsql-performance@lists.postgresql.org; Thu, 14 Feb 2019 10:05:37 +0000 Received: by mail-it1-x12a.google.com with SMTP id z131so3235958itf.5 for ; Thu, 14 Feb 2019 02:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t/Scv5kT7XA03hFL++kz+5gq314orWFL/8YRiidSz6Q=; b=cCrCdExGoacfcmTKOtganqrxcizZNENtXI/4bBJDDogVo1CVDNCGEH42Y6ETuMC50Z opwZf7HS8KRRj9skCnjdnAlRX7Jpu1HTJOzH9vHUlV9EvnkW24+77CXogsU3nYgWNl0j kqrDjcO9oMU6G1sodB2IPIFQSchNbO2P1Dohv9Lbij2DFoEZw+F8bKU6gcOWX8ZGrSqp RFW/0WeCgaPYJAc35UpxhkcaMhwXUX/hrRZUBhYmB6pp0yKPOryo3VMqPRXZFgZtQ7Yq zAe5U0kwMu0x7YgtAO/3IwVavphkVfXKayaRORr44SuiwcoClL8XZU4KcqfFqmszmFNH W7iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t/Scv5kT7XA03hFL++kz+5gq314orWFL/8YRiidSz6Q=; b=JCr1gcxI2ZDLkpuEU8/37QezYDe0oeqRal7N8pNlvTPMVBVHk3KbPdGnag8Y13hbYi QYbv8G0RqWbWFdSIUW3Ba8Ik9zFfzt45zYiongq3Mn87WIFlLbIunKC38UXtZcWUuo7Z GC9oAYBwsx4FmK9h0UdoPXi3p+4vlzCyg3ybQ3EoW/HNb4XX4oitHTrbkMboVmZ0szHQ xJS0xUzpBRxFOu8gUEeeM0SYxCi1ZlmaHYLqAeCPhIhrzLIQK9n0sCqG/dFQdAOmcztD av7nRdnm6M+0jm0n7SuFvKhyMThRkoPUMJMfKt2YIoy6SNvnaq0DplJrLDgX4BnIzlUf BnfA== X-Gm-Message-State: AHQUAubvUbjtfdaX+X7AZysneNYHiJepL1FGo3t95BIMJDYyMjFliNU6 6Ii8ZDAN1QObqa2D+RfYWV2WiOY2GIw= X-Google-Smtp-Source: AHgI3IagUleAXe7gkiNd4rJlYPDyu/itvaTQCoM4gvHQmyA/5chEFNYUtxhy5p9nX3WjbFTuYHBXBg== X-Received: by 2002:a24:68d2:: with SMTP id v201mr1378703itb.112.1550138734721; Thu, 14 Feb 2019 02:05:34 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w15sm946373ita.17.2019.02.14.02.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 02:05:34 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 5F2C480140B; Thu, 14 Feb 2019 04:05:33 -0600 (CST) Date: Thu, 14 Feb 2019 04:05:33 -0600 From: Justin Pryzby To: suganthi Sekar Cc: "pgsql-performance@lists.postgresql.org" Subject: Re: constraint exclusion with ineq condition (Re: server hardware tuning.) Message-ID: <20190214100533.GA30291@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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