Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use mgo.Collection.Bulk to prune docs #20
Conversation
mjs
approved these changes
Oct 31, 2016
This looks great for 2.0.
Before this gets used with 1.25 (MongoDB 2.4), it would be good to test the performance of mgo's Bulk fallback for older MongoDB versions.
|
For posterity: I tested with mongo 2.4, and there is no performance penalty for the existing approach. Using Bulk isn't as fast there because 2.4 doesn't support bulk operations, and so mgo just turns it into a series of operations. Nevertheless, it only takes a few seconds to remove the 10000 documents, so we'll stick with just using Bulk across the board for simplicity. |
|
$$merge$$ |
axw
merged commit af2fa20
into
juju:master
Oct 31, 2016
added a commit
to axw/mgopurge
that referenced
this pull request
Feb 7, 2017
axw
referenced this pull request
in juju/mgopurge
Feb 7, 2017
Closed
Apply https://github.com/juju/txn/pull/20 #4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
axw commentedOct 30, 2016
•
Edited 1 time
-
ericsnowcurrently
Oct 30, 2016
Use bulk document removal, rather than
a single RemoveAll with a query of "_id $in [...]".
The latter has performance problems in some
configurations of MongoDB. See https://bugs.launchpad.net/juju/+bug/1635311.
Excerpt from the bug:
(Review request: http://reviews.vapour.ws/r/5955/)