From: Alan Stange <stange@rentec.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: executeBatch() issue with new driver?
Date: Tue, 02 Nov 2004 15:44:40 -0500
Message-ID: <4187F1B8.1010302@rentec.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0411021520580.17126@leary.csoft.net>
References: <4187B025.2090201@rentec.com>
<Pine.BSO.4.56.0411021411070.17267@leary.csoft.net>
<4187DF2E.3030302@rentec.com>
<Pine.BSO.4.56.0411021427540.3642@leary.csoft.net>
<4187EBA4.2040100@rentec.com>
<Pine.BSO.4.56.0411021520580.17126@leary.csoft.net>
Kris Jurka wrote:
>On Tue, 2 Nov 2004, Alan Stange wrote:
>
>
>
>>>The real problem is that executeBatch() returns an int[] of update counts.
>>>
>>>
>>>
>>This was what I was thinking. What does the pg74 driver do in this
>>case as it does allow multiple statements in each batch?
>>
>>
>>
>
>The 8.0 driver uses the extended query protocol while the 7.4 driver
>uses the simple query protocol. The relevent difference in this case is
>that you can only send one command per query in the extended query
>protocol while you can string them together with ";" in the simple case.
>This means the 8.0 driver splits the queries and issues them individually
>and gets update counts for each command. The 7.4 driver issues them
>together and only gets one update count (for the last piece of the batch).
>
>
>
>>Network latency. We were able to greatly increase performance this way
>>by reducing the number of round trips.
>>
>>
>>
>
>Well in the 8.0 case you've lost that anyway because it splits them and
>issues them separately. Although the 8.0 driver does have some other
>advantages in that it doesn't issue a Sync after each individual query,
>but sends out a number of commands and then processes a number of results,
>so the number of round trips will be reduced, but in a different fashion.
>
>
What about this case:
Connection conn = ...
Statement st = conn.createStatement();
st.execute("insert a; insert b; insert c; insert d;");
Is the 8.0 driver busting this up into 4 trips to the database?!
-- Alan
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: stange@rentec.com, books@ejurka.com
Subject: Re: executeBatch() issue with new driver?
In-Reply-To: <4187F1B8.1010302@rentec.com>
References: <4187B025.2090201@rentec.com> <Pine.BSO.4.56.0411021411070.17267@leary.csoft.net> <4187DF2E.3030302@rentec.com> <Pine.BSO.4.56.0411021427540.3642@leary.csoft.net> <4187EBA4.2040100@rentec.com> <Pine.BSO.4.56.0411021520580.17126@leary.csoft.net> <4187F1B8.1010302@rentec.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