Skip to content

Instantly share code, notes, and snippets.

@igorcanadi
Created May 29, 2015 16:15
Show Gist options
  • Save igorcanadi/ea4cd0fcb042fe9af3c5 to your computer and use it in GitHub Desktop.
Save igorcanadi/ea4cd0fcb042fe9af3c5 to your computer and use it in GitHub Desktop.
db.adminCommand({ setParameter: 1, internalQueryExecYieldIterations: 100000 });
db.adminCommand({ setParameter: 1, internalQueryExecYieldPeriodMS: 10000 });
t = db.background_index_build;
t.drop();
for ( i=0; i< 100000; i++ ){
t.save( { x : i } );
}
s = startParallelShell(
"for (i=0; i < 50000; i++) { db.background_index_build.remove({x: i*12347 % 50000}); }"
);
t.createIndex( { x: 1 }, { background: true } );
s();
var a = t.find().sort({x:1});
assert.eq(a.length(), 50000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment