-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(github-invite): use sql for missing members API to utilize db indices #56911
Conversation
Co-authored-by: Alberto Leal <[email protected]>
for filtered_email in filtered_email_domains: | ||
additional_query += f"""and email not like '%{filtered_email}' """ | ||
|
||
query = f""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: this query doesn't include the relation to the org member set, but somehow tests are all passing
.annotate(Count("commit")) | ||
.order_by("-commit__count") | ||
) | ||
def _get_missing_organization_members_query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth looking into if its better to write raw SQL or trying to use SubQuery
django stuff etc. e.g.
default=Subquery( |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Use SQL to better utilize db indices to improve the performance of the API. Attempts to fix SENTRY-161D.
Existing indices
Commit
:("repository_id", "date_added")
CommitAuthor
doesn't have an index on external_id, but if we filter on it after using a subquery, it's already filtered.Also removes querying for commit author
external_id
and/oremail
because we don't surface this anywhere on the FE.