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 1gv85E-0006Gl-Nx for pgsql-performance@arkaria.postgresql.org; Sat, 16 Feb 2019 22:05:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gv84F-00074t-6v for pgsql-performance@arkaria.postgresql.org; Sat, 16 Feb 2019 22:04:15 +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 1gv84E-0006zz-NP for pgsql-performance@lists.postgresql.org; Sat, 16 Feb 2019 22:04:15 +0000 Received: from mail-it1-x141.google.com ([2607:f8b0:4864:20::141]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gv84B-0004xI-7l for pgsql-performance@lists.postgresql.org; Sat, 16 Feb 2019 22:04:13 +0000 Received: by mail-it1-x141.google.com with SMTP id y184so32690843itc.1 for ; Sat, 16 Feb 2019 14:04:10 -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=1/HjJxCeGh/6PJHEhp7oxLShK0lb2GchXPJ1/jg50Gg=; b=DtctmLGzCYUIYMrbWxYo8ilvYI0fvwhG+/UnTlQvf/XH95jDTiWjLuaeZYE9XqIWgf ocbNwmciirLFsLyP8QWccGirReS5pFsHylrmpztdAfM/AxvcFjqDdOBFMYESnoAR4LSq ZxyLsHIpMZFpLm7FAvYrIAx9IaB18LEM7qhqFRsMVjhVA+1+qj4wcjhdble/CAS/HJbN CMMFHQUUctvibUBlTs/LuK9v6XWtH5xXEWMWgRThO/lF3IQziDbR9jUiSc68BLKQ1Oia txB8xcD7iMSUinbfVexcgjeSpl14n78X1z93E9jyCMdmAmE8r4u9mWqJrmuk6BWEUuhK yLvg== 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=1/HjJxCeGh/6PJHEhp7oxLShK0lb2GchXPJ1/jg50Gg=; b=EKU8ef5A56CsU2Gqi1h3N7BTabPX94Zghwnko6sNmtmACg0LWd7zlUI+gy9T9b14Tp 77Za78HpV1W/rSHkdHu3ZjBBLt+xueM+k6GuGYZtGP3kwhfMXWsVzLQzcx+d/C0lVWpu rOqsUYmrL/kvIhpjRMgc+8jKRuCmOhHijHBPlHT89XjzKzlPvPyqcRce7vBROCcTFXmd 4y47+bTi2G3I7JjrcBllbGAAe9LRWGY/d4+kpBAdxBggiNvYdPpKKjt2gmECCfGiLToJ RNkHWIU3/2g+r2YbUBIhX+oXahHrOP9AVFzmYBlhVj1c204UO0cw2/pBzpVftfGFL6Il aZFw== X-Gm-Message-State: AHQUAuavy2YWYe/niDqhVMBXzLxldCsEH72GdZd936ZbCzROBdNmeGR2 ZMpMOoXH2E1q6KGzO8QMdcu7tw== X-Google-Smtp-Source: AHgI3IaQtU16EdRWXJnJgWWOPjJZBP4LMuaXSBBjq6sc4azNzfcsWp8/ybW/q8kYBVXuYOr3JGTquQ== X-Received: by 2002:a24:5c47:: with SMTP id q68mr8207336itb.35.1550354649981; Sat, 16 Feb 2019 14:04:09 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id i135sm4534703iti.34.2019.02.16.14.04.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 14:04:08 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id BE409800969; Sat, 16 Feb 2019 16:04:06 -0600 (CST) Date: Sat, 16 Feb 2019 16:04:06 -0600 From: Justin Pryzby To: Benedict Holland Cc: suganthi Sekar , Michael Lewis , "pgsql-performance@lists.postgresql.org" Subject: Re: constraint exclusion with ineq condition (Re: server hardware tuning.) Message-ID: <20190216220406.GA26865@telsasoft.com> References: <20190214100533.GA30291@telsasoft.com> <20190214104001.GB30291@telsasoft.com> 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 Fri, Feb 15, 2019 at 12:24:18PM -0500, Benedict Holland wrote: > That sounds like a perfect task for a view if the joins are all the same. But note that either the view itself needs to have both where clauses (with hardcoded dates?), or otherwise the view needs to be on only one table, and the toplevel query needs to have where clause on each view, or else one of the tables won't get constraint exclusion. On Fri, Feb 15, 2019 at 9:36 AM suganthi Sekar wrote: > > yes i accept , but when i will do for existing tables, i am facing issue. > > > > I have created 100 Function , all the function having five table join(*now > > all partition by date*) , now its not possible to change where condition > > in all 100 Function. > > > > so that i am trying any other possibilities are there. > > From: Justin Pryzby > > > Sent: 14 February 2019 16:10:01 > > To: suganthi Sekar > > Cc: pgsql-performance@lists.postgresql.org > pgsql-performance@lists.postgresql.org> > > Subject: Re: constraint exclusion with ineq condition (Re: server hardware > > tuning.) > > > > On Thu, Feb 14, 2019 at 10:38:36AM +0000, suganthi Sekar wrote: > > > u mean the below parameter need to set on . its already on only. > > > alter system set constraint_exclusion to 'on'; > > > > No, I said: > > > 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 Pryzby System Administrator Telsasoft +1-952-707-8581