Re: Joins between foreign tables - Mailing list pgsql-general

From Jason Dusek
Subject Re: Joins between foreign tables
Date
Msg-id CAO3NbwMbmyA9HdnJJ9hrtsbrsgDkzajraXts_y4TyUx_sWwT9A@mail.gmail.com
Whole thread Raw
In response to Re: Joins between foreign tables  (Geoff Montee <geoff.montee@gmail.com>)
List pgsql-general

Hi Geoff,

Thanks for your swift reply. Breaking the query up like this would seem to address the problem:

CREATE UNLOGGED TABLE tmp AS
SELECT * FROM table_on_server2WHERE created_at >= date_trunc('day', now());

SELECT email FROM table_on_server1 WHERE id IN (SELECT user_id FROM tmp);

It would stand to reason that the IN list could be pushed down to the foreign server; but this query’s performance is no better than the direct join between table_on_server1 and table_on_server2. Best Regards,

  Jason Dusek

pgsql-general by date:

Previous
From: Anderson Valadares
Date:
Subject: Re: Momentary Delay
Next
From: Ian Barwick
Date:
Subject: Re: Postgresql BDR Replication Setup Issue