To reproduce the behavior you can try this. I am using version 1.3.170
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.Random;
public class H2Test
{
public static void main(String[] args) throws Exception
{
Connection connection = DriverManager.getConnection("jdbc:h2:somedatabase",
"sa", "");
connection.createStatement().execute("CREATE TABLE file_chunck\r\n" +
"(\r\n" +
" id IDENTITY PRIMARY KEY\r\n" +
" , hash BINARY(16) NOT NULL \r\n" +
");\r\n" +
"\r\n" +
"CREATE unique INDEX i_file_chunck_hash ON file_chunck(hash);");
for (int n=0; n<10; n++)
{
long start_time = System.currentTimeMillis();
for (int i=0; i<100000; i++)
{
byte[] bytes = new byte[16];
new Random().nextBytes(bytes);
String sql = "insert into file_chunck (hash) values (?)";
PreparedStatement statement = connection.prepareStatement(sql);
statement.setBytes(1, bytes);
statement.executeUpdate();
}
System.out.println("Done in " + (System.currentTimeMillis()-start_time));
}
}
}
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.