Re: How to speed-up inserts with jdbc

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: mkl(at)webde-ag(dot)de
Cc: Shane|SkinnyCorp <shanew(at)skinnycorp(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How to speed-up inserts with jdbc
Date: 2004-11-10 13:55:01
Message-ID: 1DFE91CA-3320-11D9-9406-000D9366F0C4@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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
BEGIN
insert
insert
insert
...
COMMIT

Your numbers will suddenly sky rocket.

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dave Cramer 2004-11-10 14:05:37 Re: How to speed-up inserts with jdbc
Previous Message Michael Kleiser 2004-11-10 13:51:57 How to speed-up inserts with jdbc