Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xku3A-00037R-Hz for pgsql-jdbc@arkaria.postgresql.org; Sun, 02 Nov 2014 12:14:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xku39-0002By-QZ for pgsql-jdbc@arkaria.postgresql.org; Sun, 02 Nov 2014 12:14:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xku38-0002BD-7i; Sun, 02 Nov 2014 12:14:26 +0000 Received: from mail-am1on0601.outbound.protection.outlook.com ([2a01:111:f400:fe00::601] helo=emea01-am1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xku32-0004wF-G4; Sun, 02 Nov 2014 12:14:23 +0000 Received: from AM2PR07MB0660.eurprd07.prod.outlook.com (25.160.55.151) by AM2PR07MB0692.eurprd07.prod.outlook.com (25.160.56.148) with Microsoft SMTP Server (TLS) id 15.1.11.14; Sun, 2 Nov 2014 12:11:50 +0000 Received: from AM2PR07MB0659.eurprd07.prod.outlook.com (25.160.55.150) by AM2PR07MB0660.eurprd07.prod.outlook.com (25.160.55.151) with Microsoft SMTP Server (TLS) id 15.1.11.14; Sun, 2 Nov 2014 12:11:49 +0000 Received: from AM2PR07MB0659.eurprd07.prod.outlook.com ([25.160.55.150]) by AM2PR07MB0659.eurprd07.prod.outlook.com ([25.160.55.150]) with mapi id 15.01.0011.000; Sun, 2 Nov 2014 12:11:49 +0000 From: Mikko Tiihonen To: Andres Freund CC: "pgsql-hackers@postgresql.org" , "pgsql-jdbc@postgresql.org" Subject: Re: [HACKERS] Pipelining executions to postgresql server Thread-Topic: [HACKERS] Pipelining executions to postgresql server Thread-Index: AQHP9doTvFE5xFKaR0KPR7jlrL4JypxMB5MAgAEyENg= Date: Sun, 2 Nov 2014 12:11:49 +0000 Message-ID: <1414930308808.49160@nitorcreations.com> References: <1414850643686.34687@nitorcreations.com>, <20141101173116.GR13584@awork2.anarazel.de> In-Reply-To: <20141101173116.GR13584@awork2.anarazel.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [89.27.31.97] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0660;UriScan:; x-exchange-antispam-report-test: UriScan:; x-forefront-prvs: 03838E948C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(24454002)(189002)(199003)(377424004)(51704005)(92566001)(92726001)(87936001)(86362001)(77096003)(36756003)(2656002)(95666004)(105586002)(106116001)(106356001)(31966008)(107046002)(4396001)(46102003)(117636001)(64706001)(20776003)(66066001)(77156002)(76176999)(50986999)(21056001)(99396003)(15975445006)(15202345003)(101416001)(40100003)(122556002)(110136001)(97736003)(54356999)(551934003)(120916001)(19580405001)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB0660; H:AM2PR07MB0659.eurprd07.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0692; X-OriginatorOrg: nitorcreations.com X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org > From: Andres Freund > On 2014-11-01 14:04:05 +0000, Mikko Tiihonen wrote: > > I created a proof of concecpt patch for postgresql JDBC driver that > > allows the caller to do pipelining of requests within a > > transaction. The pipelining here means same as for HTTP: the client > > can send the next execution already before waiting for the response of > > the previous request to be fully processed. >=20 > Slightly confused here. To my knowledge the jdbc driver already employs > some pipelining? There's some conditions where it's disabled (IIRC > RETURNING for DML is one of them), but otherwise it's available. >=20 > I'm very far from a pgjdbc expert, but that's what I gathered from the > code when investigating issues a while back and from my colleague Craig. Most DB interfaces make the server operations look synchronous. For JDBC the only standard interface is similar to libpg: PGresult *PQexec(PGconn *conn, const char *command); I should have searched earlier a better reference to libpg. I am planning o= n adding support for something similar to http://www.postgresql.org/docs/9.3/static/libpq-async.html More specifically operations like: int PQsendQuery(PGconn *conn, const char *command); PGresult *PQgetResult(PGconn *conn); The Java API will of course be custom to postgresql jdbc driver since there= is no official java api for async db operations. The above I can do purely on the jdbc driver side. But my my question was a= bout pipelining. In libpg terms: Is it safe to do multiple PQsendQuery operations before inv= oking PQgetResult as many times? It should be, if the server startd to process (read in) the next query only= after it has sent the previous response out. And do any pg connection poolers support having multiple executions on-the-= fly at the same time for the same connection? -Mikko --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc