I did this, I replaced application code with statement.executeBatch() // which should insert 10,000 inserts at once, the result is this:
H2: Profiler: top 3 stack trace(s) of of 254 ms of 127 thread dumps: 120/126 (95%): at org.h2.store.fs.FileDisk.force(FilePathDisk.java:410) at org.h2.store.FileStore.sync(FileStore.java:419) at org.h2.store.PageStore.writeVariableHeader(PageStore.java:982) at org.h2.store.PageStore.setLogFirstPage(PageStore.java:976) at org.h2.store.PageLog.removeUntil(PageLog.java:726) at org.h2.store.PageStore.checkpoint(PageStore.java:441) at org.h2.store.PageStore.commit(PageStore.java:1481) at org.h2.engine.Database.commit(Database.java:1926) at org.h2.engine.Session.commit(Session.java:494) at org.h2.schema.Sequence.flush(Sequence.java:292) at org.h2.schema.Sequence.getNext(Sequence.java:262) at org.h2.expression.SequenceValue.getValue(SequenceValue.java:31) at org.h2.table.Column.validateConvertUpdateSequence(Column.java:277) at org.h2.table.Table.validateConvertUpdateSequence(Table.java:726) at org.h2.command.dml.Insert.insertRows(Insert.java:152) at org.h2.command.dml.Insert.update(Insert.java:115) at org.h2.command.CommandContainer.update(CommandContainer.java:79) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) 2/126 (1%): at org.h2.store.PageStore.checkpoint(PageStore.java:454) at org.h2.store.PageStore.commit(PageStore.java:1481) at org.h2.engine.Database.commit(Database.java:1926) at org.h2.engine.Session.commit(Session.java:494) at org.h2.schema.Sequence.flush(Sequence.java:292) at org.h2.schema.Sequence.getNext(Sequence.java:262) at org.h2.expression.SequenceValue.getValue(SequenceValue.java:31) at org.h2.table.Column.validateConvertUpdateSequence(Column.java:277) at org.h2.table.Table.validateConvertUpdateSequence(Table.java:726) at org.h2.command.dml.Insert.insertRows(Insert.java:152) at org.h2.command.dml.Insert.update(Insert.java:115) at org.h2.command.CommandContainer.update(CommandContainer.java:79) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) 1/126 (0%): at org.h2.message.TraceSystem.closeWriter(TraceSystem.java:322) at org.h2.message.TraceSystem.writeFile(TraceSystem.java:253) at org.h2.message.TraceSystem.write(TraceSystem.java:244) at org.h2.message.Trace.infoSQL(Trace.java:278) at org.h2.command.Prepared.trace(Prepared.java:313) at org.h2.command.CommandContainer.update(CommandContainer.java:80) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) 1/126 (0%): at org.h2.value.Value.checkPrecision(Value.java:1071) at org.h2.table.Column.validateConvertUpdateSequence(Column.java:327) at org.h2.table.Table.validateConvertUpdateSequence(Table.java:726) at org.h2.command.dml.Insert.insertRows(Insert.java:152) at org.h2.command.dml.Insert.update(Insert.java:115) at org.h2.command.CommandContainer.update(CommandContainer.java:79) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) 1/126 (0%): at org.h2.util.CacheLRU.getAllChanged(CacheLRU.java:349) at org.h2.store.PageStore.writeBack(PageStore.java:416) at org.h2.store.PageStore.checkpoint(PageStore.java:437) at org.h2.store.PageStore.commit(PageStore.java:1481) at org.h2.engine.Database.commit(Database.java:1926) at org.h2.engine.Session.commit(Session.java:494) at org.h2.schema.Sequence.flush(Sequence.java:292) at org.h2.schema.Sequence.getNext(Sequence.java:262) at org.h2.expression.SequenceValue.getValue(SequenceValue.java:31) at org.h2.table.Column.validateConvertUpdateSequence(Column.java:277) at org.h2.table.Table.validateConvertUpdateSequence(Table.java:726) at org.h2.command.dml.Insert.insertRows(Insert.java:152) at org.h2.command.dml.Insert.update(Insert.java:115) at org.h2.command.CommandContainer.update(CommandContainer.java:79) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) 1/126 (0%): at org.h2.compress.CompressLZF.compress(CompressLZF.java:240) at org.h2.store.PageLog.addUndo(PageLog.java:515) at org.h2.store.PageStore.logUndo(PageStore.java:1070) at org.h2.index.PageDataNode.addRowTry(PageDataNode.java:126) at org.h2.index.PageDataIndex.addTry(PageDataIndex.java:174) at org.h2.index.PageDataIndex.add(PageDataIndex.java:137) at org.h2.table.RegularTable.addRow(RegularTable.java:120) at org.h2.command.dml.Insert.insertRows(Insert.java:157) at org.h2.command.dml.Insert.update(Insert.java:115) at org.h2.command.CommandContainer.update(CommandContainer.java:79) at org.h2.command.Command.executeUpdate(Command.java:254) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1184) at com.jedox.etl.core.persistence.generic.module.PersistenceModule.addBatch(PersistenceModule.java:89) at com.jedox.etl.core.persistence.generic.GenericPersistor.insert(GenericPersistor.java:397) at com.jedox.etl.core.persistence.generic.GenericStore.write(GenericStore.java:232) at com.jedox.etl.core.persistence.Datastore.write(Datastore.java:639) at com.jedox.etl.core.source.processor.Processor.persist(Processor.java:150) at com.jedox.etl.core.source.processor.Processor.next(Processor.java:211) at com.jedox.etl.components.load.CubeLoad.exportData(CubeLoad.java:636) at com.jedox.etl.components.load.CubeLoad.executeLoad(CubeLoad.java:703) at com.jedox.etl.core.load.Load.execute(Load.java:82) at com.jedox.etl.core.execution.Execution.execute(Execution.java:315) at com.jedox.etl.core.execution.Execution.run(Execution.java:230) summary: 95%: org.h2.store.fs I hope that is what you needed. Regards, Kais On Mon, Apr 7, 2014 at 3:20 PM, Noel Grandin <noelgran...@gmail.com> wrote: > Hi > > Could you try using our simple profiler on the second run, like this: > > import org.h2.util; > ... > Profiler profiler = new Profiler(); > profiler.startCollecting(); > // application code > System.out.println(profiler.getTop(3)); > > It should show us where the time is being spent inside the H2 code. > > Thanks, Noel. > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "H2 Database" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/h2-database/kKDvc4BMEVw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > h2-database+unsubscr...@googlegroups.com. > To post to this group, send email to h2-database@googlegroups.com. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.