Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tlp5M-0006LH-7D for pgsql-performance@arkaria.postgresql.org; Thu, 20 Dec 2012 22:59:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tlp5L-00042G-OJ for pgsql-performance@arkaria.postgresql.org; Thu, 20 Dec 2012 22:59:27 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tlp5L-00042B-0m for pgsql-performance@postgresql.org; Thu, 20 Dec 2012 22:59:27 +0000 Received: from blu0-omc3-s32.blu0.hotmail.com ([65.55.116.107]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tlp5F-0005yu-K4 for pgsql-performance@postgresql.org; Thu, 20 Dec 2012 22:59:26 +0000 Received: from BLU002-W73 ([65.55.116.73]) by blu0-omc3-s32.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 20 Dec 2012 14:59:18 -0800 X-EIP: [rxmXZ+2n27JY/j6hCU90R/plsgqOs+QU] X-Originating-Email: [charlesrg@outlook.com] Message-ID: From: Charles Gomes To: =?iso-8859-2?B?T25kcmVqIEl2YW5p6A==?= CC: "pgsql-performance@postgresql.org" Subject: Re: Performance on Bulk Insert to Partitioned Table Date: Thu, 20 Dec 2012 17:59:18 -0500 Importance: Normal In-Reply-To: References: , Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 20 Dec 2012 22:59:18.0366 (UTC) FILETIME=[A40B7FE0:01CDDF05] X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org True, that's the same I feel, I will be looking to translate the trigger to= C if I can find good examples, that should accelerate.=20 Using rules would be totally bad as I'm partitioning daily and after one ye= ar having 365 lines of IF won't be fun to maintain. ---------------------------------------- > Date: Fri, 21 Dec 2012 09:50:49 +1100 > Subject: Re: [PERFORM] Performance on Bulk Insert to Partitioned Table > From: ondrej.ivanic@gmail.com > To: charlesrg@outlook.com > CC: pgsql-performance@postgresql.org > > Hi, > > On 21 December 2012 04:29, Charles Gomes wrote: > > When I target the MASTER table on all the inserts and let > > the trigger decide what partition to choose from it takes 4 hours. > > > > If I target the partitioned table directly during the > > insert I can get 4 times better performance. It takes 1 hour. > > Yes, that's my experience as well. Triggers are the slowest. > Performance of "DO INSTEAD" rule is close to direct inserts but rule > setup is complex (each partition needs one): > > create or replace rule _insert_ as on > insert to > where new. >=3D ... and > new. < .... > do instead > insert into _ > values (new.*) > > The best is used to direct inserts (into partition) if you can. > > -- > Ondrej Ivanic > (http://www.linkedin.com/in/ondrejivanic) > > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance=20=09=09=20=09=20=20= =20=09=09=20=20 --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance