Sample Header Ad - 728x90

Are subqueries pushed down to a remote data source by postgres_fdw?

1 vote
1 answer
446 views
Given this query:
select *
from fdw_schema.customer c
where exists
(  select *
   from fdw_schema.purchase p
   where c.id = p.customer_id
   and p.purchase_date > now() - interval '30 days');
Will the full query get pushed down by postgres_fdw to the remote server? My alternative would be:
select distinct c.*
from fdw_schema.customer c
join fdw_schema.purchase p on c.id = p.customer_id
where p.purchase_date > now() - interval '30 days';
I'm looking at pg_stat_activity on the foreign server, but all I can see is > FETCH 100 FROM c2
Asked by Chris Curvey (386 rep)
Jul 25, 2019, 03:17 PM
Last activity: Mar 14, 2025, 12:04 PM