From: Craig Ringer <craig@2ndquadrant.com>
To: Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: [HACKERS] Pipelining executions to postgresql server
Date: Tue, 04 Nov 2014 15:28:46 +0800
Message-ID: <5458802E.5010706@2ndquadrant.com> (raw)
In-Reply-To: <1415058981678.77807@nitorcreations.com>
References: <1414850643686.34687@nitorcreations.com>
<20141101173116.GR13584@awork2.anarazel.de>
<1414930308808.49160@nitorcreations.com>
<20141102122320.GB28295@alap3.anarazel.de>
<1414934833900.88748@nitorcreations.com>
<545790D8.9090201@2ndquadrant.com>
<1415058981678.77807@nitorcreations.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: craig@2ndquadrant.com, Mikko.Tiihonen@nitorcreations.com, andres@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Pipelining executions to postgresql server
In-Reply-To: <5458802E.5010706@2ndquadrant.com>
References: <1414850643686.34687@nitorcreations.com> <20141101173116.GR13584@awork2.anarazel.de> <1414930308808.49160@nitorcreations.com> <20141102122320.GB28295@alap3.anarazel.de> <1414934833900.88748@nitorcreations.com> <545790D8.9090201@2ndquadrant.com> <1415058981678.77807@nitorcreations.com> <5458802E.5010706@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox