-->
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: Question about Criteria and Restrictions.in
PostPosted: Tue Jan 24, 2006 8:41 pm 
Newbie

Joined: Fri Sep 16, 2005 3:08 am
Posts: 15
Hello, all

I am using Criteria and Restrictions.in to load objects. I have 100,000 rows of Thing class, and I want to find those rows whose name is in a set.
Names are strings.

Set set = new HashSet();//put here 5000 names
getSession().createCriteria(Thing.class).add(Restrictions.in("name", set)).list();

And it runs so slow, seems will not stop.
But when I try the same operation directly with JDBC, it runs very fast.

Can anybody give me some suggestions, or is my way insane?

Thanks,


Top
 Profile  
 
 Post subject: hmmm
PostPosted: Wed Jan 25, 2006 3:35 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please check if there are any differences in the H generated sql and the SQL you are executing.
There should be something different to justify such a difference.

As a wild idea: are there enough connections available to Hibernate so it does not get blocked on getConnection somehow.

PS: I made quick experiment with H 3.1.1 and see no difference between JDBC and H SQL and performance

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.