• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Partitioning in Hibernate

 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Hibernate with Spring and have come across this strange problem.

There is a table A which was not partitioned before.

However to optimize certain queries, it was partitioned on one of the columns.

With this change, other queries which do not use the partitioning on the view over the table seem to become slow...

The strange part is that these queries which do not use the partitioning columns seem to be slow only when executed from Hibernate and seem to be very fast when executed from a SQL client like SQLPlus or TOAD.

Is it expected? What can be done to avoid it?

Rahul
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Partitioning should make no difference - Hibernate will know nothing about it. Turn on show sql and get an explain plan for the slow query. That might give you a clue.
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i did and the strange part as i mentioned before is that the query seemed to take quite a long time to execute when Hibernate was doing it but the oracle client like TOAD gave instantaneous results.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So presumably its not the query and partitioning is a red herring? If you are sure of that, and you explain plan backs this up, you need to profile your application and see what it is doing with the results of this query.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic