-->
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.  [ 5 posts ] 
Author Message
 Post subject: Performance problem...
PostPosted: Fri Feb 16, 2007 12:16 pm 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
Hi all,

I have a class Box. I'm trying to retrieve a list of Boxes but this list is very large (18407 results). If i try to map all these results, it takes about 15 seconds. So, i tryed to use SQL queries directly. I have a FireBird DataBase and i tested my query in IBExpert (a FireBird Client). It takes less than one second. However, when i'm trying to execute the same SQL query in my application it takes 20 seconds ! (more than the mapping !!!).


I tested my connection to the database and it doesn't take much time...
It's really a problem with retrieving my results...

I hope someone will be able to help me because i really have to fix this problem...

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 1:01 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Do you have debugging output turned on? That will slow you down...

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 19, 2007 4:16 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
No i didn't but could you tell me how to do it ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 19, 2007 4:25 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
I finally found how to do it and i just tried but unfortunately, it's not the problem...


Top
 Profile  
 
 Post subject: Re: Performance problem...
PostPosted: Mon Feb 19, 2007 5:03 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Samuel wrote:
I have a class Box. I'm trying to retrieve a list of Boxes but this list is very large (18407 results). If i try to map all these results, it takes about 15 seconds. So, i tryed to use SQL queries directly. I have a FireBird DataBase and i tested my query in IBExpert (a FireBird Client). It takes less than one second. However, when i'm trying to execute the same SQL query in my application it takes 20 seconds ! (more than the mapping !!!).

Do I understand You correctly that filling dataset takes 20 seconds while using NHibernate for same query takes only 15 seconds? In this case, there not much that NHibernate could possibly do.

It might be problem in firebird driver for .Net: try to update it, or test with alternate driver.

About that timing in IBExpert: does it include time to fetch all data? Fetching data can take many times longer than do execute query (they are not same things).

Anyway, to improve perfomance, review the amount of data (the size of individual record) that needs to be transferred. If possible, leave out BLOB fields, limit field amount etc. Best of all, do not query the whole list but only part of it (first 100 records, rest of records when needed).

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.