Skip to content

sql: improve perf of has_database_privilege, has_schema_privilege and has_sequence_privilege #66173

@otan

Description

@otan

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

Metadata

Metadata

Assignees

Labels

C-enhancementSolution 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.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions