Skip to content

Instantly share code, notes, and snippets.

@balboah
Created July 13, 2011 12:49
Show Gist options
  • Save balboah/1080234 to your computer and use it in GitHub Desktop.
Save balboah/1080234 to your computer and use it in GitHub Desktop.
mongo freebsd bug
// Save as test.js and run in console with:
// time mongo test.js
db.users.drop();
for (var i=0; i < 100; i++) { db.users.insert({}); }
for (var i=1; i < 100; i++) {
var result = db.users.find().limit(1);
if (! result.hasNext()) continue; // This check together with the insert below makes it terrible slow
db.communications.insert({text: 'testing'});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment