-->
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.  [ 6 posts ] 
Author Message
 Post subject: Query response is very slow.....
PostPosted: Thu Jan 21, 2010 10:35 pm 
Newbie

Joined: Mon Aug 04, 2008 2:35 pm
Posts: 4
Location: Texas
Hi,

I am using hibernate with JPA. i have a oracle table having 5 columns and 50K rows on it. When i execute select tablename from tablename t , it takes 7 mins to execute the query and return list. no joins nothing, its simple select query. can anyone tell me how to reduce execution time ?

your help is highly appreciated.

thanks & regards
Siva


Top
 Profile  
 
 Post subject: Re: Query response is very slow.....
PostPosted: Fri Jan 22, 2010 1:22 am 
Regular
Regular

Joined: Mon Jan 05, 2009 6:42 pm
Posts: 99
Location: IL
How long does it take to execute the query on the database itself? Also are there any network issues to connect to the database from the app?


Top
 Profile  
 
 Post subject: Re: Query response is very slow.....
PostPosted: Fri Jan 22, 2010 8:58 am 
Newbie

Joined: Mon Aug 04, 2008 2:35 pm
Posts: 4
Location: Texas
thanks for the reply latha,

When i run the query in database it takes 45 seconds. i don know there is any network issue. hw to check is there network issue ?


Top
 Profile  
 
 Post subject: Re: Query response is very slow.....
PostPosted: Fri Jan 22, 2010 11:43 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Putting some pertinent indexes on that table might be extremely helpful. Get your db admin to do it.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Query response is very slow.....
PostPosted: Fri Jan 22, 2010 12:11 pm 
Regular
Regular

Joined: Mon Jan 05, 2009 6:42 pm
Posts: 99
Location: IL
to check the network speed, just hit a dummy or dual table with no records. in your app log the timestamp before hitting the database and after hitting the database.
-Srilatha.


Top
 Profile  
 
 Post subject: Re: Query response is very slow.....
PostPosted: Mon Jan 25, 2010 6:33 pm 
Newbie

Joined: Mon Aug 04, 2008 2:35 pm
Posts: 4
Location: Texas
Hi ,

I did check the query response time. Response time is less than a second. ( Just i executed select sysdate from dual ). But when i execute this query and debug through eclipse

Code:
select
        MSA,
        HPI,
        LAST_UPDATED,
        HPX,
        LAST_ACTUAL,
        YMX
    from
        table_name
    order by
        MSA,
        HPI


It takes 9 mins.

When i run the same query using toad or dbartisan, it takes 1:17 mins, this table contains around 91680 records.

Usually how much time hibernate takes to construct Entity for all these records. hw to check.... any idea to reduce the time.

thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.