Hi,
I'm, working on a driver where we have multiple tables that relate to each other.
I've added foreign keys and have about 9 relations on those tables, but only one relation is actually used for something.
In this situation, knowing that relations have some impact on the protocol performance, does it make sense to add these relations between tables if there is no need for them yet?
Thanks in advance
Hi Pedro,
If the relations are not being used then these can be removed as it has an impact on SLElement that needs to keep this in memory, and the Foreignkey columns are also saved automatically into the database.
As far as I can quickly remember, relations are only useful in the following cases where data is being:
- Exported to a DVE
- Used in a treecontrol
- Used in a table view
- Used in an EPM Chain
- Used in an alarm property (alarm property in a parameter needs data of a parameter in a parent table)
- Aggregation being done in a recursive table towards another related table
To complete the list from Laurens, relations also have a critical role when working with function resources.
Also when using nested “naming formats” from linked tables the relation & FK is required.
https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.Params.Param.ArrayOptions.NamingFormat.html
Thanks!