-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Performance
-
None
see test code below. 11 sec for multi update vs. 70sec from the shell on localhost. that seems like an awfully big difference to me. surely can be better for the iterative case?
-----------------------
x =
{ classname: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" };
t = db.foo;
t.drop();
start = new Date();
for( var i = 0; i < 500000; i++ )
t.insert;
print( tojson( db.getLastError() ) );
print("insert done");
print(new Date() - start);
// e.g., 29secs
print(t.count());
start = new Date();
// multi update version
t.update(
, { $set:
{ classname: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb"} }, false, true);
// e.g., 11sec
/* manual iteration version
t.find(
).forEach(
function(u)
// faster:
//
// e.g., 56secs
// slower:
{ u.classname="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb"; t.save(u); } // e.g., 70sec
);
*/
print( tojson( db.getLastError() ) );
print("modifications done");
print( new Date() - start );
print(t.count());
- depends on
-
SERVER-665 special case simple queries for speed in qo
- Closed