Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-11 Thread Edwin Eyan Moragas
On Thu, 11 Nov 2004 11:04:18 +0100, Steinar H. Gunderson <[EMAIL PROTECTED]> wrote: > You don't even need a "BEGIN" and "END"; his code has a setAutoComit(true) > before the for loop, which just has to be changed to setAutoCommit(false) > (and add an explicit commit() after the for loop, of course)

Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-11 Thread Steinar H. Gunderson
On Thu, Nov 11, 2004 at 04:04:06PM +0800, Edwin Eyan Moragas wrote: > 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. You don't even need a "BEGIN" and "END"; his code has a setAutoComit(true) be

Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-11 Thread Edwin Eyan Moragas
On Wed, 10 Nov 2004 14:51:57 +0100, Michael Kleiser <[EMAIL PROTECTED]> wrote: >Statement st = con.createStatement(); >java.sql.Timestamp datum = new java.sql.Timestamp(new > Date().getTime()); >Date start = new Date(); >System.out.p

Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-10 Thread Leeuw van der, Tim
Hi, Try using parametrized prepared statements, does that make a difference? Or does PGSQL jdbc not support them in your version? --Tim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Kleiser Sent: Wednesday, November 10, 2004 2:52 PM To: Jeff Cc:

Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-10 Thread Dave Cramer
couple of things 1) That is a fairly old version of postgres, there are considerable performance improvements in the last 2 releases since, and even more in the pending release. 2) If you are going to insert more rows than that, consider dropping the index before, and recreating after the insert

Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-10 Thread Jeff
On Nov 10, 2004, at 8:51 AM, Michael Kleiser wrote: It is trunning in in 10 Threads. Each thread makes 100 Inserts: For the 1000 Inserts (10 threads a 100 inserts) we need 8 seconds. That's 125 Insets / Seconds. How could we make it faster ? Batch the inserts up into a transaction. So you'd have BE