• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: query optimization

 
Manoj Chandran
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

For my current project an HQL is taking over 8 min to excute.
Is there some way to optimize this query and bring the execution time down?
the hql is like as shown below:

 
Benjamin Winterberg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try to put an index onto some of the columns from your where clause. You also could try to replace one or more JOINs with subselects.

I dont know which DB you are using (8 mins sounds insane). You can inspect the explain plan of the sql query to see whats going wrong there, if your DB got something like that (explain plan is oracle specific).

You should also check if you're using the right database driver. Try the generated sql with a proprietary database tool and look if its the same time as from hibernate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic