Re: weird interaction between asynchronous queries and pg_sleep - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: weird interaction between asynchronous queries and pg_sleep
Date
Msg-id CAHyXU0xR0=Vp+4SdKpsTLYowr_54=nHnoYNnm68E5z+m6vdgxQ@mail.gmail.com
Whole thread Raw
In response to weird interaction between asynchronous queries and pg_sleep  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Thu, Apr 8, 2021 at 1:05 PM Merlin Moncure <mmoncure@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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: SQL-standard function body
Next
From: Tatsuro Yamada
Date:
Subject: Re: Typo in jsonfuncs.c