Hi,
I'm using LLBLGen Pro v4.0 with self servicing classes.
We have a performance consideration: we have a table (Documents) with a lot of relations to other tables with lookups. For example: DocStatus, SecurityLevel, DocStyle, DocType, Person, Project and lots more.
In the Document-grid we display a lot of these related fields and users can sort and filter on that columns. So we have to add the relations from the Documents-table to the other tables, which we do.
When we execute the query via GetMulti(predicateExpress, 1000, sort, relations, prefetchpath) we get the result but this takes a while. We also add the total amount of records with GetDbCount(rpbp.PredicateExpression, rpbp.Relations) without a maxlNumberOfItemsToReturn.
Some databases contains more than 2.000.000 records and because of all the relations the GetDbCounts takes about 10 seconds. When i remove al the relations the query takes 1.5 seconds, but than we get errors when a user filter on a related field.
Is there a possibility that the relation-collection (which we will add to the GetMulti() method) can be purged on the basis of the predicate-expression?
For example: When the user filters only on a field in the related-table DocStatus, only that relations needs to be present in the relation-collection.
I know it is possible (via a HelperClass of helpermethod) to remove (cleanup) unnecessary items in the RelationCollection, but how can i determine which relations a need on the basis of the predicate-expression?
Best regards,
Sander.