[ http://nagoya.apache.org/jira/browse/DERBY-110?page=comments#action_57035 ] Sunitha Kambhampati commented on DERBY-110: -------------------------------------------
1) Check if you are running in autocommit mode false. Inserts can be painfully slow in autocommit mode. The reason is that each commit involves a flush of the log to the disk for each insert statement. The commit will not return until a physical disk write has been executed.There is a jira entry to document this performance tip. http://nagoya.apache.org/jira/browse/DERBY-108 2) It is not a good idea to use Statement, use PreparedStatement instead. Using prepared statements instead of statements can help avoid unnecessary compilation which saves time. check the following links in the tuning manual: http://incubator.apache.org/derby/manuals/tuning/perf21.html#HDRSII-PERF-18705 http://incubator.apache.org/derby/manuals/tuning/perf34.html#IDX438 > performance > ----------- > > Key: DERBY-110 > URL: http://nagoya.apache.org/jira/browse/DERBY-110 > Project: Derby > Type: Test > Versions: 10.0.2.1 > Environment: CPU 2.40GHz > windows 2000 > Reporter: Zhang Jinsheng > Priority: Minor > > 1. create db name systable in derby and hsqldb (another open source dbms); > 2. create table named a table ('CREATE TABLE aTable(id INTEGER NOT NULL, name > VARCHAR(255) NOT NULL, description VARCHAR(255))'); > 3. insert ten thousands row in table "atable" > for(int i=1; i<10000; i++) { > sql = "INSERT INTO aTable VALUES("+i+", 'haha', 'zhang'' test')"; > stmt.execute(sql); > System.out.println(i); > } > 4. derby spend 50390 millisecond; > hsqldb spend 4250 millisecond; > > 5. conclusion: hsqldb has more perfect performance. > Maybe derby need to improve it's performance. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
