I am currently working with Arcade expressions in attribute rules and have come across a performance-related question for which I haven’t yet found a clear comparison in the community.
Initial situation:
I am working with the following feature classes and tables:
- Address
Fields: aId (PK), from_number, sId (FK) - Street
Fields: sId (PK), name - Status
Fields: aIdORsId (FK), status, type
Relationships:
- Address – Status (1:1)
- Street – Address (1:n)
- Street – Status (1:1)
I would like to create an attribute rule on the Status table:
If:
- type = "Address" and
- status = "Error"
then the status of the related Street should also be set to "Error".
Implementation approaches:
Option 1: Using FeatureSetByRelationshipName
var addr = First(FeatureSetByRelationshipName($feature, "Address-Status"))
var str = First(FeatureSetByRelationshipName(addr, "Street-Address"))
var stat = First(FeatureSetByRelationshipName(str, "Street-Status"))
Option 2: Using FeatureSetByName
var addr = First(FeatureSetByRelationshipName($feature, "Address-Status"))
var statFs = FeatureSetByName($datastore, "Status")
var stat = First(Filter(statFs, 'aIdORsId = @addr.sId'))
Question:
Which approach is more performant?
I am particularly interested in:
- Should FeatureSetByRelationshipName generally be preferred when relationships are available?
- How much does the number of FeatureSet calls impact performance?
- Is a combination of FeatureSetByRelationshipName and FeatureSetByName problematic in terms of additional requests?