Hi.
I observed a very slow response of mongo while having a lot of thoughts in the system.
The query behind the scene is doing something like:
db.getCollection('thoughts').find({}).sort({"time":-1}).limit(1500)
There is no index on reverse time - so adding an index by:
db.thoughts.createIndex({"time":-1})
speeded the processing up to factor 10.
So you may add something like:
get('db.mongo.db').collection('thoughts').ensureIndex({app: 1, time: 1, key: 1}, done)
to indexes.js
There are some more of these missing indexes in there ... ;-)
Hi.
I observed a very slow response of mongo while having a lot of thoughts in the system.
The query behind the scene is doing something like:
db.getCollection('thoughts').find({}).sort({"time":-1}).limit(1500)
There is no index on reverse time - so adding an index by:
db.thoughts.createIndex({"time":-1})
speeded the processing up to factor 10.
So you may add something like:
get('db.mongo.db').collection('thoughts').ensureIndex({app: 1, time: 1, key: 1}, done)
to indexes.js
There are some more of these missing indexes in there ... ;-)