Re: How to speed-up inserts with jdbc - Mailing list pgsql-performance

From Edwin Eyan Moragas
Subject Re: How to speed-up inserts with jdbc
Date
Msg-id 376dd19504111100044aa0ca1e@mail.gmail.com
Whole thread Raw
In response to How to speed-up inserts with jdbc  (Michael Kleiser <mkl@webde-ag.de>)
Responses Re: How to speed-up inserts with jdbc
List pgsql-performance
On Wed, 10 Nov 2004 14:51:57 +0100, Michael Kleiser <mkl@webde-ag.de> wrote:
>                Statement  st = con.createStatement();
>                java.sql.Timestamp datum = new java.sql.Timestamp(new Date().getTime());
>                Date start = new Date();
>                System.out.println(start);
>                for (int i=0; i<100; ++i) {
>                    st.executeUpdate("insert into history(uuid,coni,date,direction,partner,type)
values('uuid','content','"+datum+"','dir','partner','type')");
>                }

how about using PreparedStatment? that's on the java end.
on the pg end, maybe do a BEGIN before the for loop and
END at the end of the for loop.
--
i'm not flying. i'm falling... in style.

pgsql-performance by date:

Previous
From: Mike Rylander
Date:
Subject: Re: int4 in a GiST index
Next
From: Gaetano Mendola
Date:
Subject: Re: seqscan strikes again