Re: [HACKERS] Pipelining executions to postgresql server - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: [HACKERS] Pipelining executions to postgresql server
Date
Msg-id 5458802E.5010706@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] Pipelining executions to postgresql server  (Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>)
List pgsql-jdbc
On 11/04/2014 07:56 AM, Mikko Tiihonen wrote:
> I do not quite grasp why not sending Sync is so important.

Well, at the moment the PgJDBC driver relies on the following flow to
manage its buffers and avoid a logjam where both server and client are
waiting for the other to consume input:

* Send some stuff
* Sync
* Consume input until Sync response received

... since at this point it knows the server's send buffer should be
empty, or near enough.

There's no fundamental reason why you *can't* send a Sync after each
query, AFAIK. You just have to change how the driver handles syncs so it
knows that there might be more work pipelined. Or fix the driver's
buffer management, as described in the github issues I linked.

It doesn't make much sense to unless you're running in autocommit mode
though, and I'm not convinced piplelining work in autocommit mode makes
a lot of sense. The biggest problem is exception handling - you can't
throw an exception at some statement execution in the past. So you need
a new interface for piplelining... or to just use the existing batch
interface.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] Pipelining executions to postgresql server
Next
From: Craig Ringer
Date:
Subject: Re: [HACKERS] Pipelining executions to postgresql server