I think its telling that varying the fetch size doubled the performance,
even on localhost.  If you were to repeat this test across a network, the
performance difference would be far more drastic.

I understand the desire to keep the fetch size small by default, but I
think your results demonstrate how important the value is.  At the very
least, it is worth reconsidering this "arbitrary" value.  However, I think
the real solution is to make this configurable.  It probably should be a
new option on the foreign server or table, but an argument could be made
for it to be global across the server just like work_mem.

Obviously, this shouldn't block your current patch but its worth revisiting.

- Matt Kelly

Reply via email to