Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Switch sort direction of index in order to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
chrboe committed Feb 20, 2017
1 parent cd3d0a9 commit 2b08908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports.index = function (collection) {

// Ensures there's a reasonable index for the poling dequeue
// Status is first b/c querying by status = queued should be very selective
collection.ensureIndex({ status: 1, queue: 1, priority: 1, _id: 1, delay: 1 }, function (err) {
collection.ensureIndex({ status: 1, queue: 1, priority: -1, _id: 1, delay: 1 }, function (err) {
if (err) console.error(err);
});
};

0 comments on commit 2b08908

Please sign in to comment.