I'm not sure exactly why this explodes to 500 queries. Maybe I'm missing something but it seems to me the batchsize settings should be able to keep that down to fairly few queries, though more than four. Which batchsize have you set, and to what values?
Another point to consider is that this sounds like some sort of report page, which isn't exactly what NHibernate is optimized for. If this is true, it may be useful to just use SQL to project the data to a dataset or some simple view model and forget about the entities for this case. There might also be the option of caching the "compiled" view model in memory or serialized in e.g. a nosql database. How many objects are we talking about in each level here? If the numbers grow beyond perhaps 10000 or so I would expect you to experience sluggishness from NHibernate having to create all those objects, even if data is fetched efficiently from the database. /Oskar 2012/2/2 Brad Laney <[email protected]>: > So... do it in raw sql, build the entities, and merge them into > session? > > That's going to take so freaking long, this is required in almost > every single select query we do. > > On Feb 2, 11:22 am, Darren Kopp <[email protected]> wrote: >> Why not just use raw sql? I use nhibernate everywhere in my system until I >> need to do something that I can't do with nhibernate or would be >> prohibitive performance wise to do so with nhibernate. Then I drop back to >> raw sql. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
