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

Performance Improvement of create login in BBF #507

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/backend/utils/adt/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5076,7 +5076,18 @@ roles_is_member_of(Oid roleid, enum RoleRecurseType type,
*/
if (otherid == admin_of && form->admin_option &&
OidIsValid(admin_of) && !OidIsValid(*admin_role))
*admin_role = memberid;
{
*admin_role = memberid;

/*
* Need not to iterate through all the members
* if admin_role is found.
*/
if (sql_dialect == SQL_DIALECT_TSQL)
{
return NULL;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to restrict this logic to some special roles with significant membership like 'sysadmin' and 'bbf_role_admin'.

Let's get more opinions from perf. experts @surendravishnoi @KushaalShroff

}
anju15bharti marked this conversation as resolved.
Show resolved Hide resolved

/* If we're supposed to ignore non-heritable grants, do so. */
if (type == ROLERECURSE_PRIVS && !form->inherit_option)
Expand Down
Loading