パッケージに依存するプログラムの実行中にoracle.sql
、同じ数の long を永続化する場合と比較して、2 億を超えるタイムスタンプを永続化すると、パフォーマンスに大きな影響があります。
永続化する Java:
Collection<ARRAY> longs = new ArrayList<ARRAY>(SIZE);
Collection<ARRAY> timeStamps = new ArrayList<ARRAY>(SIZE);
for(int i = 0; i < SIZE;i++)
{
longs.add(new ARRAY(description, connection, i));
timeStamps.add(new ARRAY(description,connection,new Timestamp(new Long(i)));
}
Statement timeStatement = conn.createStatement();
statement.setObject(1,timeStamps);
statement.execute(); //5 minutes
Statement longStatement = conn.createStatement();
statement.setObject(1,longs);
statement.execute(); //1 minutes 15 seconds
私の質問は、オラクルがタイムスタンプを大量に挿入するのを非常にひどいものにするために何をしているのかということです。
構成:
64 bit RHEL 5
jre 6u16
ojdbc14.jar
64 GB dedicated to the JVM
更新
java.sql.Timestamp
が使用されています