Re: [NOVICE] Query with tables from 2 different databases inJava

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be>, pgsql-jdbc(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Query with tables from 2 different databases inJava
Date: 2007-06-07 15:51:08
Message-ID: 394431.68251.qm@web31810.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-novice


--- Bart Degryse <Bart(dot)Degryse(at)indicator(dot)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.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sean Davis 2007-06-07 15:57:44 Re: [NOVICE] Query with tables from 2 different databases inJava
Previous Message Loredana Curugiu 2007-06-07 15:50:18 Re: [NOVICE] Query with tables from 2 different databases inJava

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2007-06-07 15:57:44 Re: [NOVICE] Query with tables from 2 different databases inJava
Previous Message Loredana Curugiu 2007-06-07 15:50:18 Re: [NOVICE] Query with tables from 2 different databases inJava