X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 150FBD7B30 for ; Fri, 26 Aug 2005 13:04:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25173-10 for ; Fri, 26 Aug 2005 16:04:22 +0000 (GMT) Received: from frank.wiles.org (frank.wiles.org [24.124.39.75]) by svr1.postgresql.org (Postfix) with ESMTP id 7B0A8D7B06 for ; Fri, 26 Aug 2005 13:04:21 -0300 (ADT) Received: from kungfu (frank.wiles.org [127.0.0.1]) by frank.wiles.org (8.13.1/8.13.1) with SMTP id j7QG4HPW004397; Fri, 26 Aug 2005 11:04:17 -0500 Date: Fri, 26 Aug 2005 11:04:59 -0500 From: Frank Wiles To: gxlists@gmail.com Cc: pgsql-performance@postgresql.org Subject: Re: Sending a select to multiple servers. Message-Id: <20050826110459.03cce4d9.frank@wiles.org> In-Reply-To: <20050826152409.GA22060@lxlabs.com> References: <20050826152409.GA22060@lxlabs.com> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.019 required=5 tests=[AWL=0.019] X-Spam-Level: X-Archive-Number: 200508/445 X-Sequence-Number: 14192 On Fri, 26 Aug 2005 20:54:09 +0530 Ligesh wrote: > > I would like to know if the following kind of database client exists: > I need a 'select' query to be sent to say 10 db servers > simultaneously in parallel (using threading), the results should be > re-sorted and returned. For example I have a query: 'select * from > table where parent_clname = 'parent' order by name limit 10'. Now > this query has to be sent to 10 servers, and the maximum number of > results would be 100. Now this 100 result set has to be re-sorted, > out of which 90 has to be discarded, and the 10 has to be returned. > > Does such a solution exist now. To me this appears to be in entirety > of what should constitute a database cluster. Only the search needs > to be done on all the servers simultaneously at the low level. Once > you get the results, the writing can be determined by the upper level > logic (which can even be in a scripting language). But the search > across many servers has to be done using proper threading, and the > re-sorting also needs to be done fast. This is typically handled by the application layer, not a standard client. Mostly because every situation is different, you may have 10 servers and need 10 rows of results, others may need something entirely different. This isn't really a "cluster" either. In a clustered environment you would send the one query to any of the 10 servers and it would return the proper results. But like I said this type of application is fairly trivial to write in most scripting or higher level languages. --------------------------------- Frank Wiles http://www.wiles.org ---------------------------------