X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E88543A3FCC for ; Tue, 2 Nov 2004 20:18:57 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80075-04 for ; Tue, 2 Nov 2004 20:18:47 +0000 (GMT) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id E1AF53A3C26 for ; Tue, 2 Nov 2004 20:18:47 +0000 (GMT) Received: from [172.26.132.145] (hoopoe.rentec.com [172.26.132.145]) by ram.rentec.com (8.12.9/8.12.1) with ESMTP id iA2KIiHd009003; Tue, 2 Nov 2004 15:18:45 -0500 (EST) Message-ID: <4187EBA4.2040100@rentec.com> Date: Tue, 02 Nov 2004 15:18:44 -0500 From: Alan Stange Reply-To: stange@rentec.com Organization: Renaissance Technologies Corp. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: executeBatch() issue with new driver? References: <4187B025.2090201@rentec.com> <4187DF2E.3030302@rentec.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/33 X-Sequence-Number: 11455 Kris Jurka wrote: >On Tue, 2 Nov 2004, Alan Stange wrote: > > > >>>This is something (as discussed with Dave) that you shouldn't be doing, >>> >>> >>> >>Let me be devils advocate for a second and ask "why not"? I don't >>disagree, but I'm not sure I understand all the issues here. >> >> >> > >The real problem is that executeBatch() returns an int[] of update counts. >What should we return for an entry like addBatch("INSERT ... ; INSERT >..."); ? Two individual entries? The sum of the update counts? The >javadoc for executeBatch isn't entirely clear, but certainly seems to make >the assumption that one batch entry is one command. > This was what I was thinking. What does the pg74 driver do in this case as it does allow multiple statements in each batch? > Especially since you >are already using addBatch, there doesn't seem to be much point in jamming >two commands into one batch. > > Network latency. We were able to greatly increase performance this way by reducing the number of round trips. -- Alan