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

Improve performance of sys.sp_column_privileges by removing an unutilized check #3359

Conversation

shalinilohia50
Copy link
Contributor

@shalinilohia50 shalinilohia50 commented Jan 6, 2025

Description

Improve performance of sys.sp_column_privileges by removing an unutilized check.

Cherry-picked from #3348

Issues Resolved

Task: BABEL-5353
Signed-off-by: Shalini Lohia [email protected]

Test Scenarios Covered

Performance Testing
20 login, 50 databases, each with 10 tables in dbo and 10 schema with 10 tables each making it 5.5k tables
Each database has 20 users in each database making it 500+ users
Each database has 10 new roles.

1> select count(*) from sp_column_privileges_view
2> go

 4748 rows (1469 ms)


1> select * from sp_table_privileges_view
2> go

585 rows (1630 ms)
query Execution time before with func Execution time after with func, current change Execution time before with join Execution time before [without join, it returns incorrect value]
EXEC sp_column_privileges @table_name = 'db1_table3' 2903 1453 1927 1338
EXEC sp_column_privileges @table_name = 'db1_table3', @table_qualifier = 'db1', @COLUMN_NAME='column1' 2900 1442 1812 1290
CREATE PROCEDURE usp_GetColumnPrivileges @TableName NVARCHAR(128) AS begin EXEC sys.sp_column_privileges @table_name = @TableName; end ; usp_GetColumnPrivileges @TableName = 'db1_table3'; 2893 1454 1860 1339
EXEC sp_table_privileges @table_name = 'db1_table3' 1590 1590 1473 1435
  • Use case based -
  • Boundary conditions -
  • Arbitrary inputs -
  • Negative test cases -
  • Minor version upgrade tests -
  • Major version upgrade tests -
  • Performance tests -
  • Tooling impact -
  • Client tests -

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 12630585534

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 74.879%

Totals Coverage Status
Change from base Build 12596832761: 0.0%
Covered Lines: 46736
Relevant Lines: 62415

💛 - Coveralls

Copy link
Contributor

@jsudrik jsudrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@jsudrik jsudrik merged commit 03febfb into babelfish-for-postgresql:BABEL_4_X_DEV Jan 6, 2025
47 checks passed
@shalinilohia50 shalinilohia50 deleted the lshalini-fix-5353 branch January 6, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants