-
Notifications
You must be signed in to change notification settings - Fork 68
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
_ensureIndex on more fields #122
Comments
Probably yes... I'm still living in a mindset where indexing is a developer decision, but I guess I already violated that some time ago. I don't have much time between now and the end of the year, so this kind of thing (not really a bug) will probably need to wait. |
Should we add this then just to the documentation? To the section where we are mentioning indexes? |
+1 for just adding them in. Is there anytime these wouldn't want to be indexed? |
@mitar If you want to implement this, I'm fine with it. |
Fixed in |
👍 FYI @vsiverson and @mitar I'm about to look into implementing Job Collection as a work queue for management tasks in Space.eventSourcing, such as snapshotting and projection rebuilds, so I'll be around if you need to bounce any ideas etc |
Where does this query comes from? |
Oh good point, looks like it's from some code we have that checks for stuck jobs periodically. So I guess it's up to you whether you want the package to set up the index. I believe pkgs should ensure indexes for the queries they do, but whether you want to anticipate other common queries, that's personal preference I guess. |
Yea, I think this should be done by your code then. I think this is clear that if you are doing some other queries it is on you to create indexes. |
I see that we are also doing queries on status for finding stale jobs. But I do create our own indexes. |
Hm, but those are no extra indexes, besides what is provided by this package. But also indexes depends on the number of jobs you have. For not many jobs it might not be so needed. |
I don't think the type-status combined index helps when you're querying on status only |
That is my understanding as well. |
I agree that the package should only create indexes for queries it generates internally. Maintaining indexes isn't free, so generating indexes that you don't know will be needed is wasteful. |
Mitar's additional indexes will be released in 1.3.0 on Atmosphere today. |
Should we have indexes also on:
getWork
sorts by those fields.I have not measured anything, this is just by observing queries.
The text was updated successfully, but these errors were encountered: