db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sedillo, Derek \(Mission Systems\)" <Derek.Sedi...@ngc.com>
Subject RE: Large multi-record insert performance
Date Fri, 16 Mar 2007 16:53:10 GMT
Dyre,

I apologize for the confussion.  I wasn't quite sure what Daniel meant
with regards to:

> All in one transaction using executeUpdate():
> 100 tags added in 274ms
> 100 tags removed in 70ms
> 1000 tags added in 299ms
> 1000 tags removed in 250ms
> 10000 tags added in 1605ms
> 10000 tags removed in 1500ms
> 100000 tags added in 14441ms
> 100000 tags removed in 19721ms

In looking again at your proposed solution, this in fact may be what he
was doing.

> PreparedStatement ps =
> conn.prepareStatement("insert into T values (?, ?, ?)");

>  conn.setAutoCommit(false);
>  for (int i = 0; i < 1000; ++i) {
      ps.setX(1, <whatever>);
      ps.setX(2, <whatever>); 
      ps.setX(3, <whatever>);
      ps.executeUpdate();
>  }
>  conn.commit(); 

With autoCommit off you are executing 1000 updates but only performing
'One' commit.  If Daniel is equating transactions with commits then your
approach would be correct. 

Thank you,

Derek

Mime
View raw message