Review whether there is room for optimization here. IOW - Is it possible evaluate to constant before going foreign?
tempdel=> explain (verbose) select * from t where a = random()::INTEGER;
QUERY PLAN
----------------------------------------------------------------------
Foreign Scan on public.t (cost=25.00..99719.00 rows=99694 width=36)
Output: a, b
Filter: (t.a = (random())::integer)
Remote server startup cost: 25
Remote query: SELECT `a`, `b` FROM `tempdel`.`t`
(5 rows)
Time: 1813.763 ms (00:01.814)
tempdel=> explain (verbose) select * from t where a = 234;
QUERY PLAN
------------------------------------------------------------------------
Foreign Scan on public.t (cost=25.00..27.00 rows=2 width=36)
Output: a, b
Remote server startup cost: 25
Remote query: SELECT `a`, `b` FROM `tempdel`.`t` WHERE ((`a` = 234))
(4 rows)
Time: 698.709 ms
tempdel=>
Review whether there is room for optimization here. IOW - Is it possible evaluate to constant before going foreign?