This limit can be set through the property
ActiveViamProperty.DIRECT_QUERY_SUB_QUERY_LIMIT,
but it is recommended to not increase it too much.
Examples
Example with one table
Consider the following tableSALES.
With this table clusterized by dates,
the query
sum quantities by product is split up in queries of the form sum quantities by product where date equals ....
Example with multiple tables
Now consider this additional tablePRODUCTS, storing all the products referenced in the SALES table.
This table is clusterized by
CATEGORY.
With a query computing the sum of the margins by product, both the SALES and PRODUCTS table will be accessed,
so the two clustering fields DATE and CATEGORY will be used to split the query up.
Considerations
Clustering fields and external database clustering
DirectQuery clustering fields can be chosen independently of any database clustering.Still it can be interesting to match DirectQuery tables clustering fields with the potential clustering already implemented in your external database. This results in better performances for the sub-queries generated.
Clustering fields and Aggregate Provider partitioning
DirectQuery clustering fields can be chosen independently of any configured partitioning for Aggregate Providers. DirectQuery will repartition and reaggregate on the fly if needed.Still it can be interesting to match DirectQuery tables clustering fields with the partitioning of the existing Aggregate Providers. This coherence results in better performances to avoid the cost of repartitioning.