-->
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: query between different datasources
PostPosted: Thu Feb 28, 2008 6:56 am 
Newbie

Joined: Mon Feb 11, 2008 4:29 pm
Posts: 6
Hi!

How can Hibernate be properly configured to obtain the results on a query between 2 datasources in a reasonable time?

It's taking about 1 second to generate the query and 1 second to display 10 results... and think that the whole table has about 11000 lines.

If the query is made between tables from the same datasource, all the 11000 lines are displayed in about 2 seconds.

We are using Spring for session managemet, and we have a session for each database.

Any ideeas to solve the time problem?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 1:13 am 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
For what you say, Hibernate is taking approximately the same time as the database query (which is remarkable, considering that it has to map the resultsets to objects).

-Use the setFirstResult/setMaxResults (pagination) a lot
-Try rethinking your design so that no that many rows are returned in a single trip.
-Use views.
-See if you can create views in one database on tables from the other.
-Use subselect entities with only the fields you need.

_________________
Gonzalo Díaz


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.