Re: Support for distributed queries with semijoins could be possible, if ... - Mailing list pgsql-sql

From Tom Lane
Subject Re: Support for distributed queries with semijoins could be possible, if ...
Date
Msg-id 6693.1023649258@sss.pgh.pa.us
Whole thread Raw
In response to Support for distributed queries with semijoins could be possible, if ...  (Gunther Schadow <gunther@aurora.regenstrief.org>)
List pgsql-sql
Gunther Schadow <gunther@aurora.regenstrief.org> writes:
> SELECT fever.patient_id AS patient_id,
>         fever.value      AS fever,
>         wbc.value        AS wbc
>    FROM (SELECT patient_id, value
>            FROM STDIN) fever
>       INNER JOIN Observation wbc
>          ON fever.patient_id = wbc.patient_id
>   WHERE wbc.type_code = 'WHITE BLOOD CELL COUNT'
>     AND wbc.value < 1000;

A much more direct way of doing it is to leave the client out of the
loop.  The data from system A could be pulled directly into system B,
using e.g. Joe Conway's contrib/dblink package.  dblink is pretty
awkward to use in 7.2 but in 7.3 it should be a lot nicer --- the
returned data can be treated as a table function...
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Q: will GROUP BY make use of an index to return tuples early?
Next
From: Tom Lane
Date:
Subject: Re: select failure