Hi all,
I'm optimizing an import process.
Characteristics are as follows:
* First a new schema is created (DROP + CREATE DATABASE)
* No multithreading - Only one thread is inserting records
* No other processes are accesing the database at time of import
* Database: MySQL 5.0
* Only one Hibernate session is used
* Connection is provided externally from Hibernate (e.g. no datasource)
* Only INSERT + SELECT, no DELETE
The Netbeans 5.0 Profiler shows that about 25% of the total import time is spent in
* AbstractBatcher#prepareBatchStatement - 19,5%
* AbstractBatcher#prepareSelectStatement - 6%
I think this could be optimized by re-using prepared statements. Since I'm using the same java.sql.Connection throughout the whole import, it is at least theoretically possible.
http://www.hibernate.org/15.html mentions PreparedStatement caching as a performance optimization, but I haven't found such a cache after a first peek into the Hibernate Source Code.
Any thoughts ?
Thx in advance