Open dvstans opened 4 years ago
So you would have project_membership edges and or group_membership edges , I don't fully understand the problem only that extra hops are being done in the query. A step-by-step explanation of the current query execution would clarify the problem I think.
It's basically a consequence of using the same vertex collection for ACL groups and project membership groups. They can both be used as ACL targets, but the project membership group is used for other purposes elsewhere. This makes other queries more complex because they have to distinguish between the two. Adding metadata on the edge would allow pruning of unwanted paths without needing to load group docs - this is only a minor optimization and probably doesn't reduce overall complexity much.
There are currently some complex graph traversals that required to load group documents in order to determine if they are ACL groups or project membership groups. It would reduce complexity and improve performance if the member edges to these groups were marked as project membership to prevent loading the group document itself.