Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7D96A9FB273 for ; Tue, 30 Jan 2007 06:21:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 39905-05 for ; Tue, 30 Jan 2007 06:21:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 3530F9FA4DF for ; Tue, 30 Jan 2007 06:21:43 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.finestmedia.ee (mail.finestmedia.ee [213.180.31.2]) by svr4.postgresql.org (Postfix) with ESMTP id 649D15AFAD6 for ; Tue, 30 Jan 2007 10:21:42 +0000 (GMT) Received: from [192.168.2.19] (err.fm.sise [192.168.2.19]) by mail.finestmedia.ee (Postfix) with ESMTP id 762CD340035 for ; Tue, 30 Jan 2007 12:21:39 +0200 (EET) Message-ID: <45BF1C32.9000902@finestmedia.ee> Date: Tue, 30 Jan 2007 12:21:38 +0200 From: Rigmor Ukuhe User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Partitioning References: <106956.78868.qm@web57108.mail.re3.yahoo.com> In-Reply-To: <106956.78868.qm@web57108.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/419 X-Sequence-Number: 23020 Abu Mushayeed wrote: > I have partitioned a table based on period (e.g., cdate >= > '2007-01-01'::date and cdate<=.2007-03-31':;date). > > Now, I am issuing query like cdate >= CURRENT_DATE - 1 and cdate <= > CURRENT_DATE, it scans all the partitions. But if I do cdate >= > '2007-01-01'::date and cdate<=.2007-03-31'::date it picks the correct > partition. Also if I join the cdate field with another table, it does > not pick the correct partition. > > I would like to know if it is possible to pick the correct partition > using the above example. from http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html ..."For the same reason, "stable" functions such as CURRENT_DATE must be avoided. Joining the partition key to a column of another table will not be optimized, either."... Rigmor > > Thanks > Abu > > ------------------------------------------------------------------------ > Need Mail bonding? > Go to the Yahoo! Mail Q&A > > for great tips from Yahoo! Answers > > users. !DSPAM:5,45beea6d287779832115503! -- Rigmor Ukuhe Finestmedia Ltd | Software Development Team Manager gsm : (+372)56467729 | tel : (+372)6558043 | e-mail : rigmor.ukuhe@finestmedia.ee