hi,
i'm using selfservicing and there i have to load complex structures.
// Buidling Prefetched path with filters
IPrefetchPath oPrefetchPath = new PrefetchPath((int)EntityType.VwArenaEntity);
IPrefetchPathElement oPathArenaGW =
oPrefetchPath.Add.VwArenaEntity.PrefetchPathVwArenaGw);
oPathArenaGW.Filter.Add(new FieldCompareRangePredicate(VwArenaGwFields.Lessonnumber, aLessonIds));
FieldCompareValuePredicate oSeriesPredicate2 = new FieldCompareValuePredicate
(VwArenaGwFields.Seriescode, ComparisonOperator.Equal, strSeriesCode.ToUpper());
oSeriesPredicate2.CaseSensitiveCollation = true;
oPathArenaGW.Filter.AddWithAnd(oSeriesPredicate2);
// Buidling filters
IPredicate oLessonsPredicate = new FieldCompareRangePredicate
(VwArenaFields.Lessonnumber, aLessonIds);
FieldCompareValuePredicate oSeriesPredicate = new FieldCompareValuePredicate
(VwArenaFields.Seriescode, ComparisonOperator.Equal, strSeriesCode.ToUpper());
oSeriesPredicate.CaseSensitiveCollation = true;
IPredicateExpression oConstraint = new PredicateExpression();
oConstraint.Add(oLessonsPredicate);
oConstraint.AddWithAnd(oSeriesPredicate);
IPredicateExpression oSubConstraint = new PredicateExpression();
oSubConstraint.AddWithOr(new FieldCompareValuePredicate(VwArenaFields.Wcshort,
ComparisonOperator.NotEqual, "j"));
oConstraint.AddWithAnd(oSubConstraint);
// Loading Data
VwArenaCollection oVocables = new VwArenaCollection();
oVocables.GetMulti(oConstraint, 0, null, null, oPrefetchPath);
VwArena and VwArenaGW are views in firebird, which have a foreign key relation from VwArenaGW to VwArena.
the execution of the GetMulti lasts very, very long, if many VwArenaEntities have to be loaded. already above 40 entities there is nearly no coming back from the execution.
but if there are at most 30 entities it is fast.
my idea was to load the entities with paging. only 20-30 by one execution and than loop untill all entities are fetched. this was really faster.
but the strange thing is, if i specify something like this
oVocables.GetMulti(oConstraint, 0, null, null, oPrefetchPath, 1, 1000);
it is also very fast! in this i fetch all entities in one statement by setting the page size high enough. i would have thought that this would be very slow too!
Why is loading all data with paging much more faster than the normal attempt in this case????