Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 96C7B2E3C2C for ; Wed, 6 Feb 2008 19:36:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 29253-08 for ; Wed, 6 Feb 2008 19:36:44 -0400 (AST) Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 0EA532E3C2F for ; Wed, 6 Feb 2008 19:36:49 -0400 (AST) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m16NaETo022008; Wed, 6 Feb 2008 18:36:14 -0500 (EST) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m16NaDfC022003; Wed, 6 Feb 2008 18:36:13 -0500 (EST) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Wed, 6 Feb 2008 18:36:13 -0500 (EST) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Dimitri Fontaine cc: pgsql-performance@postgresql.org Subject: Re: Benchmark Data requested --- pgloader CE design ideas In-Reply-To: <200802062059.07174.dfontaine@hi-media.com> Message-ID: References: <1202150236.4252.521.camel@ebony.site> <200802061837.41911.dfontaine@hi-media.com> <200802062059.07174.dfontaine@hi-media.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/81 X-Sequence-Number: 28623 On Wed, 6 Feb 2008, Dimitri Fontaine wrote: > In fact, the -F option works by having pgloader read the given number of lines > but skip processing them, which is not at all what Greg is talking about here > I think. Yeah, that's not useful. > Greg, what would you think of a pgloader which will separate file reading > based on file size as given by stat (os.stat(file)[ST_SIZE]) and number of > threads: we split into as many pieces as section_threads section config > value. Now you're talking. Find a couple of split points that way, fine-tune the boundaries a bit so they rest on line termination points, and off you go. Don't forget that the basic principle here implies you'll never know until you're done just how many lines were really in the file. When thread#1 is running against chunk#1, it will never have any idea what line chunk#2 really started at until it reaches there, at which point it's done and that information isn't helpful anymore. You have to stop thinking in terms of lines for this splitting; all you can do is split the file into useful byte sections and then count the lines within them as you go. Anything else requires a counting scan of the file and such a sequential read is exactly what can't happen (especially not more than once), it just takes too long. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD