"Kohler Manuel (ID SIS)" <manuel.kohler@xxxxxxxxxx> writes: > here are the Query plans. The first plan is on the source database directly. So no fdw involved: Do you have use_remote_estimate enabled? The rowcount estimates for the foreign tables seem pretty far from reality; use_remote_estimates should help. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general