Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CockroachDB index should to store caveats #1923

Open
jzelinskie opened this issue Jun 4, 2024 · 2 comments
Open

CockroachDB index should to store caveats #1923

jzelinskie opened this issue Jun 4, 2024 · 2 comments
Labels
area/datastore Affects the storage system area/perf Affects performance or scalability hint/good first issue Someone new could handle this state/implementation ready This is ready to be worked on

Comments

@jzelinskie
Copy link
Member

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 jzelinskie added kind/proposal Something fundamentally needs to change area/perf Affects performance or scalability area/datastore Affects the storage system good first issue hint/good first issue Someone new could handle this and removed good first issue labels Jun 4, 2024
@jzelinskie
Copy link
Member Author

This can also be applied to our reverse index, too

@jzelinskie jzelinskie added state/implementation ready This is ready to be worked on and removed kind/proposal Something fundamentally needs to change labels Jun 5, 2024
@josephschorr josephschorr changed the title CockroachDB primary key constraint should to store caveats CockroachDB index should to store caveats Jul 14, 2024
@lalalalatt
Copy link

I just made a pull request (#1988) and I’m seeking some clarification on how this change can enhance the check performance.

From my understanding, there is only one type of SQL query used in the check request, and its WHERE condition is the same as the new index. Would a standard index suffice to improve the query speed? Additionally, could you please explain why STORING (caveat_name, caveat_context); is necessary?

Thank you for your assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datastore Affects the storage system area/perf Affects performance or scalability hint/good first issue Someone new could handle this state/implementation ready This is ready to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants