openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adish Abnave" <>
Subject OpenJPA versus Hibernate Performance - SQL Generated by Named Query
Date Fri, 07 Dec 2007 19:16:06 GMT
Has anyone done any performance analysis of OpenJPA versus Hibernate? We
recently migrated from Hibernate to OpenJPA. The performance analysis
done using Jmeter shows that and OpenJPA takes approximately 4 times
longer than hibernate for executing a simple Named query. The SQL
generated by OpenJPA for a Named Query involving simple Join operation
between 2 tables, also joins a bunch of other tables which is really not

For Example,

            Named Query: "SELECT a FROM Table_A a WHERE a.b.c =: Val";

SQl Generated joins on all the tables Referenced from Table_A, lets say
Table_B and Table_C and the all the Tables referenced from Table_B and
Table_C and so on.

            Native Query: "select a.* from Table_A a, Table_B b where
a.b_fk = and b.c_fk = val"

            So, comparing the Named Query generated SQL to the Native
SQL Query I see that when comparing only the a.b_fk foreign key and
b.c_fk foreign key should be suffice, the Named query generated Sql
compares all foreign keys of Table_A and all foreign keys for table
referenced from Table_A and so on.



Adish Abnave

Software Development Engineer


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message