Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 01E299FB1CC for ; Tue, 9 Jan 2007 08:50:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 77097-06 for ; Tue, 9 Jan 2007 08:49:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 19BDB9FA4B6 for ; Tue, 9 Jan 2007 08:49:51 -0400 (AST) thread-index: Accz7Kqd979i2uSjSoiIalJGBHvGbw== Received: from [192.168.0.22] ([62.232.55.118]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 9 Jan 2007 07:49:56 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757 Content-Class: urn:content-classes:message Importance: normal Subject: Re: table partioning performance From: "Simon Riggs" To: "Steven Flatt" Cc: "Colin Taylor" , In-Reply-To: <357fa7590701081202p726c049ej61390dd1816d1369@mail.gmail.com> References: <84d3067d0701062037k3229c9ddjbde73b1fd79ee209@mail.gmail.com> <357fa7590701081202p726c049ej61390dd1816d1369@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Date: Tue, 09 Jan 2007 12:48:52 +0000 Message-ID: <1168346933.3951.276.camel@silverbirch.site> MIME-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Jan 2007 12:49:56.0453 (UTC) FILETIME=[AA395150:01C733EC] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/105 X-Sequence-Number: 22706 On Mon, 2007-01-08 at 15:02 -0500, Steven Flatt wrote: > On 1/6/07, Colin Taylor wrote: > Hi there, we've partioned a table (using 8.2) by day due to > the 50TB of data (500k row size, 100G rows) we expect to store > it in a year. > Our performance on inserts and selects against the master > table is disappointing, 10x slower (with ony 1 partition > constraint) than we get by going to the partioned table > directly. > > Are you implementing table partitioning as described at: > http://developer.postgresql.org/pgdocs/postgres/ddl-partitioning.html ? > > If yes, and if I understand your partitioning "by day" correctly, then > you have one base/master table with 366 partitions (inherited/child > tables). Do each of these partitions have check constraints and does > your master table use rules to redirect inserts to the appropriate > partition? I guess I don't understand your "only 1 partition > constraint" comment. > > We use partitioned tables extensively and we have observed linear > performance degradation on inserts as the number of rules on the > master table grows (i.e. number of rules = number of partitions). We > had to come up with a solution that didn't have a rule per partition > on the master table. Just wondering if you are observing the same > thing. If you are doing date range partitioning it should be fairly simple to load data into the latest table directly. That was the way I originally intended for it to be used. The rules approach isn't something I'd recommend as a bulk loading option and its a lot more complex anyway. > Selects shouldn't be affected in the same way, theoretically, if you > have constraint_exclusion enabled. Selects can incur parsing overhead if there are a large number of partitions. That will be proportional to the number of partitions, at present. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com