JoostJoh
06/16/2025, 12:29 PMdefinition user {}
definition person {
relation owner: tenant
relation representation: user
permission view = owner->member
}
definition tenant {
relation member: person#representation
}
Now we are seeing an big performance hit looking up if user:a can see person:b, when an tenant has a lot of members (> 10k). It follows the following path:
✓ person:william view
└── ✓ tenant:main member
└── ✓ person:jan,john,joost,william representation
└── user:3
It first looks up all the people that are a member of our tenant, then it loops through all the people until it finds the user (representation) with id 3. Any recommendations on how we could handle this lookup more efficiently?
We would like to keep our abstraction of an user representing a person instead of making users direct members of the tenant.yetitwo
06/16/2025, 2:14 PMJoostJoh
06/16/2025, 2:18 PMyetitwo
06/16/2025, 2:19 PMJoostJoh
06/16/2025, 2:21 PMyetitwo
06/16/2025, 2:23 PMperson as the resource and view as the permission?JoostJoh
06/16/2025, 2:24 PMzed permission check person:william view user:3yetitwo
06/16/2025, 2:27 PMmember is a wide relation.yetitwo
06/16/2025, 2:27 PMyetitwo
06/16/2025, 2:30 PMperson id associated with a given user you can skip that hop 🤔JoostJoh
06/16/2025, 2:31 PMJoostJoh
06/16/2025, 2:34 PMyetitwo
06/16/2025, 2:39 PMyetitwo
06/16/2025, 2:39 PMJoostJoh
06/16/2025, 2:42 PMJoostJoh
06/16/2025, 2:43 PMyetitwo
06/16/2025, 2:48 PMyetitwo
06/16/2025, 2:48 PMJoey
06/16/2025, 9:19 PM100 (the default) to 1000 (or more), which should helpJoey
06/16/2025, 9:20 PM--dispatch-chunk-sizeJoostJoh
06/17/2025, 6:54 AMQueryRelationships relation call for more than 10 seconds.Joey
06/17/2025, 4:00 PMJoostJoh
06/17/2025, 8:10 PMJoey
06/17/2025, 9:55 PMJoostJoh
06/18/2025, 2:08 PM