Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C955FB5DBC4 for ; Thu, 22 Sep 2011 07:00:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 00448-08 for ; Thu, 22 Sep 2011 10:00:06 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 3B896B5DC65 for ; Thu, 22 Sep 2011 07:00:06 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id p8MA0534098606 for ; Thu, 22 Sep 2011 07:00:05 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id p8M9hS01021138 for pgsql-performance@postgresql.org; Thu, 22 Sep 2011 06:43:28 -0300 (ADT) (envelope-from news) From: =?ISO-8859-1?Q?Gunnlaugur_=DE=F3r_Briem?= X-Newsgroups: pgsql.performance Subject: Re: Constraint exclusion on UNION ALL subqueries with WHERE conditions Date: Thu, 22 Sep 2011 02:43:25 -0700 (PDT) Organization: http://groups.google.com Lines: 15 Message-ID: <6377661.339.1316684605118.JavaMail.geo-discussion-forums@yqih9> References: <25440.1316404770@sss.pgh.pa.us> <12971543.2235.1316510130842.JavaMail.geo-discussion-forums@yqcd38> <25530.1316625060@sss.pgh.pa.us> Reply-To: pgsql.performance@googlegroups.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Complaints-To: groups-abuse@google.com In-Reply-To: <25530.1316625060@sss.pgh.pa.us> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=157.157.92.142; posting-account=YRSnRgoAAABkgkyuFACt4iC5RsuqV7Ez User-Agent: G2/1.0 X-Google-Web-Client: true To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.993 tagged_above=-10 required=5 tests=BAYES_05=-0.5, FREEMAIL_FROM=0.001, RP_MATCHES_RCVD=-0.504, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201109/353 X-Sequence-Number: 45129 Right, the view that prompted this involved subqueries; the function was ju= st an artificial test case. That change seems like a good one for sure. Ideally I'd like to enable it for a particular view rather than incur the p= lanning expense for the whole DB (something like ALTER VIEW foo WITH CONSTR= AINT EXCLUSION), but I guess there's no support currently (and not easily a= dded) for such per-object planner settings? The application can just issue = SET constraint_exclusion=3Don; as needed; for my case that's fine, but for = DBAs maybe a bit limiting. Regards, - Gulli