-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: improve perf of has_database_privilege, has_schema_privilege and has_sequence_privilege #66173
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
Alternatively, "remove usage of evalPrivilegeCheck".
In #65766, we removed a bunch of nested SQL calls from the builtins from has_table_privilege and has_column_privilege. We should do the same for has_database_privilege, has_schema_privilege and has_sequence_privilege.
We should expand HasPrivilegeSpecifier to cover the remaining cases.
We should then add to the benchmark in pkg/bench/rttanalysis/orm_queries_bench_test.go and run make test PKG=./pkg/bench/rttanalysis TESTS=TestBenchmarkExpectation/ORMQueries TESTFLAGS='-rewrite --rewrite-iterations=10' to regenerate the output.
Epic CRDB-8948
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)