Creating partitioned custom entities¶
You can create partitioned custom entities if you foresee that a database table will contain a high amount of data and it is possible to delete older data from that table. This mode allows 'obsolete' partitions to be 'deleted' from the table without impacting the performance of running queries. Partitions are deleted based on the settings and granularity defined during the entity configuration. These particular custom entities cannot be used in any relationship with another custom entity.
The choice of the partitioning type depends on the amount of data that will be added to the table per unit of time. The optimal number of records per partition is between 1 and 10 million.
Procedure¶
- On the Project page, select the "Model Extensions" tab.
- Click "Create Model Extension". For example, you can create an alarm entity.
- Insert the "Name" (for example Alarm) and (optionally) a "Description".
- Select the "Granularity Type" (for example, Standard).
- Select the "Entity Type." For partitioning, only the "Analytical Fact" or "Generic Entity" types are allowed. For example, select Generic Entity.
- Add some columns to the entity. For example, you can add a message as an attribute for the alarm as TextAttribute type and a relationship to the equipment entity.
- Add a column that will be used to determine the partition to which data will be assigned. In this configuration it can only be of type datetime, so you can add for example a column of EventDateTime type.
- Under the "Partitioning" column, select the corresponding checkbox and select the partitioning type which can be by Week, by Month or by Year. This selection determines the "size" of the partition, which will therefore contain data for a week, a month, or a year, respectively.
- You can also add a Retention interval if you want the system to perform an automatic data purge when the retention period expires. The retention interval can be modified or added after you have saved the entity. Data compression is enabled by default. You might decide to clear the "Enable compression" checkbox in particular cases to be discussed at project level.
- Save the entity.
- A deploy of the environment is then required to make these settings effective.
Last update: October 26, 2026