Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlTN6-0001GQ-6R for pgsql-jdbc@arkaria.postgresql.org; Tue, 04 Nov 2014 01:57:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XlTN5-0005Ev-BH for pgsql-jdbc@arkaria.postgresql.org; Tue, 04 Nov 2014 01:57:23 +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 1XlTN4-0005Ei-BJ; Tue, 04 Nov 2014 01:57:22 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlTN0-0004Vq-Dk; Tue, 04 Nov 2014 01:57:20 +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 0LaYbD-1YTJIP18N5-00mIgD; Tue, 04 Nov 2014 02:57:12 +0100 Message-ID: <54583241.8030506@2ndquadrant.com> Date: Tue, 04 Nov 2014 09:56:17 +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: Tom Lane , Mikko Tiihonen CC: Andres Freund , "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> <32086.1415063405@sss.pgh.pa.us> In-Reply-To: <32086.1415063405@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:elDxn0MGp2QBde3U7koVVlUQjZuGudPr00KqZswyIBf nUy9+AfQXC49OBNrDw5vBbR4ByRZ4xIEBYqEFV+4H3yZUYBuHP N60MO6bQoBWm0Vu+dqtG7WIhZR1nQYt/US2ev7QmFRDmSSaQ7A oacC1EQ3PNfc7RGXjRM/XgEjpY2Qy/N5ClTAqgD179o0tkSl6m OfIdC/oggHxAvWmFmUu9OZBN7ct8uKCcGn6NDsHRXr4ekus7fp BA9cYWtauHBxbDTAuk1ShbhgJTf3r87teK8kMq3uUwrF/1qpo2 hslNkco/FkulxSPI5W90AiEwlOdNakJ+yuA7mZEWMrlwJ8239L HF8MtUM1sv65psQjZRsbcs/e9jZKTPvlnEWmdFjvY 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 09:10 AM, Tom Lane wrote: > Mikko Tiihonen writes: >> I do not quite grasp why not sending Sync is so important. My proof of concept setup was for queries with autocommit enabled. > > [snip] It'll be very much like > sending a fixed (predetermined) SQL script to the server using a scripting > language that lacks any conditionals. ... which is part of why I think the batch interface for JDBC is the appropriate UI, and the existing support in PgJDBC just needs to be extended to support returning result sets. The JDBC driver supports multiple result sets, and a batch execution looks just like a procedure that returned multiple result sets (or rather, a mix of result sets, affected rowcounts, and no-info success messages). See http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#addBatch(java.lang.String) http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#executeBatch() The docs are admittedly mostly oriented toward DML, but nothing stops us returning SUCCESS_NO_INFO and a resultset. Or if we choose, returning a rowcount and resultset. It'd be worth testing what other drivers do before doing that, but nothing in the spec: https://jcp.org/aboutJava/communityprocess/mrel/jsr221/index.html seems to stop us doing it. The batch interface doesn't offer any way to set scrollable/editable resultset options, but we don't want to allow that for batches anyway. -- 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