Hello, all
I´m beggining to use Hibernate in a huge ERP system which has tables with more than 15 mi rows.
We´re currently evaluating Hibernate for use with this system. Our other option is use JDBC directly. The key here is the performance x simplicity of code.
Using Hibernate and HQL is far more simple than JDBC and SQL directly (which must be compatible with at least 3 diferent databases - Oracle, MSSQL and DB2 - in that case, we have some especific SQL commands, then comes the "if (Oracle) blablaal else if (MSSQL) blalblala")).
On our tests, using Hibernate, it takes 13 times more than JDBC directly. We just made a "SELECT * FROM T1", where T1 have 210,000 rows, and fetch all records in a while:
1) JDBC directly: 2.5 secs
2) Hibernate (using objecs - i.e. "from T1"): 85.828 secs
3) Hibernate (using select fields - i.e. "select f1, f2, f3 from T1"): 33.164 secs
The process to create an object and assign all fields to it consumes a lot of time (item 2 above). Load an array of Objects is much more faster, but also very slow, compared to JDBC (item 3 above).
Debugging the execution, we discovered that this time consume is for boxing the primitives that were loaded from database. Is there any way to use the primitives directly?
Or any sugestion to improve this performance?
We really want to use Hibernate, but this performance is really an issue.
Thank you.
|