File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes [Hibernate Query] Slow performance with Oracle as compared to MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate Query] Slow performance with Oracle as compared to MySQL" Watch "[Hibernate Query] Slow performance with Oracle as compared to MySQL" New topic
Author

[Hibernate Query] Slow performance with Oracle as compared to MySQL

Abhijit Salunkhe
Greenhorn

Joined: May 06, 2009
Posts: 5
Hi Pros,

We are using Hibernate for the persistent layer of our Java based web application.It has been observed that the application response time is significantly slow when using Oracle as compared to using MySQL.

For Example.
Particular transaction (used as a abstract term) say transactionX takes approximately 18 Sec with MySQL. Same transationX when fired using Oracle as a database completes in approximately 55 Sec.

Is there any known issue with hibernate which must be causing this performance issue with Oracle?

We fired generated SQL statements directly from SQL editor. Our initial investigation directs towards use of joins, but not sure if this is the real culprit.

Also, In configurations we found one difference,

For MySQL
For Oracle

Thanks in advance,
Abhijit Salunkhe
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Many factors can lead to this, and it is not necessarily Hibernate that is the cause.

Main things I would ask is what is the explain plan you get from Oracle, that would tell you a lot about the query.

Maybe you don't have indexes in Oracle that you had in MySQL. Or that you had no indexes in MySQL, that you now need in Oracle. Ask your Oracle DBA to analyze your query.

Are you eager loading too much data?

There are many possibilities here, but I recommend what I wrote above first.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: [Hibernate Query] Slow performance with Oracle as compared to MySQL