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