Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 82855133729E for ; Fri, 1 Oct 2010 20:56:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 33470-05 for ; Fri, 1 Oct 2010 23:56:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 42A2F133655C for ; Fri, 1 Oct 2010 20:56:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o91NuHl8001550; Fri, 1 Oct 2010 19:56:17 -0400 (EDT) To: Josh Berkus cc: pgsql-performance@postgresql.org Subject: Re: Issue for partitioning with extra check constriants In-reply-to: <4CA672D7.3070405@agliodbs.com> References: <4CA672D7.3070405@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Fri, 01 Oct 2010 16:46:31 -0700" Date: Fri, 01 Oct 2010 19:56:17 -0400 Message-ID: <1548.1285977377@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/14 X-Sequence-Number: 40433 Josh Berkus writes: > The issue is this: when a partitioned table is evaluated by the planner > for constraint exclusion, it evaluates ALL check constraints on each > partition, regardless of whether or not they include a referenced column > in the query (and whether or not they relate to partitioning). [ shrug ... ] We do not promise that the current partitioning scheme scales to the number of partitions where this is likely to be an interesting concern. *After* we have a real partitioning scheme, it might be worth worrying about this sort of problem, if it's still a problem then. > Are we talking "moderate", "hard" or "nearly impossible"? We're talking "wasted effort on a dead-end situation". The time that would go into this would be much better spent on real partitioning. regards, tom lane