Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9E1DE9FBB59 for ; Tue, 13 Mar 2007 12:29:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 99471-01-10 for ; Tue, 13 Mar 2007 12:29:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 96C529FBA7D for ; Tue, 13 Mar 2007 12:29:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2DFT9mV002564; Tue, 13 Mar 2007 11:29:10 -0400 (EDT) To: femski cc: pgsql-performance@postgresql.org Subject: Re: Postgres batch write very slow - what to do In-reply-to: <9453712.post@talk.nabble.com> References: <9452092.post@talk.nabble.com> <45F685B7.5040001@enterprisedb.com> <9453712.post@talk.nabble.com> Comments: In-reply-to femski message dated "Tue, 13 Mar 2007 05:56:23 -0700" Date: Tue, 13 Mar 2007 11:29:09 -0400 Message-ID: <2563.1173799749@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/230 X-Sequence-Number: 23635 femski writes: > I am runing Postgres 8.2 on OpenSuse 10.2 with latest jdbc driver. I moved > the app to be collocated with the server. Oracle takes 60 sec. Postgres 275 > sec. For 4.7 million rows. > There are 4 CPUs on the server and one is runing close to 100% during > inserts. > Network history shows spikes of upto 60% of the bandwidth (Gnome System > monitor graph). It sounds like you're incurring a network round trip for each row, which will be expensive even for a co-located application. Perhaps Oracle's JDBC driver is smart enough to avoid that. I'm not sure what tricks are available for bulk loading with our JDBC driver --- the page Heikki mentioned explains things from a server perspective but I dunno how that translates into JDBC. The folks who hang out on pgsql-jdbc could probably give you some tips. regards, tom lane