How to force evaluation of subquery before joining / pushing down to foreign server
问题 Suppose I want to query a big table with a few WHERE filters. I am using Postgres 11 and a foreign table; foreign data wrapper (FDW) is clickhouse_fdw . But I am also interested in a general solution. I can do so as follows: SELECT id,c1,c2,c3 from big_table where id=3 and c1=2 My FDW is able to do the filtering on the remote foreign data source, ensuring that the above query is quick and doesn't pull down too much data. The above works the same if I write: SELECT id,c1,c2,c3 from big_table