Index: MongoBlobStore.java =================================================================== --- MongoBlobStore.java (revision 1614633) +++ MongoBlobStore.java (working copy) @@ -165,6 +165,10 @@ DBObject options = new BasicDBObject(); options.put("unique", Boolean.TRUE); collection.ensureIndex(index, options); + // index on the lastMod to speed-up GC queries + index = new BasicDBObject(); + index.put(MongoBlob.KEY_LAST_MOD, 1L); + collection.ensureIndex(index); } private MongoBlob getBlob(String id, long lastMod) { @@ -228,8 +232,7 @@ } final DBCursor cur = - collection.find(builder.get(), fields).hint(fields) - .addOption(Bytes.QUERYOPTION_SLAVEOK); + collection.find(builder.get(), fields).addOption(Bytes.QUERYOPTION_SLAVEOK); //TODO The cursor needs to be closed return new AbstractIterator() {