Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9B8462E2E55 for ; Thu, 7 Feb 2008 13:06:46 -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 75472-02 for ; Thu, 7 Feb 2008 13:06:44 -0400 (AST) Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 60B6D2E2DD2 for ; Thu, 7 Feb 2008 13:06:43 -0400 (AST) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m17H6gR3001618 for ; Thu, 7 Feb 2008 12:06:42 -0500 (EST) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m17H6gXO001615 for ; Thu, 7 Feb 2008 12:06:42 -0500 (EST) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Thu, 7 Feb 2008 12:06:42 -0500 (EST) From: Greg Smith X-X-Sender: gsmith@westnet.com To: pgsql-performance@postgresql.org Subject: Re: Benchmark Data requested --- pgloader CE design ideas In-Reply-To: <200802071031.50121.dfontaine@hi-media.com> Message-ID: References: <1202150236.4252.521.camel@ebony.site> <200802062059.07174.dfontaine@hi-media.com> <200802071031.50121.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/84 X-Sequence-Number: 28626 On Thu, 7 Feb 2008, Dimitri Fontaine wrote: > I was thinking of not even reading the file content from the controller > thread, just decide splitting points in bytes (0..ST_SIZE/4 - > ST_SIZE/4+1..2*ST_SIZE/4 etc) and let the reading thread fine-tune by > beginning to process input after having read first newline, etc. The problem I was pointing out is that if chunk#2 moved foward a few bytes before it started reading in search of a newline, how will chunk#1 know that it's supposed to read up to that further point? You have to stop #1 from reading further when it catches up with where #2 started. Since the start of #2 is fuzzy until some reading is done, what you're describing will need #2 to send some feedback to #1 after they've both started, and that sounds bad to me. I like designs where the boundaries between threads are clearly defined before any of them start and none of them ever talk to the others. > In both cases, maybe it would also be needed for pgloader to be able to have a > separate thread for COPYing the buffer to the server, allowing it to continue > preparing next buffer in the meantime? That sounds like a V2.0 design to me. I'd only chase after that level of complexity if profiling suggests that's where the bottleneck really is. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD