authzed / spicedb

Open Source, Google Zanzibar-inspired permissions database to enable fine-grained authorization for customer applications
https://authzed.com/docs
Apache License 2.0
4.7k stars 249 forks source link

CockroachDB primary key constraint should to store caveats #1923

Open jzelinskie opened 3 weeks ago

jzelinskie commented 3 weeks ago

Problem Statement

A production system recommended the following index: CREATE INDEX ON relation_tuple (namespace, relation, object_id, userset_relation) STORING (caveat_name, caveat_context);

Solution Brainstorm

This is the closest to our primary key constraint and should improve overall check performance.

jzelinskie commented 3 weeks ago

This can also be applied to our reverse index, too