Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlYY0-0003D9-Bp for pgsql-jdbc@arkaria.postgresql.org; Tue, 04 Nov 2014 07:29:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XlYXz-00005X-JI for pgsql-jdbc@arkaria.postgresql.org; Tue, 04 Nov 2014 07:28:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XlYXy-00005M-H2; Tue, 04 Nov 2014 07:28:58 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlYXu-00023w-RJ; Tue, 04 Nov 2014 07:28:56 +0000 Received: from ayaki.localdomain (106-68-211-225.dyn.iinet.net.au [106.68.211.225]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0MNyIR-1XfoJV1ih9-007SCT; Tue, 04 Nov 2014 08:28:52 +0100 Message-ID: <5458802E.5010706@2ndquadrant.com> Date: Tue, 04 Nov 2014 15:28:46 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Mikko Tiihonen , Andres Freund CC: "pgsql-hackers@postgresql.org" , "pgsql-jdbc@postgresql.org" Subject: Re: [HACKERS] Pipelining executions to postgresql server 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> In-Reply-To: <1415058981678.77807@nitorcreations.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:T4RNBiS+VtgkWJNKmgM0mRZtVbSmaQW3E8gn2LTFfHA JrNUa7nFedNnIH+v63wtXPljVe7F/Hk0mXxGH7k46Z7q6IQ7md obzFnN2EfEbLevhmjTfuKloQ0H443VRqX/qYh6iJSUHEwbd23v Q17+zAxbM7TxDdILAiQ37YWM1737ZOt9FC58MAJkJXv+oJjFlE Bg566vtVzJjIwxdsfMxrD9bdJldHB6+2ytwAf3yuLRwf6DKM/h S36QL6T4gyGGxtTccpw90fikTR0+zL2ZxVZbeaDUoc3fWS5mfv yvl5T0bMIOM4L2NgDXV404VD89LxFc36NYrZep4F8fVckXUGWk 1lTUuyGNRJuAHeI4hBmohO39zGlzp7VK8DmGy5faL X-UI-Out-Filterresults: notjunk:1; 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 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