You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, when calling `get()`, we:
- query on `deleted` and `visible`
- sort on `_id`
We have indexes for both of these things, but separately, which results
in an inefficient query, since MongoDB will have to check both indexes
and can result in a complete index scan, which isn't particularly great.
We sort by `_id` presumably to get the oldest job (since `_id` is an
`ObjectId` whose sort order correlates to creation time).
However, we probably actually want the job that was visible first.
This change updates to sort to use `visible`, which also means that the
query and sort can use the same index.
0 commit comments