Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 29F0C1337B67 for ; Sun, 5 Dec 2010 07:23:58 -0400 (AST) 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 62090-07 for ; Sun, 5 Dec 2010 11:23:51 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id CC4281337999 for ; Sun, 5 Dec 2010 07:23:50 -0400 (AST) 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 oB5BNn9k044149 for ; Sun, 5 Dec 2010 07:23:49 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id oB5BA4hC010849 for pgsql-performance@postgresql.org; Sun, 5 Dec 2010 07:10:04 -0400 (AST) (envelope-from news) From: John Papandriopoulos X-Newsgroups: pgsql.performance Subject: Re: Query-plan for partitioned UPDATE/DELETE slow and swaps vmem compared to SELECT Date: Sun, 05 Dec 2010 03:10:04 -0800 Organization: Hub.Org Networking Services Lines: 16 Message-ID: References: <14012.1291443654@sss.pgh.pa.us> <23792.1291480923@sss.pgh.pa.us> <13159.1291502400@sss.pgh.pa.us> <4CFACC81.3050901@vmsinfo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: <4CFACC81.3050901@vmsinfo.com> To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201012/50 X-Sequence-Number: 41502 On 12/4/10 3:19 PM, Mladen Gogala wrote: > Tom Lane wrote: >> Partitioning using these techniques will work well with up to >> perhaps a hundred partitions; don't try to use many thousands of >> partitions. >> regards, tom lane > Hmmm, what happens if I need 10 years of data, in monthly partitions? It > would be 120 partitions. Can you please elaborate on that limitation? > Any plans on lifting that restriction? > Even with 1k partitions, I don't have any issues any of the SELECT, UPDATE or DELETE queries and with 8GB RAM. I suppose if you're using INSERT triggers, you'd want to make sure your plpgsql function is fast: I'm partitioning by power-of-two, so can use right-shift n-bits to quickly compute the insertion table name, rather than using an if-else-if chain. John