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 MongoMonitoringApi.GetQueues() #371

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Improve performance of MongoMonitoringApi.GetQueues() #371

merged 1 commit into from
Nov 10, 2023

Conversation

bourquep
Copy link
Contributor

Instead of using an aggregation pipeline, which needs to scan the whole collection to get the results, use Mongo's "Distinct" command which is super fast.

Instead of using an aggregation pipeline, which needs to scan the whole collection to get the results, use Mongo's "Distinct" command which is super fast.
Copy link
Owner

@gottscj gottscj left a comment

Choose a reason for hiding this comment

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

Thanks! (^o^)/

@bourquep
Copy link
Contributor Author

Thanks! (^o^)/

You're welcome! Any chance this could get released soon? 🙏 😇

@gottscj gottscj merged commit cf65214 into gottscj:master Nov 10, 2023
1 check passed
@gottscj
Copy link
Owner

gottscj commented Nov 10, 2023

@bourquep,

I just released v1.9.13, should be indexed by nuget.org shortly.
cheers!

@bourquep
Copy link
Contributor Author

You are amazing. Thanks so much!

@bourquep
Copy link
Contributor Author

@gottscj Oops, I forgot to create an index required to make this Distinct command snappy (I had manually created the index on my side, completely forgot to implement it in the library).

I'll submit that as another PR.

If I want to add an index, I must create a new Migration Step, right?

@gottscj
Copy link
Owner

gottscj commented Nov 11, 2023

No worries. What's the index. I can add it

@bourquep
Copy link
Contributor Author

It's:

{
  "_t": 1,
  "Queue": 1
}

@gottscj
Copy link
Owner

gottscj commented Nov 12, 2023

Thanks,

I already have an index:

{ Queue: 1, _t: 1, FetchedAt: 1 }

Do you think that will do?

@bourquep
Copy link
Contributor Author

No, unfortunately.

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.

2 participants