Show
Shell reproductions
Commands.CountsIntIDRange
var setup = function( collection ) {
collection.drop();
var docs = [];
for ( var i = 0; i < 4800; i++ ) {
docs.push( { _id : i } );
}
collection.insert(docs);
collection.getDB().getLastError();
}
use test0
setup(db.Commands_CountsIntIDRange0)
benchRun({"ops":[{"op":"command","ns":"test0","command":{"count":"Commands_CountsIntIDRange0","query":{"_id":{"$gt":10,"$lt":100}}},"safe":false,"w":0,"j":false,"writeCmd":true}],"seconds":30,"host":"127.0.0.1:27017","parallel":8})
Commands.DistinctWithoutIndex
var setup = function( collection ) {
collection.drop();
var docs = [];
for ( var i = 0; i < 4800; i++ ) {
docs.push( { x : 1 } );
docs.push( { x : 2 } );
docs.push( { x : 3 } );
}
collection.insert(docs);
collection.getDB().getLastError();
};
use test0
setup(db.Commands_DistinctWithoutIndex0)
benchRun({"ops":[{"op":"command","tags":["distinct","command","core"],"ns":"test0","command":{"distinct":"Commands_DistinctWithoutIndex0","key":"x"},"safe":false,"w":0,"j":false,"writeCmd":true}],"seconds":30,"host":"127.0.0.1:27017","parallel":8})
Mixed.FindOneUpdateIntId-50-50
var setup = function( collection ) {
collection.drop();
var docs = [];
for ( var i = 0; i < 4800; i++ ) {
docs.push( { _id : i , x : 0 } );
}
collection.insert(docs);
collection.getDB().getLastError();
}
use test0
setup(db.Mixed_FindOneUpdateIntId)
benchRun({"ops":[{"op":"let","target":"x","value":{"#RAND_INT_PLUS_THREAD":[0,100]},"ns":"test0.Mixed_FindOneUpdateIntId","safe":false,"w":0,"j":false,"writeCmd":true},{"op":"findOne","query":{"_id":{"#VARIABLE":"x"}},"ns":"test0.Mixed_FindOneUpdateIntId","safe":false,"w":0,"j":false,"writeCmd":true},{"op":"update","query":{"_id":{"#VARIABLE":"x"}},"update":{"$inc":{"x":1}},"ns":"test0.Mixed_FindOneUpdateIntId","safe":false,"w":0,"j":false,"writeCmd":true}],"seconds":5,"host":"127.0.0.1:27017","parallel":8})