Filtering performance considerations
When a to-many relation is traversed in the query tree, performance is impacted because a new query is made against the Collibra internal storage engine. In the above example, the relation between the community and responsibility entities is of the to-many kind because a community can have many related responsibilities. Depending on the shape and amount of results, the performance penalty can range from completely irrelevant to a sizeable chunk added to the overall query time.
Here is the optimal way to query.
- JSON
- YAML
{
"ViewConfig": {
"Resources": {
"Community": {
"Id": { "name": "communityId" },
"Name": { "name": "communityName" },
"Responsibility": {
"Id": { "name": "responsibilityId" },
"User": {
"Id": { "name": "userId" },
"FirstName": { "name": "firstName" },
"LastName": { "name": "lastName" }
},
"Group": {
"Id": { "name": "groupId" },
"GroupName": { "name": "groupName" }
},
"Role": {
"Signifier": { "name": "roleName" }
}
}
}
}
}
}
---
ViewConfig:
Resources:
Community:
Id:
name: "communityId"
Name:
name: "communityName"
Responsibility:
Id:
name: "ResponsibilityId"
User:
Id:
name: "userId"
FirstName:
name: "firstName"
LastName:
name: "lastName"
Group:
Id:
name: "groupId"
GroupName:
name: "groupName"
Role:
Signifier:
name: "roleName"
The results should be formatted like the example below.
{
"view": {
"Community0": [
{
"communityId": "c87f166e-041f-4bea-8ff7-c1ffbab2ceeb",
"communityName": "First Community"
},
{
"communityId": "12345678-0020-0000-0000-000000000000",
"communityName": "Second Community",
"Responsibility1": [
{
"responsibilityId": "0ecb2fff-d5de-43d0-be60-f7f201c10d41",
"User2": [
{
"userId": "00000000-0000-0000-0000-000000900002",
"firstName": "Admin",
"lastName": "Istrator"
}
],
"Group3": [
{}
],
"Role4": [
{
"roleName": "Admin"
}
]
},
{
"responsibilityId": "42b9d114-2c0c-4e96-a1ce-b645d5e92365",
"User2": [
{
"userId": "00000000-0000-0000-0000-000000900002",
"firstName": "Admin",
"lastName": "Istrator"
}
],
"Group3": [
{}
],
"Role4": [
{
"roleName": "Steward"
}
]
},
{
"responsibilityId": "5fc0cc5f-e30e-488c-94bc-acdea171219d",
"User2": [
{}
],
"Group3": [
{
"groupId": "4eb1f4a9-14a3-4539-8afc-733925161179",
"groupName": "admin"
}
],
"Role4": [
{
"roleName": "Admin"
}
]
}
]
}
]
}
}