Re: [JDBC] Query with tables from 2 different databases inJava - Mailing list pgsql-novice

From Richard Broersma Jr
Subject Re: [JDBC] Query with tables from 2 different databases inJava
Date
Msg-id 394431.68251.qm@web31810.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Query with tables from 2 different databases inJava  ("Bart Degryse" <Bart.Degryse@indicator.be>)
List pgsql-novice
--- Bart Degryse <Bart.Degryse@indicator.be> 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.

pgsql-novice by date:

Previous
From: "Loredana Curugiu"
Date:
Subject: Re: [JDBC] Query with tables from 2 different databases inJava
Next
From: Sean Davis
Date:
Subject: Re: [JDBC] Query with tables from 2 different databases inJava