Re: Postgres batch write very slow - what to do

From: Tom Lane
Subject: Re: Postgres batch write very slow - what to do
Date: ,
Msg-id: 2563.1173799749@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: Postgres batch write very slow - what to do  (femski)
Responses: Re: Postgres batch write very slow - what to do  (Heikki Linnakangas)
List: pgsql-performance

Tree view

Postgres batch write very slow - what to do  (femski, )
 Re: Postgres batch write very slow - what to do  (Heikki Linnakangas, )
  Re: Postgres batch write very slow - what to do  (femski, )
   Re: Postgres batch write very slow - what to do  (Tom Lane, )
    Re: Postgres batch write very slow - what to do  (Heikki Linnakangas, )
     Re: Postgres batch write very slow - what to do  (Tom Lane, )
   Re: Postgres batch write very slow - what to do  (femski, )
    Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
     Re: Postgres batch write very slow - what to do  (femski, )
      Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
       Re: Postgres batch write very slow - what to do  (femski, )
        Re: Postgres batch write very slow - what to do  (Tom Lane, )
        Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
         Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
 Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
 Re: Postgres batch write very slow - what to do  ("Merlin Moncure", )
 Re: Postgres batch write very slow - what to do  ("Joshua D. Drake", )
  Re: Postgres batch write very slow - what to do  (Carlos Moreno, )
   Re: Postgres batch write very slow - what to do  ("Joshua D. Drake", )
 Re: Postgres batch write very slow - what to do  ("hubert depesz lubaczewski", )

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


pgsql-performance by date:

From: Cosimo Streppone
Date:
Subject: Re: PostgreSQL in virtual machine
From: "Anton Melser"
Date:
Subject: Re: PostgreSQL 8.2.3 VACUUM Timings/Performance