Postgres foreign data wrappers weird join behavior
You never ANALYZEd the foreign tables, so the estimates are way off, and PostgreSQL chooses a bad execution plan.

ANALYZE tds, dq_infos;


should improve the situation.

Different from regular tables, foreign tables are not handled by autoanalyze.