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

fix: missing indexes for count query #2694

Merged
merged 1 commit into from
Feb 7, 2023
Merged

fix: missing indexes for count query #2694

merged 1 commit into from
Feb 7, 2023

Conversation

scopsy
Copy link
Contributor

@scopsy scopsy commented Feb 7, 2023

What change does this PR introduce?

Add environmentId to the query to avoid collections scans on it and limited the amount of objects scanned until reached limit

Why was this change needed?

The current query is not utilizing indexes properly since an index on organizationId does not exists

Other information (Screenshots)

@scopsy
Copy link
Contributor Author

scopsy commented Feb 7, 2023

@davidsoderberg I know this will make it per environment and not per organization, but due to indexing and performance issue we must make this change. Queries here are taking 60 seconds in some cases

@davidsoderberg
Copy link
Contributor

@davidsoderberg I know this will make it per environment and not per organization, but due to indexing and performance issue we must make this change. Queries here are taking 60 seconds in some cases

It is okay as long as we are aware of now giving 1000 emails each month :)

@scopsy
Copy link
Contributor Author

scopsy commented Feb 7, 2023

@davidsoderberg why 1000 and not 600 total?

@davidsoderberg
Copy link
Contributor

@davidsoderberg why 1000 and not 600 total?

haha 600 I mean, did read the changed test right before writing the comment :P

@scopsy scopsy merged commit da4df4b into next Feb 7, 2023
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.

None yet

2 participants