Re: weird interaction between asynchronous queries and pg_sleep

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: weird interaction between asynchronous queries and pg_sleep
Date: 2021-04-08 23:18:09
Message-ID: CAHyXU0xR0=Vp+4SdKpsTLYowr_54=nHnoYNnm68E5z+m6vdgxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 8, 2021 at 1:05 PM Merlin Moncure <mmoncure(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuro Yamada 2021-04-08 23:18:14 Re: Typo in jsonfuncs.c
Previous Message Michael Paquier 2021-04-08 23:01:03 Re: SQL-standard function body