-->
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.  [ 1 post ] 
Author Message
 Post subject: Performing N selects (N small), some select takes long time.
PostPosted: Mon Mar 14, 2005 9:25 pm 
Beginner
Beginner

Joined: Thu Jan 06, 2005 6:21 pm
Posts: 23
Hello,

I'm using b]Hibernate 3.0[/b], Tomcat 5.0.28, JDK 1.4.2_07 and Jtds 1.0.2
and MS SQL sever

I have a big flat table containing about 200 fields. This table has few millions rows.
For a given list of fields I want to get one value (any) and also the list of all the distinct value for that field.

Let say I need to get one value for 40 fields out of the 200.
One thing I thought about was get that value for each field. So I generated 40 selects in a while loop that were getting each value.

I noticed that it was really fast the first time I was getting the first 40 values (each select was taking few millisec) but if I was running this again some queries would take up to 10 sec in the second batch!

I invertigated a little, changed hibernate setup, used a different connection pool (c3p0, DBCP), used Jdts, microsoft jdbc driver. But I could not get the second call as fast as the first one.
Some select just takes forever for some reason the second time where they are really fast the first time.
Memory is fine (I just load 40 small object in the memory). There is no garbage collection happening that would explain why the select would take so long.

Does anyone has a clue about what's going on?

Thanks,

Richard


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

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.