🚀 Performance Tuning with Project Metadata
In a metadata-driven system, substantial performance gains can often be achieved by adjusting project metadata. The tips below describe the most important properties to focus on when preparing a performance-optimized data model.
Containers​
Use group containers to optimize loading of graphics​
Group containers help optimize geometry loading by consolidating feature types that are commonly downloaded together. By reducing the number of tables queried by the database, overall performance can be improved.
This optimization applies only to geometry data, as the structure of the _F and _GR / _GT tables is consistent across all feature types. However, semantic tables are feature-specific in structure and therefore cannot be consolidated or optimized using group containers.
Codelist attributes​
Reduce outer joins by mandatory attributes​
OUTER JOINS are expensive operations and can have a substantial negative impact on database performance. When a codelist attribute is defined as nillable, an OUTER JOIN between the semantic table and the related codelist table becomes necessary.
To minimize performance overhead, codelist attributes should be defined as mandatory whenever possible. Assigning a reasonable default value is typically more efficient than allowing null values and forcing the use of OUTER JOINS.
The lids.disableEmptyMandatoryCodelistAttribute="true" property must be set. If set to true, the INNER JOIN is used for mandatory codelist attributes. Features with empty mandatory codelist attributes will be excluded from loading in such case. The property is optional to accommodate cases where such features exist and should still be loaded.
Relations​
Define smaller interfaces for relationships​
Interfaces in interfaceRole definitions allow a shared relationship to be defined across multiple feature types and containers. However, each interface role generates database views that combine data from all participating containers using UNION ALL. The more containers involved, the higher the performance cost.
From a performance perspective, it is recommended to define specific interfaces for specific relationships and to minimize the number of feature types included in each interface. A broad, all-encompassing interface reused across many relationships is generally not an optimal design choice.
Use Preserve master feature flag with caution​
The preserveMasterFeature="true" property in featureRefRelationAssoc should be used with caution. Although it provides important functionality, it may negatively impact performance. Child feature data is retrieved through the _D database view, which combines live table data with latest_history records from history tables. This additional processing can significantly increase query time.
Enable this flag only when strictly necessary.