-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Simple Query taking forever in Hibernate
PostPosted: Fri Jan 09, 2009 7:03 am 
Newbie

Joined: Thu Jan 08, 2009 8:21 am
Posts: 5
Hibernate version: 3.1.3

Hello all,

I realy need some help with a serious performance-problem:

A simple Query (see log)...

Code:
[2009-01-09 11:27:34,609][DEBUG][org.hibernate.jdbc.AbstractBatcher]about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[2009-01-09 11:27:34,609][DEBUG][org.hibernate.SQL]select * from ( select this_.AA_KEY as AA1_1_0_, this_.VERS_NR as VERS2_1_0_, this_.NACHNAME as NACHNAME1_0_, this_.VORNAME as VORNAME1_0_, this_.GEBURTSDATUM as GEBURTSD5_1_0_, this_.KAT_STATUS as KAT6_1_0_, this_.KAT_BEZ as KAT7_1_0_, this_.NACHNAME_UPC as NACHNAME8_1_0_, this_.VORNAME_UPC as VORNAME9_1_0_, this_.VERTRAG_KEY as VERTRAG10_1_0_ from aa.PERSON_V this_ where this_.NACHNAME_UPC like ? and this_.VORNAME_UPC like ? order by this_.KAT_STATUS asc, this_.KAT_BEZ asc ) where rownum <= ?
Hibernate: select * from ( select this_.AA_KEY as AA1_1_0_, this_.VERS_NR as VERS2_1_0_, this_.NACHNAME as NACHNAME1_0_, this_.VORNAME as VORNAME1_0_, this_.GEBURTSDATUM as GEBURTSD5_1_0_, this_.KAT_STATUS as KAT6_1_0_, this_.KAT_BEZ as KAT7_1_0_, this_.NACHNAME_UPC as NACHNAME8_1_0_, this_.VORNAME_UPC as VORNAME9_1_0_, this_.VERTRAG_KEY as VERTRAG10_1_0_ from aa.PERSON_V this_ where this_.NACHNAME_UPC like ? and this_.VORNAME_UPC like ? order by this_.KAT_STATUS asc, this_.KAT_BEZ asc ) where rownum <= ?
[2009-01-09 11:27:34,619][DEBUG][org.hibernate.jdbc.AbstractBatcher]preparing statement
[2009-01-09 11:27:34,629][DEBUG][org.hibernate.type.StringType]binding 'DOE' to parameter: 1
[2009-01-09 11:27:34,629][DEBUG][org.hibernate.type.StringType]binding 'JOHN' to parameter: 2
[2009-01-09 11:27:43,552][DEBUG][org.hibernate.jdbc.AbstractBatcher]about to open ResultSet (open ResultSets: 0, globally: 0)


...is taking ~ 9 sec. when it is performed by Hibernate ([2009-01-09 11:27:34,629] to [2009-01-09 11:27:43,552]).

When I do the same query in PL/SQL-Developer, it only takes a max of 1.5 sec.!??

Im not taking about the performance of the entire "list()"-method. Just the query seems to take that long. Or isn't Hibernate debugging something out, that happens between the query and "about to open ResultSet"!??

Thank you very much for any hint!

Best regards
Stephan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 6:06 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
Two things:
1, don't see it binding the rowid.
2, If you are providing the exact value for nachname_upc and vorname_upc, why not use "=" instead of "like".

LinHib.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.