sql: change create and alter role to take a constant number of round trips #50718
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)
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 forUPSERT
.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
The text was updated successfully, but these errors were encountered: