Environment: VB.NET .NET Framework version 1.1 NHibernate version 1.0.2.0
We've got an Employee object which has loads of other objects, lists etc. as its properties. We're not using lazy loading, and cannot switch to doing so easily.
The problem is that now we need to - in code - bulk process a load of Employee objects, making use of only a subset of its properties - many of those loaded from other tables in the database will not be used. We're finding performance is not good, mainly because of the numerous extra joins etc. being processed. (We've checked our indexes, and we're not getting any table scans - only index seeks/scans.)
The options I can see as a way round this are:
1. Turn off lazy loading temporarily (is this possible?) 2. Create another lightweight object with only the properties needed. 3. Write some custom SQL/HQL to pick the objects/data we need.
I'd be interested in suggestions!
Thanks,
James
|