Re: Pipeline mode and PQpipelineSync()

From: Alvaro Herrera <alvaro(dot)herrera(at)2ndquadrant(dot)com>
To: Boris Kolpackov <boris(at)codesynthesis(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Pipeline mode and PQpipelineSync()
Date: 2021-06-23 16:22:46
Message-ID: 202106231622.ppuztv2vegix@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Jun-23, Boris Kolpackov wrote:

> I think one change that is definitely needed is to make it clear that
> the PQpipelineSync() call is not optional.
>
> I would also add a note saying that while the server starts processing
> the pipeline immediately, it may buffer the results and the only way
> to flush them out is to call PQpipelineSync().

Curious -- I just noticed that the server understands a message 'H' that
requests a flush of the server buffer. However, libpq has no way to
generate that message as far as I can see. I think you could use that
to request results from the pipeline, without the sync point.

I wonder if it's worth adding an entry point to libpq to allow access to
this. PQrequestFlush() or something like that ... Prior to pipeline
mode this has no use (since everything ends with ReadyForQuery which
involves a flush) but it does seem to have use in pipeline mode.

--
Álvaro Herrera 39°49'30"S 73°17'W

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2021-06-23 16:31:02 Re: Using indexUnchanged with nbtree
Previous Message Peter Geoghegan 2021-06-23 16:17:30 Re: Using indexUnchanged with nbtree