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

sql: change create and alter role to take a constant number of round trips #50718

Open
RichardJCai opened this issue Jun 26, 2020 · 1 comment
Labels
A-sql-privileges SQL privilege handling and permission checks. C-performance Perf of queries or internals. Solution not expected to change functional behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@RichardJCai
Copy link
Contributor

RichardJCai commented Jun 26, 2020

This is pretty minor currently as we have a small number of options but it could increase in the future.
The number of round trips we take is currently linear with the number of privileges that the role is created / updated to have.

We should be able to batch the stmts into two statements, one for DELETE and one for UPSERT.
https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/alter_role.go#L182

Note: This is probably not worth implementing right now as we have 3 role options (excluding PASSWORD since it lives in system.users) and this would not improve the performance very much in this case while introducing some code complexity.

Jira issue: CRDB-4098

@blathers-crl
Copy link

blathers-crl bot commented Jun 26, 2020

Hi @RichardJCai, please add a C-ategory label to your issue. Check out the label system docs.

While you're here, please consider adding an A- label to help keep our repository tidy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@RichardJCai RichardJCai added A-sql-privileges SQL privilege handling and permission checks. C-performance Perf of queries or internals. Solution not expected to change functional behavior. labels Jun 26, 2020
@rafiss rafiss added this to Triage in SQL Sessions - Deprecated via automation Mar 31, 2022
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Mar 31, 2022
@rafiss rafiss moved this from Triage to Potentially for 22.2 in SQL Sessions - Deprecated Mar 31, 2022
@rafiss rafiss moved this from 22.2 Now to 22.2 Later in SQL Sessions - Deprecated Apr 21, 2022
@rafiss rafiss moved this from Up next to Longer term backlog in SQL Sessions - Deprecated Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-privileges SQL privilege handling and permission checks. C-performance Perf of queries or internals. Solution not expected to change functional behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
No open projects
Development

No branches or pull requests

1 participant