Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 0502D9FB5CE for ; Thu, 7 Jun 2007 12:51:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 27012-07 for ; Thu, 7 Jun 2007 12:51:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31810.mail.mud.yahoo.com (web31810.mail.mud.yahoo.com [68.142.207.73]) by postgresql.org (Postfix) with SMTP id 4E94F9FC03D for ; Thu, 7 Jun 2007 12:51:10 -0300 (ADT) Received: (qmail 69591 invoked by uid 60001); 7 Jun 2007 15:51:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=ifqqZScvAX7N8Mwj7hlSLVT2dfnhN8NTThKEPyBkt3x3C8gLy9C2VA6YKzGtICsy/a09sxVSTV9eXcn4u2mlIYwIkP7khEpQXQwu7BoLz8h+mZ/n+zT5IWPVwnSBu/pPbn3QVSj9rgiLWPMFQZzvyQvGmkaNkTXj83jAwNNP0JU=; X-YMail-OSG: K_mE3iQVM1kWS7tux02izvc87J1QtbvWD219qiBnPA7Jx2hvtnhuPp2aYKxGRUxpi0j60Q-- Received: from [63.203.180.122] by web31810.mail.mud.yahoo.com via HTTP; Thu, 07 Jun 2007 08:51:08 PDT Date: Thu, 7 Jun 2007 08:51:08 -0700 (PDT) From: Richard Broersma Jr Subject: Re: [NOVICE] Query with tables from 2 different databases inJava To: Bart Degryse , pgsql-jdbc@postgresql.org, pgsql-novice@postgresql.org In-Reply-To: <4668390D.A3DD.0030.0@indicator.be> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <394431.68251.qm@web31810.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.144 tagged_above=0 required=5 tests=AWL=-1.212, BAYES_50=0.001, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: ** X-Archive-Number: 200706/31 X-Sequence-Number: 17093 --- Bart Degryse wrote: > Personally I have no good experiences with neither dblink nor dbi-link. > They perferm only acceptably on very few records. > My approach now is to use srf plperl functions. That approach requires you > to have a reasonable knowledge of perl, but is in my experience the fastest > (or at least slow) one and certainly the most flexible one. I am sure that the same result can be implemented in pljava as you were able to achieve in plperl just incase the OP doesn't have a strength in one of the other other pl-languages. I am not exactly sure how DBLINK works, but I guess that the calling database has to pull all of (or at least most of) the records from the table of the linked database in order to develop a JOIN, which would effectivly and always be a SEQ Scan that is pushed through a less that optimal com connection. If the table was very large, this would probably be a preformance killer. But if the table is simply a smaller look-up table with less-than a few thousand records that can easily be materialized in the calling database, DBLINK could be a workable solution. Regards, Richard Broersma Jr.