On Thu, Apr 8, 2021 at 1:05 PM Merlin Moncure <mmonc...@gmail.com> wrote: > This effect is only noticeable when the remote query is returning > volumes of data. My question is, is there any way to sleep loop > client side without giving up 3x performance penalty? Why is that > that when more local sleep queries are executed, performance improves?
Looking at this more, it looks like that when sleeping with pg_sleep, libpq does not receive the data. I think for this type of pattern to work correctly, dblink would need a custom sleep function wrapping poll (or epoll) that consumes input on the socket when signalled read ready. merlin