Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D601B63355A for ; Mon, 30 Mar 2009 12:09:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20834-09 for ; Mon, 30 Mar 2009 12:09:16 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 8F61C632A1F for ; Mon, 30 Mar 2009 12:09:16 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.hub.org (Postfix) with ESMTP id 4D788125A1F2 for ; Mon, 30 Mar 2009 12:09:15 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LoJ6t-0006XT-Ot for pgsql-admin@postgresql.org; Mon, 30 Mar 2009 15:09:11 +0000 Received: from srv.protecting.net ([212.126.218.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Mar 2009 15:09:11 +0000 Received: from hari.fuchs by srv.protecting.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Mar 2009 15:09:11 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Harald Fuchs Subject: Re: Partitionin with check functions Date: Mon, 30 Mar 2009 17:08:57 +0200 Lines: 13 Message-ID: References: <20867.32524.qm@web111513.mail.gq1.yahoo.com> <2499.1238420859@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: srv.protecting.net X-Archive: encrypt User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:u626pdDl6PBUDdKr9yCoHDBZksw= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.41 tagged_above=0 required=5 tests=SUBJECT_FUZZY_TION=0.41 X-Spam-Level: X-Archive-Number: 200903/248 X-Sequence-Number: 31748 In article <2499.1238420859@sss.pgh.pa.us>, Tom Lane writes: > In particular, a constraint like "sel=123" is *not* going to lead the > planner to draw any conclusions about the value of "mod(sel,6)". > Now, if you'd written "WHERE mod(sel,6)=3", I think it would draw > the right conclusions. Yes, it does. It might be worthwile to use WHERE sel=123 AND mod(sel,6)=3 I think you could use a rule to add the mod() condition automatically.