Re: Speed up single INSERT INTO statement?

2012-05-09 Thread Peter Ondruška
Consider batching inserts and use larger log file. On 9 May 2012 19:01, "TXVanguard" wrote: > > I need to speed up a single INSERT statement in Derby. > > The statement has the form: > > INSERT INTO table (col1, col2) SELECT a, b FROM > > In my application, it take about 10 seconds to insert

Re: Speed up single INSERT INTO statement?

2012-05-09 Thread Nathan Boy
The changes that I found most effective when it comes to speeding up inserts: 1 - Run database with "test" durability 2 - Add all of your data before adding your primary key and foreign key constraints, if possible 3 - Use prepared statements 4 - Execute prepared statements in batches, rather than

Re: Speed up single INSERT INTO statement?

2012-05-09 Thread Libor Jelinek
Sorry Brett, I'm not responding to your question but enganged by your "Would it be helpful to temporarily turn off constraints for the table?" AFAIK it's not possible to do this. Was it a question or you know how to do it? If so, point me out, please. Cheers, Libor On Wed, May 9, 2012 at 7:00 PM

Speed up single INSERT INTO statement?

2012-05-09 Thread TXVanguard
I need to speed up a single INSERT statement in Derby. The statement has the form: INSERT INTO table (col1, col2) SELECT a, b FROM In my application, it take about 10 seconds to insert 3000 records. I have experimented with turning off autocommit, adjusting derby.storage.pageCacheSize and