Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A4C642E0138 for ; Tue, 5 Feb 2008 10:24:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33104-05 for ; Tue, 5 Feb 2008 10:24:43 -0400 (AST) Received: from outmail136029.authsmtp.com (outmail136029.authsmtp.com [62.13.136.29]) by postgresql.org (Postfix) with ESMTP id 00C7C2E32B0 for ; Tue, 5 Feb 2008 10:24:42 -0400 (AST) Received: from outmail128180.authsmtp.com (outmail128180.authsmtp.com [62.13.128.180]) by punt3.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m15EO9fX027305; Tue, 5 Feb 2008 14:24:09 GMT Received: from [192.168.0.3] (85-211-31-42.dyn.gotadsl.co.uk [85.211.31.42]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m15EO8FT028020; Tue, 5 Feb 2008 14:24:09 GMT Subject: Re: Benchmark Data requested From: Simon Riggs To: Dimitri Fontaine Cc: pgsql-performance@postgresql.org, "Jignesh K. Shah" , Greg Smith In-Reply-To: <200802051506.51581.dfontaine@hi-media.com> References: <1202150236.4252.521.camel@ebony.site> <47A797E5.4000507@sun.com> <200802051506.51581.dfontaine@hi-media.com> Content-Type: text/plain; charset=utf-8 Date: Tue, 05 Feb 2008 14:24:55 +0000 Message-Id: <1202221496.4252.680.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 8bit X-Server-Quench: 03e8db66-d3f6-11dc-9554-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksachtFaABba1xT HGQLW1xEUVl7W2d/ awMfZQBDYEtPQQZr TkxLXVBXCwUmXB0E c2EWJH1ydQ1Gen4+ ZkdnWj5bXxFyIRR7 RFMAFjsAeGZhPDMC WUVdcx5UcAJLdhoR aVd4ByJDAzANdhEA MjUdGAoUCH11JSJe QgQEN1FabU8XF3Ym SgkfEC4zEEFt X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:787/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/30 X-Sequence-Number: 28572 On Tue, 2008-02-05 at 15:06 +0100, Dimitri Fontaine wrote: > Hi, > > Le lundi 04 février 2008, Jignesh K. Shah a écrit : > > Single stream loader of PostgreSQL takes hours to load data. (Single > > stream load... wasting all the extra cores out there) > > I wanted to work on this at the pgloader level, so CVS version of pgloader is > now able to load data in parallel, with a python thread per configured > section (1 section = 1 data file = 1 table is often the case). > Not configurable at the moment, but I plan on providing a "threads" knob which > will default to 1, and could be -1 for "as many thread as sections". That sounds great. I was just thinking of asking for that :-) I'll look at COPY FROM internals to make this faster. I'm looking at this now to refresh my memory; I already had some plans on the shelf. > > Multiple table loads ( 1 per table) spawned via script is bit better > > but hits wal problems. > > pgloader will too hit the WAL problem, but it still may have its benefits, or > at least we will soon (you can already if you take it from CVS) be able to > measure if the parallel loading at the client side is a good idea perf. wise. Should be able to reduce lock contention, but not overall WAL volume. > [...] > > I have not even started Partitioning of tables yet since with the > > current framework, you have to load the tables separately into each > > tables which means for the TPC-H data you need "extra-logic" to take > > that table data and split it into each partition child table. Not stuff > > that many people want to do by hand. > > I'm planning to add ddl-partitioning support to pgloader: > http://archives.postgresql.org/pgsql-hackers/2007-12/msg00460.php > > The basic idea is for pgloader to ask PostgreSQL about constraint_exclusion, > pg_inherits and pg_constraint and if pgloader recognize both the CHECK > expression and the datatypes involved, and if we can implement the CHECK in > python without having to resort to querying PostgreSQL, then we can run a > thread per partition, with as many COPY FROM running in parallel as there are > partition involved (when threads = -1). > > I'm not sure this will be quicker than relying on PostgreSQL trigger or rules > as used for partitioning currently, but ISTM Jignesh quoted § is just about > that. Much better than triggers and rules, but it will be hard to get it to work. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com