From: Craig Ringer <craig@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>
Cc: 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 09:56:17 +0800
Message-ID: <54583241.8030506@2ndquadrant.com> (raw)
In-Reply-To: <32086.1415063405@sss.pgh.pa.us>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 11/04/2014 09:10 AM, Tom Lane wrote:
> Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com> 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
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, tgl@sss.pgh.pa.us, Mikko.Tiihonen@nitorcreations.com, andres@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Pipelining executions to postgresql server
In-Reply-To: <54583241.8030506@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> <32086.1415063405@sss.pgh.pa.us> <54583241.8030506@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