I run H2 as a service. A certain database I fill with a bash-script called from a cron job. The strange thing is that when I insert records when the database has not been opened the insert takes about .5 seconds. When I open the database in my browser it takes about .15 seconds. (So more as three times as fast.) But when I disconnect from the database the inserts still take about .15 seconds. What could be happening here?
The table is created with: CREATE TABLE vmstatDefault ( date DATE DEFAULT CURRENT_DATE() NOT NULL, time TIME DEFAULT CURRENT_TIME() NOT NULL, runLength INT, runable INT, uninteruptable INT, swap INT, free INT, buffers INT, cache INT, swapIn INT, swapOut INT, blockIn INT, blockOut INT, interuptsPerSec INT, contextSwitchesPerSec INT, userTime INT, systemTime INT, idleTime INT, waitTime INT, stolenTime INT, PRIMARY KEY (date, time) ); And the insert is done with: java -cp ${H2_JAR} org.h2.tools.Shell \ -url "jdbc:h2:tcp://localhost/${DB}" \ -user ${DB_USER} \ -password "${DB_PASSWORD}" \ -sql " INSERT INTO vmstatDefault ( runlength, runable, uninteruptable, swap, free, buffers, cache, swapIn, swapOut, blockIn, blockOut, interuptsPerSec, contextSwitchesPerSec, userTime, systemTime, idleTime, waitTime, stolenTime ) VALUES ( '${INTERVAL}', '${1}', '${2}', '${3}', '${4}', '${5}', '${6}', '${7}', '${8}', '${9}', '${10}', '${11}', '${12}', '${13}', '${14}', '${15}', '${16}', '${17}' ); " >>${LOG_FILE} -- Cecil Westerhof -- 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/groups/opt_out.